/* ===========================================
   Archive Banner Admin Styles - Complete Version
   =========================================== */

/* ---- Main Container Styles ---- */
.banner-images-wrapper {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-bottom: 15px;
}

.banner-images-wrapper p {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

.banner-images-wrapper p:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.banner-images-wrapper label {
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 8px;
}

.banner-images-wrapper button {
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ccd0d4;
    background: #f6f7f7;
    cursor: pointer;
    transition: all 0.2s ease;
}

.banner-images-wrapper button:hover {
    background: #e8e8e8;
    border-color: #999;
}

.banner-images-wrapper .remove-image-button,
.banner-images-wrapper .remove-file-button {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.banner-images-wrapper .remove-image-button:hover,
.banner-images-wrapper .remove-file-button:hover {
    background: #c82333;
    border-color: #bd2130;
}

/* ---- Properties Management ---- */
.property-item {
    margin-bottom: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.property-item input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.property-item input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.property-item .remove-property {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease;
}

.property-item .remove-property:hover {
    background: #c82333;
}

#properties_container {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 15px;
    background: #fafafa;
    margin-bottom: 15px;
}

#add_property {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

#add_property:hover {
    background: #005a87;
}

/* ---- Button Settings ---- */
.button-item {
    border: 2px solid #e0e0e0;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 10px;
    background: #fafafa;
    transition: all 0.3s ease;
}

.button-item:hover {
    border-color: #ccd0d4;
    background: #f6f7f7;
}

.button-item h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #1d2327;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 3px solid #0073aa;
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.button-item h4::before {
    content: "🔘";
    font-size: 14px;
}

.button-item .form-table {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.button-item .form-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #1d2327;
    padding: 15px;
    vertical-align: top;
    border-bottom: 1px solid #e0e0e0;
}

.button-item .form-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.button-item .form-table tr:last-child th,
.button-item .form-table tr:last-child td {
    border-bottom: none;
}

/* ---- Form Elements ---- */
.form-table th {
    width: 180px;
    padding: 15px;
    vertical-align: top;
}

.form-table td {
    padding: 15px;
}

.form-table input[type="text"],
.form-table input[type="url"],
.form-table input[type="number"],
.form-table select,
.form-table textarea {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-table input[type="text"]:focus,
.form-table input[type="url"]:focus,
.form-table input[type="number"]:focus,
.form-table select:focus,
.form-table textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.form-table .regular-text {
    width: 100%;
    max-width: 400px;
}

.form-table .large-text {
    width: 100%;
    max-width: 600px;
    min-height: 120px;
    resize: vertical;
}

.form-table .small-text {
    width: 80px;
}

/* ---- Color Picker Styles ---- */
.color-picker-container {
    display: inline-block;
    position: relative;
}

.wp-picker-container {
    margin-bottom: 15px;
}

.wp-picker-container .wp-color-result {
    border-radius: 4px;
    border: 2px solid #ddd;
    transition: all 0.2s ease;
}

.wp-picker-container .wp-color-result:hover {
    border-color: #0073aa;
}

/* ---- Radio & Checkbox Styles ---- */
.form-table input[type="radio"],
.form-table input[type="checkbox"] {
    margin-left: 8px;
    margin-right: 0;
    transform: scale(1.1);
}

.form-table label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    font-weight: 500;
}

.form-table label:hover {
    color: #0073aa;
}

/* ---- Style Field Visibility ---- */
.style-1-field,
.style-2-field,
.style-3-field {
    transition: all 0.4s ease;
    overflow: hidden;
}

.style-1-field[style*="display:none"],
.style-2-field[style*="display:none"],
.style-3-field[style*="display:none"] {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

/* ---- File Upload Section ---- */
.file-field-container {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.file-preview {
    background: white;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
}

.file-preview strong {
    color: #333;
}

.upload-file-button,
.upload-image-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s ease;
}

.upload-file-button:hover,
.upload-image-button:hover {
    background: #005a87;
}

/* ---- Description Text ---- */
.form-table .description {
    font-size: 13px;
    color: #666;
    font-style: italic;
    margin-top: 8px;
    line-height: 1.5;
}

.form-table .description strong {
    color: #333;
    font-weight: 600;
}

.form-table .description code {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: Monaco, Consolas, monospace;
    font-size: 12px;
    color: #d63384;
}

/* ---- Help Boxes ---- */
.help-box {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    font-size: 13px;
    line-height: 1.6;
}

.help-box strong {
    color: #0073aa;
    font-weight: 600;
}

.help-box ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.help-box li {
    margin-bottom: 5px;
}

/* ---- Custom Title Sizes Section ---- */
#custom-title-sizes-fields {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-top: 15px;
}

#custom-title-sizes-fields > div {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 15px;
}

#custom-title-sizes-fields label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #1d2327;
}

#custom-title-sizes-fields input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* ---- Sidebar Image Section ---- */
.sidebar-image-section {
    border-top: 2px solid #e0e0e0;
    padding-top: 20px;
    margin-top: 20px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
}

/* ---- Image Preview ---- */
[id*="_preview"] img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    padding: 5px;
    background: white;
}

/* ---- Category Grid in Style 3 ---- */
.style-3-field .form-table td > div[style*="max-height"] {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background: #f8f9fa;
    max-height: 350px !important;
    overflow-y: auto;
}

.style-3-field label[style*="display: block"] {
    background: white;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    cursor: pointer;
}

.style-3-field label[style*="display: block"]:hover {
    background: #f0f8ff;
    border-color: #0073aa;
}

.style-3-field input[type="checkbox"] {
    margin-left: 10px;
}

/* ---- Responsive Design ---- */
@media (max-width: 782px) {
    .form-table th,
    .form-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }

    .form-table th {
        border-bottom: none;
        padding-bottom: 5px;
    }

    #custom-title-sizes-fields > div {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .property-item {
        flex-direction: column;
        align-items: stretch;
    }

    .button-item {
        padding: 15px;
    }
}

/* ---- Loading States ---- */
.banner-loading {
    opacity: 0.6;
    pointer-events: none;
}

.banner-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ---- Error States ---- */
.form-invalid input,
.form-invalid textarea,
.form-invalid select {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 1px #dc3545 !important;
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    font-weight: 500;
}

/* ---- Success States ---- */
.form-valid input,
.form-valid textarea,
.form-valid select {
    border-color: #28a745 !important;
}

.success-message {
    color: #28a745;
    font-size: 12px;
    margin-top: 5px;
    font-weight: 500;
}
