/* Modern Premium Aesthetic */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(15, 23, 42, 0.6);
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: var(--text-muted);
}

.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn:active {
    transform: translateY(0);
}

/* Drag and Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.drop-zone-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 15px;
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.image-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    border: 1px solid var(--border-color);
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-card .badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--card-bg);
    border-left: 4px solid var(--primary);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(0);
}

/* Admin panel layout */
body.admin-body {
    display: block;
    padding: 0;
    margin: 0;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: rgba(15, 23, 42, 0.95);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.admin-brand {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.admin-brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary);
}

.admin-nav-section {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 20px 0 8px 14px;
}

.admin-sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 16px;
}

.admin-sidebar-footer a,
.admin-sidebar-footer form button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    font-family: inherit;
}

.admin-sidebar-footer a:hover,
.admin-sidebar-footer form button:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.08);
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 32px 48px 32px 56px;
    max-width: calc(100% - 260px);
    box-sizing: border-box;
}

.admin-topbar {
    margin-bottom: 28px;
}

.admin-topbar h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 6px;
}

.admin-topbar p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.stat-card .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-card .value.ok { color: #4ade80; }
.stat-card .value.warn { color: #fbbf24; }
.stat-card .value.bad { color: #f87171; }

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-success {
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ade80;
}

.alert-error {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #f87171;
}

.legacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 20px;
    margin-top: 8px;
}

.log-viewer {
    background: rgba(0,0,0,0.4);
    border-radius: 8px;
    padding: 16px;
    font-family: monospace;
    font-size: 0.8rem;
    max-height: 500px;
    overflow-y: auto;
    line-height: 1.6;
    color: #a5b4fc;
}

.log-viewer .line {
    border-bottom: 1px solid rgba(255,255,255,0.04);
    padding: 4px 0;
}

@media (max-width: 768px) {
    .admin-sidebar {
        position: relative;
        width: 100%;
    }
    .admin-main {
        margin-left: 0;
        padding: 20px 24px;
        max-width: 100%;
    }
    .admin-shell {
        flex-direction: column;
    }
}
