* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
}

header {
    background: #2c3e50;
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

nav a {
    color: #ecf0f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: #3498db;
}

.btn-nav {
    background: #3498db;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.btn-nav:hover {
    background: #2980b9 !important;
    color: white !important;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Flash messages */
.flash {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.flash.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Button */
.btn {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.btn:hover {
    background: #2980b9;
}

/* Album grid (home page) */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.album-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.album-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.album-cover {
    position: relative;
    height: 220px;
    background: #e0e0e0;
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.album-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: #e8e8e8;
}

.album-badge {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.album-info {
    padding: 1rem 1.25rem;
}

.album-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.album-info p {
    color: #666;
    font-size: 0.9rem;
}

/* Album detail header */
.album-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.album-header h2 {
    font-size: 1.6rem;
}

.album-desc {
    color: #666;
    margin-top: 0.25rem;
}

/* Photo gallery (inside album) */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.photo-card {
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.photo-card:hover {
    transform: translateY(-4px);
}

.photo-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    cursor: pointer;
    display: block;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 85vw;
    max-height: 90vh;
    border-radius: 4px;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 3rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.4);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
    font-size: 1.2rem;
}

.empty-state .btn {
    margin-top: 1rem;
}

/* Forms */
.upload-form {
    max-width: 550px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-form h2 {
    margin-bottom: 1.5rem;
}

/* Album type toggle */
.type-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #3498db;
}

.type-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: white;
    color: #3498db;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.type-btn.active {
    background: #3498db;
    color: white;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #3498db;
    outline: none;
}

.form-group small {
    display: block;
    color: #999;
    margin-top: 0.25rem;
}

/* Link preview */
.link-preview {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.link-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    object-fit: cover;
}

.link-preview p {
    color: #666;
    font-size: 0.9rem;
}

button[type="submit"] {
    width: 100%;
    padding: 0.75rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button[type="submit"]:hover {
    background: #2980b9;
}

@media (max-width: 600px) {
    header {
        flex-direction: column;
        text-align: center;
    }

    .album-grid {
        grid-template-columns: 1fr;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .photo-card img {
        height: 150px;
    }

    .album-header {
        flex-direction: column;
    }
}
