/**
 * Historical Photos Homepage - Full-Screen Design
 */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-text: #ffffff;
    --color-text-dark: #1a1a1a;
    --color-text-light: #e0e0e0;
    --color-overlay-bg: rgba(0, 0, 0, 0.85);
    --color-accent: #4d9fff;
    --color-border: rgba(255, 255, 255, 0.2);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --info-panel-width: 400px;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: #000;
    line-height: 1.6;
    overflow: hidden;
}

/* Full-screen container */
.fullscreen-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Full-screen photo */
.fullscreen-photo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
    display: block;
}

/* Info toggle button */
.info-toggle {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.info-toggle:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.info-toggle:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(77, 159, 255, 0.3);
}

.info-icon {
    font-family: Georgia, serif;
    font-style: italic;
}

/* Photo info panel */
.photo-info {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: var(--info-panel-width);
    height: 100vh;
    background: var(--color-overlay-bg);
    backdrop-filter: blur(20px);
    overflow-y: auto;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.5);
}

.photo-info.visible {
    right: 0;
}

.info-content {
    padding: var(--spacing-xl);
    padding-top: calc(var(--spacing-xl) + 60px); /* Account for toggle button */
}

/* Photo title */
.photo-title {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--spacing-lg);
    color: var(--color-text);
}

/* Metadata */
.photo-metadata {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

.metadata-item {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.metadata-item:last-child {
    margin-bottom: 0;
}

.photo-metadata dt {
    font-weight: 600;
    color: var(--color-text-light);
    font-size: 0.875rem;
    min-width: 100px;
    flex-shrink: 0;
}

.photo-metadata dd {
    color: var(--color-text);
    font-size: 0.875rem;
}

/* Description */
.photo-description {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    color: var(--color-text-light);
    line-height: 1.7;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--color-border);
}

/* Actions */
.photo-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

.source-link,
.refresh-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.source-link:hover,
.refresh-link:hover {
    background-color: rgba(77, 159, 255, 0.2);
}

.source-link:focus,
.refresh-link:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Attribution */
.attribution {
    color: var(--color-text-light);
    font-size: 0.75rem;
    line-height: 1.6;
}

.attribution a {
    color: var(--color-accent);
    text-decoration: none;
}

.attribution a:hover {
    text-decoration: underline;
}

/* Setup message */
.setup-message {
    max-width: 600px;
    padding: var(--spacing-xl);
    margin: auto;
    text-align: center;
    color: var(--color-text-dark);
}

.setup-message h1 {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
    color: var(--color-text-dark);
}

.setup-message p {
    margin-bottom: var(--spacing-md);
    color: #666;
}

.setup-message pre {
    background-color: #f5f5f5;
    padding: var(--spacing-md);
    border-radius: 4px;
    text-align: left;
    overflow-x: auto;
    margin-bottom: var(--spacing-md);
}

.setup-message code {
    font-family: "Monaco", "Courier New", monospace;
    font-size: 0.875rem;
}

.setup-message a {
    color: var(--color-accent);
    text-decoration: none;
}

.setup-message a:hover {
    text-decoration: underline;
}

/* Scrollbar styling for info panel */
.photo-info::-webkit-scrollbar {
    width: 8px;
}

.photo-info::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.photo-info::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.photo-info::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Responsive design */
@media (max-width: 768px) {
    :root {
        --info-panel-width: 100%;
    }

    .info-toggle {
        top: var(--spacing-md);
        right: var(--spacing-md);
        width: 44px;
        height: 44px;
    }

    .info-content {
        padding: var(--spacing-lg);
        padding-top: calc(var(--spacing-lg) + 60px);
    }

    .photo-title {
        font-size: 1.25rem;
    }

    .metadata-item {
        flex-direction: column;
        gap: 0.25rem;
    }

    .photo-metadata dt {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .info-toggle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .info-content {
        padding: var(--spacing-md);
        padding-top: calc(var(--spacing-md) + 56px);
    }
}

/* Landscape tablets and small desktops */
@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --info-panel-width: 380px;
    }
}

/* Large desktops */
@media (min-width: 1400px) {
    :root {
        --info-panel-width: 450px;
    }

    .photo-title {
        font-size: 1.75rem;
    }
}

/* Print styles */
@media print {
    .info-toggle {
        display: none;
    }

    .photo-info {
        position: static;
        right: auto;
        width: 100%;
        max-width: 100%;
        height: auto;
        background: white;
        color: black;
    }

    .photo-title {
        color: black;
    }

    .fullscreen-photo {
        height: auto;
        max-height: 80vh;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .info-toggle {
        border-width: 3px;
    }

    .photo-info {
        background: rgba(0, 0, 0, 0.95);
    }
}
