/* Enhanced PhotoViewer Modal Styles */

.zoom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.zoom-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    display: flex;
    flex-direction: column;
    width: 95%;
    height: 95%;
    margin: auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgb(116, 30, 33) 0%, rgb(176.7808219178, 45.7191780822, 50.2910958904) 100%);
    color: white;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: white;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    line-height: 1;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sequence-indicator {
    color: white;
    font-size: 14px;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Modal Body */
.modal-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.viewer-container {
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
    position: relative;
}

/* Modal Footer */
.modal-footer {
    flex-shrink: 0;
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    max-height: 200px;
    overflow-y: auto;
}

.image-info {
    padding: 15px 20px;
}

.info-section h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.info-content {
    display: grid;
    gap: 8px;
}

.info-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    align-items: start;
}

.info-label {
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.info-value {
    color: #333;
    font-size: 14px;
    word-break: break-word;
}

.info-value a {
    color: #667eea;
    text-decoration: none;
}

.info-value a:hover {
    text-decoration: underline;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 60px;
    left: 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.menu-item:hover {
    background-color: #f8f9fa;
}

.menu-item:last-child {
    border-bottom: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .modal-header {
        padding: 10px 15px;
    }
    
    .header-left {
        gap: 10px;
    }
    
    .modal-title {
        font-size: 16px;
    }
    
    .header-controls {
        gap: 8px;
    }
    
    .nav-btn {
        font-size: 20px;
        padding: 4px 6px;
    }
    
    .sequence-indicator {
        font-size: 12px;
        min-width: 50px;
    }
    
    .info-row {
        grid-template-columns: 100px 1fr;
        gap: 8px;
    }
    
    .info-label,
    .info-value {
        font-size: 13px;
    }
    
    .dropdown-menu {
        left: 15px;
        right: 15px;
        width: auto;
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 8px 12px;
    }
    
    .modal-title {
        font-size: 14px;
    }
    
    .sequence-indicator {
        font-size: 11px;
        min-width: 45px;
    }
    
    .image-info {
        padding: 12px 15px;
    }
    
    .info-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .info-label {
        font-weight: 600;
    }
}

/* OpenSeadragon specific adjustments */
.viewer-container .openseadragon-container {
    font-family: inherit;
}

/* Ensure OpenSeadragon controls are properly styled */
.viewer-container .openseadragon-controls {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Loading state */
.viewer-container .loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-size: 16px;
}

.viewer-container .loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

.copy-citation-btn {
    background: none;
    border: 1px solid #ddd;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.copy-citation-btn:hover {
    background-color: #f5f5f5;
    border-color: #999;
    color: #333;
}

.copy-citation-btn:active {
    background-color: #e5e5e5;
    transform: scale(0.95);
}

/* Success state */
.copy-citation-btn.copied {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

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