:root {
    --bg-dark: #09090b;
    --glass-bg: rgba(24, 24, 27, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #fafafa;
    --text-muted: #a1a1aa;
    
    --accent-glow: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-hover: #2563eb;
    
    --success: #10b981;
    --error: #ef4444;
    --info: #3b82f6;
}

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

body {
    font-family: 'Outfit', -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Abstract Background Glows */
.bg-blur {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, rgba(0,0,0,0) 70%);
    top: -200px;
    left: -200px;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

.bg-blur-2 {
    background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, rgba(0,0,0,0) 70%);
    bottom: -200px;
    right: -200px;
    top: auto;
    left: auto;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
    margin-bottom: 1rem;
    animation: slideDown 0.6s ease-out;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
}

header h1 span {
    background: linear-gradient(135deg, var(--accent-glow), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Inputs & Forms */
.input-group {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.input-group:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.1rem;
    font-family: inherit;
    outline: none;
    padding: 0.5rem;
}

input::placeholder {
    color: #52525b;
}

/* Buttons */
button {
    background: linear-gradient(135deg, var(--accent-glow), var(--accent-hover));
    border: none;
    color: white;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.8rem 2rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    min-width: 140px;
}

button:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

button:active {
    transform: scale(0.97);
}

button:disabled {
    background: #27272a;
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

button.btn-success {
    background: linear-gradient(135deg, #059669, #10b981);
}

button.btn-success:hover {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

/* Terminal */
.terminal {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
    height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: rgba(0, 0, 0, 0.4);
}

.terminal::-webkit-scrollbar {
    width: 8px;
}
.terminal::-webkit-scrollbar-track {
    background: transparent;
}
.terminal::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.terminal .log { color: var(--text-muted); }
.terminal .info { color: var(--info); }
.terminal .success { color: var(--success); text-shadow: 0 0 10px rgba(16, 185, 129, 0.3); }
.terminal .error { color: var(--error); text-shadow: 0 0 10px rgba(239, 68, 68, 0.3); }

/* Gallery Controls */
.gallery-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stats h3 {
    font-weight: 600;
    font-size: 1.2rem;
}

.badge {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-weight: 800;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Gallery Grid */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.media-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.15);
}

.media-card img,
.media-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.media-card:hover img,
.media-card:hover video {
    transform: scale(1.05);
}

.type-badge {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 2;
}

.media-card .actions {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 1rem 1rem 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 2;
}

.media-card:hover .actions {
    opacity: 1;
    transform: translateY(0);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    min-width: unset;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
}

.btn-small:hover {
    background: rgba(255,255,255,0.2);
    box-shadow: none;
}

/* State Classes */
.hidden { display: none !important; }

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    header h1 { font-size: 2.5rem; }
    .input-group { flex-direction: column; }
    button { width: 100%; }
    .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
