body {
    font-family: sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    text-align: left; /* 左揃えに変更 */
}

h1, h2 {
    color: #333;
    text-align: center; /* 中央揃えは維持 */
}

.top-buttons {
    margin-top: 50px;
    display: flex;
    flex-direction: row; /* 横並びにする */
    gap: 20px;
    justify-content: center; /* 中央寄せ */
}

.btn {
    display: inline-block; /* blockから変更 */
    width: auto; /* 自動幅 */
    padding: 15px 30px; /* パディング調整 */
    font-size: 1.1em; /* フォントサイズ調整 */
    text-align: center;
    text-decoration: none;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #0056b3;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="file"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

#existing-lighting-table .sub-table-row {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    background-color: #fff;
}

#existing-lighting-table .sub-table-row .form-group {
    margin-bottom: 15px;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    padding: 15px 30px; /* btn と同じパディングに変更 */
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    display: inline-block;
    width: auto;
    padding: 15px 30px;
    font-size: 1.1em;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background-color: #dc3545;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-danger:hover {
    background-color: #c82333;
}

#add-row-btn {
    display: block;
    margin: 20px auto;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    justify-content: space-around; /* space-betweenから変更 */
    align-items: center;
}

#loading-message {
    text-align: center;
    padding: 20px;
    color: #007bff;
}
.remove-row-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    float: right;
    margin-bottom: 10px;
}

/* Record List Styles */
#record-list {
    margin-top: 30px;
}

.record-item {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.record-details p {
    margin: 5px 0;
}

.record-details p strong {
    margin-right: 10px;
}

.record-action .btn {
    padding: 10px 20px;
    width: 40px; /* 詳細ボタンの幅を固定 */
}

/* Detail Page Styles */
.detail-container {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 30px;
    margin-top: 30px;
}

.detail-group {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.detail-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-group p {
    margin: 8px 0;
}

.detail-group p strong {
    display: inline-block;
    color: #555;
}

.detail-sub-table {
    margin-top: 10px;
}

.sub-table-item {
    border: 1px solid #e9e9e9;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
}

.sub-table-item p {
    margin: 5px 0;
}

.detail-files {
    /* display: flex; を削除 */
    /* align-items: center; を削除 */
    margin: 10px 0;
}

.detail-label-col {
    width: 180px; /* 固定幅 */
    /* margin-right: 30px; を削除 */
    margin-bottom: 10px; /* ラベルの下にスペース */
    flex-shrink: 0;
}

.detail-label-col p {
    margin: 0;
}

.detail-value-col {
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    /* margin-left: 210px; を削除 */
}

.detail-label-col p strong {
    color: #555;
}

.detail-image {
    max-width: 150px;
    max-height: 150px;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin: 0;
    object-fit: cover;
}

/* Thumbnail Preview Styles */
.thumbnail-preview-container {
    margin-top: 10px;
    position: relative;
    display: inline-block; /* to wrap content */
}

.thumbnail-preview {
    max-width: 150px;
    max-height: 150px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.thumbnail-remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    line-height: 22px;
    text-align: center;
    padding: 0;
}

/* The Modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    padding-top: 100px; /* Location of the box */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
}

/* Modal Content (image) */
.modal-content {
    margin: auto;
    display: block;
    /* Removed fixed width/max-width to allow dynamic scaling via JS */
    max-width: 100%;
    max-height: 80vh; /* Limit height to viewport height */
    object-fit: contain; /* Ensure the whole image is visible */
    transform-origin: center center; /* Set transform origin for scaling */
    transition: transform 0.1s ease-out; /* Smooth transition for zoom */
}

/* Caption of Modal Image */
#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    /* height: 150px; /* Removed fixed height */
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 1001; /* Ensure controls are above modal content */
}

.zoom-btn {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.zoom-btn:hover {
    background-color: rgba(255, 255, 255, 0.4);
}



/* Add Animation */
.modal-content, #caption {
    -webkit-animation-name: zoom;
    -webkit-animation-duration: 0.6s;
    animation-name: zoom;
    animation-duration: 0.6s;
}

@-webkit-keyframes zoom {
    from {-webkit-transform:scale(0)}
    to {-webkit-transform:scale(1)}
}

@keyframes zoom {
    from {transform:scale(0)}
    to {transform:scale(1)}
}

/* The Close Button */
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* 100% Image Width on Smaller Screens */
@media only screen and (max-width: 700px){
    .modal-content {
        width: 100%;
    }
}

.required::after {
content: "必須";
color: #ffffff;
background: #cc0000;
font-size: 0.8em;
padding: 0.3em;
border-radius: 0.5em;
margin-left:0.3em;
}

/* Status Message Styling */
.status-message {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    text-align: center;
    display: none; /* Hidden by default */
}

.status-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {

            background-color: #f8d7da;

            color: #721c24;

            border: 1px solid #f5c6cb;

        }

        

        /* Pagination Styles */

        .pagination {

            display: flex;

            justify-content: center;

            margin-top: 30px;

            gap: 10px;

        }

        

        .page-link {

            display: inline-block;

            padding: 8px 12px;

            border: 1px solid #007bff;

            color: #007bff;

            text-decoration: none;

            border-radius: 4px;

            transition: background-color 0.3s, color 0.3s;

        }

        

        .page-link:hover {

            background-color: #007bff;

            color: white;

        }

        

        .page-link.active {

            background-color: #007bff;

            color: white;

            font-weight: bold;

        }

        

        .page-link.disabled {

            border: 1px solid #ccc;

            color: #ccc;

            cursor: not-allowed;

            background-color: #f9f9f9;

        }

        

        .page-link.disabled:hover {

            background-color: #f9f9f9;

            color: #ccc;

        }

        

    

    /* Pagination Styles */

    .pagination {

        display: flex;

        justify-content: center;

        margin-top: 30px;

        gap: 10px;

    }

    

    .page-link {

        display: inline-block;

        padding: 8px 12px;

        border: 1px solid #007bff;

        color: #007bff;

        text-decoration: none;

        border-radius: 4px;

        transition: background-color 0.3s, color 0.3s;

    }

    

    .page-link:hover {

        background-color: #007bff;

        color: white;

    }

    

    .page-link.active {

        background-color: #007bff;

        color: white;

        font-weight: bold;

    }

    

    .page-link.disabled {

        border: 1px solid #ccc;

        color: #ccc;

        cursor: not-allowed;

        background-color: #f9f9f9;

    }

    

    .page-link.disabled:hover {

        background-color: #f9f9f9;

        color: #ccc;

    }

    
