:root {
    --bg-color: #0d0f12;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #f0f2f5;
    --text-muted: #a0a4ab;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

/* Subtle background glowing orb */
body::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(13, 15, 18, 0) 70%);
    z-index: -1;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto 3rem auto;
}

h1 {
    font-weight: 800;
    font-size: 2.5rem;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff, #a0a4ab);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

button {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

#save-key-btn {
    background-color: var(--accent);
    color: white;
    border: none;
    width: 100%;
    padding: 0.75rem;
    margin-top: 1rem;
}

#save-key-btn:hover {
    background-color: var(--accent-hover);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.album-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    position: relative;
    backdrop-filter: blur(20px);
}

.album-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.image-container {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.02);
}

.album-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    filter: brightness(0.9);
}

.album-card:hover .album-image {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.album-info {
    padding: 1.5rem;
}

.album-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.album-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Auth Overlay Styles */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 15, 18, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 2.5rem;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.auth-card h2 {
    margin-bottom: 0.5rem;
}

.auth-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.auth-card input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    color: white;
    outline: none;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.auth-card input:focus {
    border-color: var(--accent);
}

.hidden {
    display: none !important;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--card-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading {
    text-align: center;
    grid-column: 1 / -1;
    padding: 4rem 0;
    color: var(--text-muted);
}

.error {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    grid-column: 1 / -1;
}
