/* assets/css/style.css - Main stylesheet */

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background: var(--bg-light);
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Navigation Back Button */
.nav-back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-back-btn:hover {
    color: var(--primary-color);
}

.nav-back-btn svg {
    flex-shrink: 0;
}

/* Hero Banner */
.hero-banner {
    position: relative;
    width: 100vw;
    height: 66vh;
    overflow: hidden;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-bottom: 2rem;
}

.hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
    padding: 2rem;
}

.hero-overlay h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

/* Controls */
.collection-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-white);
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.controls-left, .controls-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.set-dropdown {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--bg-white);
    cursor: pointer;
    min-width: 200px;
}

.set-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Photo Grid - Masonry Layout */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.photo-item {
    position: relative;
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image sizing based on orientation */
.photo-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Landscape photos - wider */
.photo-item.landscape {
    grid-column: span 2;
}

.photo-item.landscape img {
    max-height: 400px;
}

/* Portrait photos - taller */
.photo-item.portrait img {
    max-height: 600px;
}

/* Square photos */
.photo-item.square img {
    max-height: 400px;
}

.photo-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.photo-overlay {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

/* Buttons */
.btn-icon {
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: white;
    transform: scale(1.1);
}

.favourite-btn.active {
    color: #ef4444;
}

.download-btn {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.download-btn:hover {
    background: rgba(16, 185, 129, 1);
}

.cart-btn.in-cart {
    background: var(--primary-color);
    color: white;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
}

.lightbox-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
}

.lightbox-nav button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.lightbox-nav button:hover {
    background: rgba(255,255,255,0.3);
}

/* PIN Dialog */
.pin-dialog-content {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.pin-dialog-content h2 {
    margin-bottom: 1rem;
}

.pin-dialog-content .form-group {
    margin: 1.5rem 0;
}

.pin-dialog-content input[type="text"] {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.pin-dialog-content input[type="text"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.download-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.error-message {
    background: #fee;
    color: #c00;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}


/* Cart */
.cart-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s;
}

.cart-link:hover {
    background: #1d4ed8;
}

/* Back Button */
.btn-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s;
    font-weight: 500;
}

.btn-back:hover {
    background: #475569;
}

.btn-back svg {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .btn-back .back-text {
        display: none;
    }
    
    .btn-back {
        padding: 0.75rem;
        width: 44px;
        height: 44px;
        justify-content: center;
    }
}


/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Tables */
.data-table {
    width: 100%;
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-light);
    font-weight: 600;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-published {
    background: #d1fae5;
    color: #065f46;
}

.badge-draft {
    background: #fef3c7;
    color: #92400e;
}

.badge-private {
    background: #e0e7ff;
    color: #3730a3;
}

/* Responsive */
@media (max-width: 1200px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .photo-item.landscape {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .nav-back-btn span {
        display: none;
    }
    
    .nav-back-btn {
        font-size: 1rem;
    }
    
    .back-bar {
        padding: 0.75rem 1rem;
    }
    
    .btn-back .back-text {
        display: none;
    }
    
    .btn-back {
        padding: 0.5rem;
        min-width: 36px;
        min-height: 36px;
        justify-content: center;
    }
    
    .hero-banner {
        height: 40vh;
    }
    
    .hero-overlay h1 {
        font-size: 1.75rem;
    }
    
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .photo-item.landscape,
    .photo-item.portrait {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .collection-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .controls-left, .controls-right {
        width: 100%;
        justify-content: space-between;
    }
}