/* ===================================
   RESET & BASE STYLES
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a1a1a;
    --primary-hover: #000000;
    --secondary-color: #707070;
    --success-color: #10b981;
    --error-color: #ef4444;
    --text-primary: #1a1a1a;
    --text-secondary: #707070;
    --border-color: #f0f0f0;
    --background: #fafafa;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 2px 4px 0 rgb(0 0 0 / 0.05);
    --shadow-lg: 0 4px 8px 0 rgb(0 0 0 / 0.08);
    --radius: 0px;
    --radius-lg: 0px;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    font-weight: 300;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   SCREEN MANAGEMENT
   =================================== */

.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: flex;
}

/* ===================================
   PASSWORD SCREEN
   =================================== */

#password-screen {
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: var(--white);
}

.password-container {
    background: var(--white);
    padding: 60px 48px;
    border-radius: var(--radius-lg);
    box-shadow: none;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.password-container h2 {
    font-size: 20px;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 0.01em;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.input-group input {
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    font-weight: 300;
    transition: all 0.2s;
    outline: none;
    background: var(--white);
    letter-spacing: 0.01em;
}

.input-group input:focus {
    border-color: var(--text-primary);
    box-shadow: none;
}

.input-group button {
    padding: 16px 28px;
    background: var(--text-primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 400;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.input-group button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.input-group button:active {
    transform: translateY(0);
}

.error-message {
    color: var(--error-color);
    font-size: 13px;
    font-weight: 300;
    min-height: 20px;
    margin-bottom: 8px;
}

/* ===================================
   LOADING SCREEN
   =================================== */

#loading-screen {
    justify-content: center;
    align-items: center;
    background: var(--background);
}

.loading-container {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 24px;
    border: 1px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-container p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 0.02em;
}

/* ===================================
   GALLERY SELECTION SCREEN
   =================================== */

#gallery-selection-screen {
    flex-direction: column;
    background: var(--background);
}

.gallery-selection-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.selection-header {
    background: var(--background);
    padding: 0;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    padding: 0 60px;
}

.selection-header h1 {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.selection-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px 60px 40px;
    width: 100%;
}

.selection-content h2 {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 32px;
}

.gallery-selection-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.gallery-list-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.gallery-list-item:first-child {
    border-top: 1px solid var(--border-color);
}

.gallery-list-item:hover {
    background: transparent;
}

.gallery-list-item:hover .gallery-list-title {
    color: var(--secondary-color);
}

.gallery-list-title {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.gallery-list-count {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.02em;
}

/* ===================================
   GALLERY SCREEN
   =================================== */

#gallery-screen {
    flex-direction: column;
    background: var(--background);
}

/* Header - Minimal style like filmbyrossi.com */
.gallery-header {
    background: var(--background);
    border-bottom: none;
    padding: 0;
    height: 140px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: none;
    display: flex;
    align-items: center;
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-left h1 {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0;
}

.btn-back {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin-right: 20px;
    transition: color 0.2s;
    font-weight: 300;
    line-height: 1;
    display: flex;
    align-items: center;
}

.btn-back:hover {
    color: var(--secondary-color);
}

.header-actions {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.header-actions.left {
    flex: 1;
    justify-content: flex-start;
}

.header-actions.right {
    justify-content: flex-end;
}

.header-actions .instagram-link {
    color: var(--text-primary);
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.header-actions .instagram-link:hover {
    color: var(--secondary-color);
}

.header-actions .instagram-link svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* Buttons - Plain style with subtle hover */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 400;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: transparent;
    color: var(--text-primary);
}

.btn:hover {
    background: transparent;
    color: var(--secondary-color);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn:disabled:hover {
    background: transparent;
    color: var(--text-primary);
}

.btn-primary {
    background: transparent;
    color: var(--text-primary);
}

.btn-primary:hover {
    background: transparent;
    color: var(--secondary-color);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: transparent;
    color: var(--secondary-color);
}

.btn-small {
    padding: 8px 18px;
    font-size: 11px;
}

/* Gallery Info - More subtle with title */
.gallery-info {
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px 60px 20px;
}

.gallery-info h2 {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 12px;
}

.gallery-info p {
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.02em;
}

.photo-count {
    font-weight: 400;
    color: var(--text-primary);
}

/* Download Controls - Separate section */
.download-controls-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 60px 32px;
}

.download-controls {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

/* Photo Grid - filmbyrossi.com inspired layout */
.photo-grid {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 60px 40px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    align-items: start;
}

.photo-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--background);
    box-shadow: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    opacity: 1;
}

.photo-item img {
    width: 100%;
    max-height: calc((1600px - 240px - 80px) / 5 * 0.67);
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.02);
}

/* Logout Section */
.logout-section {
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px 60px 60px;
    text-align: center;
}

/* Selection Mode */
.photo-item.selectable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.photo-item.selectable:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.photo-item.selected {
    outline: 3px solid var(--success-color);
    outline-offset: -3px;
}

.photo-item.selected:hover {
    outline: 3px solid var(--success-color);
    outline-offset: -3px;
    transform: none;
    box-shadow: none;
}

.photo-item.selected:hover img {
    transform: none;
}

/* ===================================
   LIGHTBOX
   =================================== */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(250, 250, 250, 0.98);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 92%;
    max-height: 92%;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 88vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--white);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: var(--text-primary);
    color: var(--white);
    border-color: var(--text-primary);
    transform: none;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: var(--white);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background: var(--text-primary);
    color: var(--white);
    border-color: var(--text-primary);
}

.lightbox-prev {
    left: 24px;
}

.lightbox-next {
    right: 24px;
}

.lightbox-info {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}

#lightbox-counter {
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.05em;
}

/* ===================================
   FOOTER
   =================================== */

.gallery-footer {
    background: var(--background);
    border-top: none;
    padding: 48px 24px;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-social {
    margin-bottom: 0;
}

.instagram-link {
    color: var(--text-primary);
    transition: color 0.2s;
    display: inline-block;
    text-decoration: none;
}

.instagram-link:hover {
    color: var(--secondary-color);
}

.instagram-link svg {
    display: block;
    width: 20px;
    height: 20px;
}

.footer-text {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 0.02em;
}

.footer-text p {
    margin: 0;
    color: var(--text-primary);
}

.footer-text a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-text a:hover {
    color: var(--secondary-color);
}

.footer-text a:visited {
    color: var(--text-primary);
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 1200px) {
    .photo-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }
    
    .photo-item img {
        max-height: 280px;
    }
}

@media (max-width: 768px) {
    .password-container {
        padding: 40px 32px;
    }
    
    .selection-header {
        height: auto;
        padding: 20px 24px;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .selection-header h1 {
        text-align: center;
    }
    
    .selection-header .header-actions {
        justify-content: center;
    }
    
    .selection-content {
        padding: 24px 24px 32px;
    }
    
    .gallery-list-item {
        padding: 16px 0;
    }
    
    .gallery-header {
        height: auto;
        padding: 20px 0;
    }
    
    .header-content {
        padding: 0 24px;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .header-left {
        text-align: center;
        justify-content: center;
    }
    
    .header-actions {
        flex-direction: row;
        gap: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .header-actions.left,
    .header-actions.right {
        width: 100%;
    }
    
    .btn {
        flex: 1;
        min-width: auto;
    }
    
    .download-controls-wrapper {
        padding: 0 24px 24px;
    }
    
    .download-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .download-controls .btn {
        width: 100%;
    }
    
    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 0 24px 32px;
    }
    
    .photo-item img {
        max-height: 200px;
    }
    
    .logout-section {
        padding: 32px 24px 48px;
    }
    
    .gallery-info {
        padding: 24px 24px 16px;
    }
    
    .lightbox-nav,
    .lightbox-close {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    
    .lightbox-prev {
        left: 16px;
    }
    
    .lightbox-next {
        right: 16px;
    }
    
    .lightbox-close {
        top: 16px;
        right: 16px;
    }
}

@media (max-width: 480px) {
    .selection-header {
        padding: 20px 16px;
    }
    
    .selection-header h1 {
        font-size: 12px;
    }
    
    .selection-content {
        padding: 20px 16px 24px;
    }
    
    .selection-content h2 {
        font-size: 12px;
    }
    
    .gallery-list-item {
        padding: 14px 0;
    }
    
    .gallery-list-title {
        font-size: 12px;
    }
    
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 16px 24px;
    }
    
    .photo-item img {
        max-height: 180px;
    }
    
    .logout-section {
        padding: 24px 16px 40px;
    }
    
    .header-content {
        padding: 0 16px;
    }
    
    .gallery-info {
        padding: 20px 16px 12px;
    }
    
    .download-controls-wrapper {
        padding: 0 16px 20px;
    }
    
    .gallery-info h2 {
        font-size: 12px;
    }
}

/* ===================================
   ANIMATIONS
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.photo-item {
    animation: fadeIn 0.4s ease-out;
    animation-fill-mode: both;
}

/* Stagger animation for grid items - more subtle */
.photo-item:nth-child(1) { animation-delay: 0.03s; }
.photo-item:nth-child(2) { animation-delay: 0.06s; }
.photo-item:nth-child(3) { animation-delay: 0.09s; }
.photo-item:nth-child(4) { animation-delay: 0.12s; }
.photo-item:nth-child(5) { animation-delay: 0.15s; }
.photo-item:nth-child(6) { animation-delay: 0.18s; }
.photo-item:nth-child(7) { animation-delay: 0.21s; }
.photo-item:nth-child(8) { animation-delay: 0.24s; }
.photo-item:nth-child(9) { animation-delay: 0.27s; }

/* Print styles */
@media print {
    .gallery-header,
    .gallery-footer,
    .lightbox {
        display: none !important;
    }
}