/**
 * Collection Edit Modal Styles
 * V21 Navy/Gold Design
 * 
 * NOTE: CSS variables defined in css/variables.css
 */

/* ========================================
   MODAL OVERLAY
   ======================================== */

.collection-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 30, 46, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

/* ========================================
   MODAL CONTAINER
   ======================================== */

.collection-modal {
    background: linear-gradient(135deg, var(--navy), var(--dark-navy));
    border: 2px solid var(--gold);
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

/* Use keyframes from utilities.css: slideUp */

/* ========================================
   MODAL HEADER
   ======================================== */

.collection-modal-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid rgba(212, 165, 116, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.collection-modal-title {
    font-size: 1.75em;
    font-weight: 700;
    color: var(--bright-gold);
    margin: 0;
}

.collection-modal-close {
    background: transparent;
    border: 1px solid var(--gold);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    cursor: pointer;
    transition: all 0.3s ease;
}

.collection-modal-close:hover {
    background: var(--gold);
    color: var(--dark-navy);
    transform: rotate(90deg);
}

/* ========================================
   MODAL BODY
   ======================================== */

.collection-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.collection-modal-body::-webkit-scrollbar {
    width: 8px;
}

.collection-modal-body::-webkit-scrollbar-track {
    background: rgba(212, 165, 116, 0.1);
    border-radius: 4px;
}

.collection-modal-body::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

.collection-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--bright-gold);
}

.modal-section {
    margin-bottom: 24px;
}

.modal-section:last-child {
    margin-bottom: 0;
}

/* ========================================
   MODEL INFO (Read-only)
   ======================================== */

.modal-model-info {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: rgba(212, 165, 116, 0.1);
    border: 1px solid rgba(212, 165, 116, 0.3);
    border-radius: 12px;
}

.modal-model-thumb {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--dark-navy);
}

.modal-model-details {
    flex: 1;
}

.modal-model-brand {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gold);
    margin-bottom: 4px;
}

.modal-model-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--bright-gold);
    margin-bottom: 4px;
}

.modal-model-make {
    font-size: 14px;
    color: var(--cream);
    opacity: 0.8;
}

/* ========================================
   FORM FIELDS
   ======================================== */

.modal-field {
    margin-bottom: 20px;
}

.modal-field:last-child {
    margin-bottom: 0;
}

.modal-field-group {
    margin-bottom: 28px;
    padding: 20px;
    background: rgba(212, 165, 116, 0.05);
    border: 1px solid rgba(212, 165, 116, 0.2);
    border-radius: 12px;
}

.modal-section-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--gold);
    margin: 0 0 16px 0;
}

.modal-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--cream);
    margin-bottom: 8px;
}

.modal-input,
.modal-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--dark-navy);
    border: 1px solid rgba(212, 165, 116, 0.3);
    border-radius: 8px;
    color: var(--cream);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.modal-input:focus,
.modal-textarea:focus {
    outline: none;
    border-color: var(--bright-gold);
    box-shadow: 0 0 0 3px rgba(244, 196, 48, 0.2);
}

.modal-input::placeholder,
.modal-textarea::placeholder {
    color: rgba(245, 230, 211, 0.4);
}

.modal-textarea {
    resize: vertical;
    min-height: 60px;
}

.input-with-prefix {
    position: relative;
}

.input-prefix {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    font-weight: 600;
    pointer-events: none;
}

.input-with-prefix .modal-input {
    padding-left: 32px;
}

/* ========================================
   CONDITION SELECTOR
   ======================================== */

.condition-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.condition-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    background: var(--dark-navy);
    border: 2px solid rgba(212, 165, 116, 0.3);
    border-radius: 8px;
    color: var(--cream);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.condition-btn:hover {
    border-color: var(--gold);
    background: rgba(212, 165, 116, 0.1);
}

.condition-btn.active {
    border-color: var(--bright-gold);
    background: rgba(244, 196, 48, 0.2);
    color: var(--bright-gold);
}

.condition-icon {
    font-size: 16px;
    display: none;
}

.condition-btn.active .condition-icon {
    display: block;
}

.condition-label {
    font-size: 13px;
}

/* Condition-specific colors */
.condition-btn[data-condition="mint"].active {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.condition-btn[data-condition="near-mint"].active {
    border-color: #84cc16;
    background: rgba(132, 204, 22, 0.15);
    color: #84cc16;
}

.condition-btn[data-condition="good"].active {
    border-color: #eab308;
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.condition-btn[data-condition="fair"].active {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.condition-btn[data-condition="poor"].active {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ========================================
   RATING SELECTOR
   ======================================== */

.rating-selector {
    display: flex;
    gap: 8px;
}

.rating-star {
    background: transparent;
    border: none;
    font-size: 32px;
    color: rgba(212, 165, 116, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px;
}

.rating-star:hover {
    color: var(--gold);
    transform: scale(1.2);
}

.rating-star.active {
    color: var(--bright-gold);
}

/* ========================================
   PRIORITY SELECTOR
   ======================================== */

.priority-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.priority-btn {
    padding: 16px;
    background: var(--dark-navy);
    border: 2px solid rgba(212, 165, 116, 0.3);
    border-radius: 8px;
    color: var(--cream);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.priority-btn:hover {
    border-color: var(--gold);
    background: rgba(212, 165, 116, 0.1);
}

.priority-btn.active {
    border-color: var(--bright-gold);
    background: rgba(244, 196, 48, 0.2);
    color: var(--bright-gold);
}

.priority-icon {
    font-size: 24px;
}

.priority-label {
    font-size: 14px;
}

/* Priority-specific colors */
.priority-btn[data-priority="high"].active {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.priority-btn[data-priority="medium"].active {
    border-color: #eab308;
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.priority-btn[data-priority="low"].active {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

/* ========================================
   CHECKBOX
   ======================================== */

.modal-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--cream);
    cursor: pointer;
}

.modal-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--gold);
    cursor: pointer;
}

/* ========================================
   MODAL FOOTER
   ======================================== */

.collection-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(212, 165, 116, 0.3);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn-secondary {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
}

.modal-btn-secondary:hover {
    background: rgba(212, 165, 116, 0.1);
}

.modal-btn-primary {
    background: var(--gold);
    color: var(--dark-navy);
}

.modal-btn-primary:hover {
    background: var(--bright-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 196, 48, 0.4);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .collection-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .collection-modal-overlay {
        padding: 0;
    }

    .condition-selector {
        flex-direction: column;
    }

    .condition-btn {
        min-width: 100%;
    }

    .priority-selector {
        grid-template-columns: 1fr;
    }

    .modal-model-info {
        flex-direction: column;
        text-align: center;
    }

    .modal-model-thumb {
        width: 100%;
        height: 150px;
    }
}

@media (max-width: 480px) {
    .collection-modal-header {
        padding: 16px;
    }

    .collection-modal-body {
        padding: 16px;
    }

    .collection-modal-footer {
        padding: 16px;
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
    }

    .collection-modal-title {
        font-size: 1.5em;
    }
}
