/* ── Commission Header ── */
.commission-header {
    background: linear-gradient(135deg, #f5e6d3 0%, #faf0e6 50%, #f5e6d3 100%);
    border: 3px solid #b8860b;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.commission-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.commission-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.commission-status-open {
    background: linear-gradient(135deg, #2d6a2e, #3a8c3c);
    color: #e8f5e9;
    border: 2px solid #4caf50;
}

.commission-status-closed {
    background: linear-gradient(135deg, #8b2020, #a63c3c);
    color: #fce4e4;
    border: 2px solid #e57373;
}

.commission-settings-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
}

/* ── Services Section ── */
.commission-services-section {
    margin-bottom: 1.5rem;
}

.commission-services-section h3 {
    color: #8b4513;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.commission-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.commission-service-card {
    background: linear-gradient(135deg,
        rgba(139, 69, 19, 0.95) 0%,
        rgba(160, 82, 45, 0.95) 50%,
        rgba(139, 69, 19, 0.95) 100%);
    border: 2px solid #b8860b;
    border-radius: 12px;
    padding: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    outline: none;
}

.commission-service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.commission-service-card:focus-visible {
    box-shadow: 0 0 0 3px #b8860b;
}

.commission-service-card .service-name {
    color: #ffd700;
    font-size: 1.15rem;
    margin: 0 0 0.5rem 0;
}

.commission-service-card .service-description {
    color: #f5e6d3;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 0.75rem 0;
}

.commission-service-card .service-price {
    color: #ffd700;
    font-size: 1.2rem;
    font-weight: 700;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(184, 134, 11, 0.5);
}

.commission-service-card.service-closed {
    opacity: 0.65;
}

.commission-no-services {
    color: #8b4513;
    font-style: italic;
    padding: 1rem 0;
}

/* Per-service status badge */
.service-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.service-status-badge.service-open {
    background: rgba(184, 134, 11, 0.25);
    color: #ffd700;
    border: 1px solid rgba(184, 134, 11, 0.5);
}

.service-status-badge.service-closed {
    background: rgba(166, 60, 60, 0.25);
    color: #f5b0b0;
    border: 1px solid rgba(229, 115, 115, 0.4);
}

.service-card-hint {
    font-size: 0.78rem;
    color: rgba(245, 230, 211, 0.65);
    margin-top: 0.75rem;
    text-align: right;
}

/* Status badge overrides inside the light modal */
.service-detail-status.service-open {
    background: rgba(184, 134, 11, 0.15);
    color: #7a5900;
    border-color: rgba(184, 134, 11, 0.5);
}

.service-detail-status.service-closed {
    background: rgba(166, 60, 60, 0.12);
    color: #8b1a1a;
    border-color: rgba(166, 60, 60, 0.4);
}

/* ── Terms Section ── */
.commission-terms-section {
    margin-top: 1rem;
}

.commission-terms-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(139, 69, 19, 0.1);
    border: 2px solid #b8860b;
    border-radius: 10px;
    color: #8b4513;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.commission-terms-toggle:hover {
    background: rgba(139, 69, 19, 0.2);
}

.commission-terms-chevron {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.commission-terms-chevron.rotated {
    transform: rotate(180deg);
}

.commission-terms-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    color: #2c1810;
    line-height: 1.7;
}

.commission-terms-body.expanded {
    max-height: 2000px;
    padding: 1rem 0.5rem;
}

.commission-terms-body p {
    margin-bottom: 0.75rem;
}

.commission-terms-body ul,
.commission-terms-body ol {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

/* ── Posts Divider ── */
.commission-posts-divider {
    margin-bottom: 1.5rem;
}

.commission-posts-divider h3 {
    color: #8b4513;
    font-size: 1.3rem;
}

.commission-posts-grid {
    display: grid;
    gap: 1.5rem;
}

/* ── Inquiry Form ── */
.commission-inquiry-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(184, 134, 11, 0.3);
}

.commission-inquiry-title {
    color: #8b4513;
    font-size: 1.2rem;
    margin: 0 0 0.4rem 0;
}

.commission-inquiry-subtitle {
    color: #6b4c3b;
    font-size: 0.95rem;
    margin: 0 0 1.25rem 0;
}

.commission-inquiry-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.inquiry-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.inquiry-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.inquiry-field label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #5a3e2b;
}

.inquiry-field .required {
    color: #c0392b;
}

.inquiry-field input,
.inquiry-field select,
.inquiry-field textarea {
    padding: 0.6rem 0.85rem;
    border: 1px solid #c8a96e;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    color: #3d2b1f;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.inquiry-field input:focus,
.inquiry-field select:focus,
.inquiry-field textarea:focus {
    outline: none;
    border-color: #8b4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.12);
}

.inquiry-field textarea {
    resize: vertical;
    min-height: 130px;
}

.inquiry-char-count {
    text-align: right;
    font-size: 0.8rem;
    color: #9a7a5a;
}

.inquiry-actions {
    display: flex;
    justify-content: flex-end;
}

.inquiry-feedback {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
}

.inquiry-feedback.hidden {
    display: none;
}

.inquiry-feedback-success {
    background: #e6f4e6;
    border: 1px solid #5cb85c;
    color: #2d6a2d;
}

.inquiry-feedback-error {
    background: #fde8e8;
    border: 1px solid #e57373;
    color: #8b1a1a;
}

/* Service info panel */
.inquiry-service-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.inquiry-service-info.hidden {
    display: none;
}

.inquiry-service-info-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(139, 69, 19, 0.1);
    border: 1px solid rgba(184, 134, 11, 0.4);
    color: #5a3000;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
}

.inquiry-service-info-item i {
    color: #8b4513;
    font-size: 0.8rem;
}

/* File upload */
.inquiry-optional {
    font-size: 0.82rem;
    font-weight: 400;
    color: #9a7a5a;
}

.inquiry-field input[type="file"] {
    display: none;
}

.inquiry-file-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.55rem 1rem;
    border: 1px dashed #c8a96e;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    color: #6b4c3b;
    font-size: 0.9rem;
    font-weight: 500;
    transition: border-color 0.2s ease, background 0.2s ease;
    width: fit-content;
}

.inquiry-file-label:hover {
    border-color: #8b4513;
    background: rgba(139, 69, 19, 0.06);
    color: #5a2800;
}

.inquiry-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.inquiry-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(139, 69, 19, 0.08);
    border: 1px solid rgba(184, 134, 11, 0.35);
    color: #4a2800;
    font-size: 0.82rem;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inquiry-file-chip i {
    color: #8b4513;
    flex-shrink: 0;
}

/* ── Toggle Switch ── */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #8b2020;
    transition: 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
}

input:checked + .slider {
    background-color: #3a8c3c;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 28px;
}

.slider.round:before {
    border-radius: 50%;
}

/* ── Service Rows (modal) ── */
.commission-service-row {
    background: rgba(139, 69, 19, 0.08);
    border: 1px solid #b8860b;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.service-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
}

.service-row-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.service-open-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #8b4513;
    min-width: 3rem;
}

.service-row-drag {
    color: #b8860b;
    cursor: grab;
    font-size: 1.1rem;
}

.service-remove-btn {
    background: none;
    border: none;
    color: #a63c3c;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.service-remove-btn:hover {
    background: rgba(166, 60, 60, 0.15);
}

.service-row-fields .form-row {
    display: flex;
    gap: 1rem;
}

.service-row-fields .form-group {
    flex: 1;
    margin-bottom: 0.5rem;
}

.service-row-fields label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #8b4513;
}

.service-row-fields input,
.service-row-fields textarea {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid #b8860b;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #2c1810;
    font-size: 0.9rem;
}

.service-translations {
    margin-top: 0.5rem;
}

.service-translations summary {
    color: #b8860b;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.25rem 0;
}

.service-translations[open] summary {
    margin-bottom: 0.5rem;
}

/* ── Service Detail Modal ── */
#service-detail-modal .modal-title {
    color: #b8860b;
}

.service-detail-modal-content {
    max-width: 680px;
    width: 95%;
}

.service-detail-body {
    padding-top: 0.5rem;
}

.service-detail-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.service-detail-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: #8b4513;
}

.service-detail-section {
    margin-bottom: 1.25rem;
}

.service-detail-section h4 {
    color: #7a5c00;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem 0;
    border-bottom: 1px solid rgba(184, 134, 11, 0.4);
    padding-bottom: 0.35rem;
}

.service-detail-description {
    color: #2c1810;
    line-height: 1.6;
}

.service-detail-turnaround {
    color: #2c1810;
    margin: 0;
}

.service-detail-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.service-detail-image {
    max-width: 180px;
    max-height: 180px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(184, 134, 11, 0.4);
}

/* Admin image upload */
.service-images-group {
    margin-top: 0.75rem;
}

.service-images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.service-image-thumb {
    position: relative;
    width: 80px;
    height: 80px;
}

.service-image-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid rgba(184, 134, 11, 0.5);
}

.service-image-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #8b1a1a;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.service-image-remove:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .commission-services-grid {
        grid-template-columns: 1fr;
    }

    .commission-header {
        padding: 1.25rem;
    }

    .commission-header-top {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .service-row-fields .form-row {
        flex-direction: column;
        gap: 0;
    }
}

@media (max-width: 600px) {
    .inquiry-form-row {
        grid-template-columns: 1fr;
    }
}
