/* =============================================
   Modal Component Styles
   ============================================= */

/* ----- Modal Overlay ----- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

/* ----- Modal Container ----- */
.modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 95vw;
    max-height: 95vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ----- Modal Header ----- */
.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: var(--light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--secondary);
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

/* ----- Modal Body ----- */
.modal-body {
    flex: 1;
    overflow: hidden;
    background: #f1f5f9;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    cursor: grab;
}

.modal-body:active {
    cursor: grabbing;
}

/* ----- Modal Image Container ----- */
.modal-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    min-width: 100%;
    min-height: 100%;
}

.modal-body img {
    display: block;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 8px;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
}

.modal-body img:active {
    cursor: grabbing;
}

/* ----- Modal Zoom Controls ----- */
.modal-zoom-controls {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: white;
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 10;
}

.modal-zoom-btn {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--secondary);
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-zoom-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.modal-zoom-btn:active {
    transform: scale(0.95);
}

.modal-zoom-btn svg {
    width: 20px;
    height: 20px;
}

.modal-zoom-level {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
    background: var(--light);
    border-radius: 8px;
    padding: 0 12px;
}

/* ----- Modal Hint ----- */
.modal-hint {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 0.85rem;
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none;
    white-space: nowrap;
}

.modal-hint.hidden {
    opacity: 0;
}

/* ----- Responsive Modal ----- */
@media (max-width: 768px) {
    .modal {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-zoom-controls {
        bottom: 16px;
        padding: 6px 10px;
    }

    .modal-zoom-btn {
        width: 40px;
        height: 40px;
    }

    .modal-zoom-level {
        min-width: 60px;
        font-size: 0.85rem;
    }
}

/* ----- Print Styles ----- */
@media print {
    .modal-overlay,
    .modal,
    .modal-header,
    .modal-body,
    .modal-zoom-controls,
    .modal-hint {
        display: none !important;
        visibility: hidden !important;
        position: absolute !important;
        left: -9999px !important;
    }
}
