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

:root {
    --bg-color: #0d0f1a;
    --sidebar-bg: rgba(22, 24, 38, 0.95);
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8f9fa;
    --text-muted: #b5b7c8;
    --accent: #00cec9;
    --accent-hover: #00e6e0;
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0a0b12 0%, #15162a 50%, #171124 100%);
    background-attachment: fixed;
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    letter-spacing: 0.5px;
    font-weight: 700;
}

/* Sidebar Hamburger */
#sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    height: 100vh;
    position: fixed;
    left: -260px;
    top: 0;
    transition: var(--transition);
    z-index: 1000;
    border-right: 1px solid var(--card-border);
    padding-top: 60px;
}

#sidebar.active {
    left: 0;
}

#sidebar .nav-link {
    color: var(--text-main);
    padding: 15px 25px;
    display: block;
    text-decoration: none;
    font-size: 16px;
    transition: var(--transition);
    font-weight: 500;
}

#sidebar .nav-link:hover {
    background-color: rgba(0, 206, 201, 0.15);
    color: var(--accent);
    box-shadow: inset 4px 0 0 var(--accent);
}

.hamburger-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-size: 24px;
    border-radius: 8px;
    cursor: pointer;
    padding: 8px 12px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.hamburger-btn:hover {
    background: var(--accent);
    color: #1a1a24;
}

/* Content Area */
#main-content {
    flex: 1;
    transition: var(--transition);
    padding: 40px;
    padding-top: 80px;
    min-height: 100vh;
    width: 100%;
}

#main-content.shifted {
    margin-left: 260px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px 40px;
    background: radial-gradient(circle at 50% 0%, rgba(108, 92, 231, 0.15) 0%, transparent 70%);
    border-radius: 20px;
    border: 1px solid var(--card-border);
    margin-bottom: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50px; left: -50px;
    width: 150px; height: 150px;
    background: rgba(0, 206, 201, 0.2);
    filter: blur(50px);
    border-radius: 50%;
}

.search-form { display: flex; justify-content: center; gap: 10px; margin-bottom: 25px; position: relative; z-index: 2; }
.search-input { padding: 15px 25px; width: 450px; border-radius: 50px; border: 2px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.2); color: #fff; font-size: 16px; outline: none; box-shadow: inset 0 2px 5px rgba(0,0,0,0.5); transition: 0.3s; }
.search-input:focus { border-color: var(--accent); background: rgba(255,255,255,0.05); }
.search-btn { background: linear-gradient(135deg, #00cec9, #6C5CE7); color: #fff; border: none; padding: 0 35px; border-radius: 50px; cursor: pointer; font-size: 16px; font-weight: 600; box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4); transition: 0.3s; }
.search-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(108, 92, 231, 0.6); }
.clear-btn { background: #ff4757; color: #fff; border: none; padding: 15px 25px; border-radius: 50px; cursor: pointer; font-size: 16px; font-weight: 600; text-decoration: none; display: flex; align-items: center; transition: 0.3s; }
.clear-btn:hover { background: #ff6b81; }

.category-pills { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; position: relative; z-index: 2; }
.category-pills .pill { padding: 10px 20px; border-radius: 30px; background: rgba(255,255,255,0.05); color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 600; transition: 0.3s; border: 1px solid transparent; }
.category-pills .pill:hover { background: rgba(255,255,255,0.1); color: #fff; }
.category-pills .pill.active { background: rgba(108, 92, 231, 0.2); color: #fff; border-color: #6C5CE7; box-shadow: 0 0 15px rgba(108, 92, 231, 0.3); }

/* Grid layout for animations */
.anim-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 35px;
}

.anim-card {
    background: rgba(26, 26, 36, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 25px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.anim-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: rgba(0, 206, 201, 0.5);
}

.anim-card.top-card { border: 1px solid #ffd32a; background: linear-gradient(135deg, rgba(26, 26, 36, 0.8), rgba(255, 211, 42, 0.05)); }
.crown-badge { position: absolute; top: 0; right: 0; background: linear-gradient(135deg, #ffd32a, #f39c12); color: #1a1a24; font-size: 11px; font-weight: 800; padding: 5px 15px; border-bottom-left-radius: 15px; text-transform: uppercase; letter-spacing: 1px; box-shadow: -2px 2px 10px rgba(255, 211, 42, 0.5); }

.anim-card h3 {
    margin-top: 5px;
    font-size: 22px;
    margin-bottom: 15px;
    color: #fff;
}

.anim-card p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.5;
    flex: 1;
}

.anim-card .stats {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-size: 13px;
    color: #00cec9;
    font-weight: 600;
}

.anim-card .badge {
    background: rgba(108, 92, 231, 0.2);
    color: #a29bfe;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    align-self: flex-start;
    margin-bottom: 12px;
    border: 1px solid rgba(108, 92, 231, 0.3);
}

.view-btn {
    margin-top: 20px;
    width: 100%;
    text-align: center;
    background: rgba(255,255,255,0.05);
    padding: 12px 0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    transition: 0.3s;
    border: 1px solid rgba(255,255,255,0.05);
}

.anim-card:hover .view-btn {
    background: var(--accent);
    color: #1a1a24;
    border-color: var(--accent);
}

/* Details View */

/* Authentication & Profile */
.auth-container { display: flex; align-items: center; justify-content: center; min-height: 80vh; font-family: 'Inter', sans-serif; }
.auth-box { width: 420px; padding: 40px; background: rgba(26, 26, 36, 0.7); backdrop-filter: blur(15px); border-radius: 20px; border: 1px solid var(--card-border); box-shadow: 0 15px 35px rgba(0,0,0,0.5); text-align: center; }
.auth-box h2 { color: #fff; margin-bottom: 30px; font-weight: 800; font-size: 26px; }
.auth-input-group { position: relative; margin-bottom: 25px; text-align: left; }
.auth-input { width: 100%; padding: 15px; border-radius: 8px; border: 2px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.2); color: #fff; font-size: 16px; outline: none; transition: 0.3s; box-sizing: border-box; }
.auth-input:focus { border-color: var(--accent); background: rgba(255,255,255,0.05); }
.auth-label { position: absolute; left: 15px; top: 15px; color: var(--text-muted); pointer-events: none; transition: 0.3s; background: transparent; padding: 0 5px; font-size: 16px; }
.auth-input:focus ~ .auth-label, .auth-input:valid ~ .auth-label { top: -10px; font-size: 13px; color: var(--accent); background: #181926; border-radius: 4px; }
.auth-btn { width: 100%; padding: 15px; border-radius: 8px; border: none; background: linear-gradient(135deg, #6C5CE7, #00cec9); color: white; font-size: 16px; font-weight: 700; cursor: pointer; transition: 0.3s; box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4); }
.auth-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(108, 92, 231, 0.6); }
.auth-divider { margin: 25px 0; color: var(--text-muted); position: relative; font-size: 14px; font-weight: 600; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { content: ''; position: absolute; top: 50%; width: 35%; height: 1px; background: rgba(255,255,255,0.1); }
.auth-divider::before { left: 0; } .auth-divider::after { right: 0; }
.google-btn { width: 100%; padding: 15px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2); background: rgba(0,0,0,0.3); color: white; font-size: 16px; font-weight: 600; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 10px; }
.google-btn:hover { background: #fff; color: #1a1a24; }
.auth-link { margin-top: 25px; color: var(--text-muted); font-size: 14px; }
.auth-link a { color: var(--accent); text-decoration: none; font-weight: 700; transition: 0.3s; }
.auth-link a:hover { color: #fff; }
.alert-error { background: rgba(255,71,87,0.1); border: 1px solid rgba(255,71,87,0.5); color: #ff4757; padding: 15px; border-radius: 8px; margin-bottom: 25px; font-size: 14px; text-align: left; }
.alert-error ul { margin: 0; padding-left: 20px; }
.detail-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.preview-pane {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    position: relative;
    overflow: hidden;
    padding: 20px;
    width: 100%;
}

.code-pane {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.code-block {
    background: #282a36;
    border-radius: 10px;
    padding: 15px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.code-block h4 {
    margin: 0 0 10px 0;
    color: #50fa7b;
    font-size: 14px;
    text-transform: uppercase;
}

.code-block pre {
    margin: 0;
    overflow-x: auto;
    color: #f8f8f2;
    font-size: 13px;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.copy-btn:hover {
    background: var(--accent-hover);
}

.usage-guide {
    background: rgba(0, 206, 201, 0.1);
    border-left: 4px solid #00cec9;
    padding: 20px;
    border-radius: 0 10px 10px 0;
    margin-top: 20px;
}

/* Administrative Dashboard Styles */
.library-grid {
    animation: fadeIn 0.8s ease-out;
}

.library-card {
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.library-card:hover {
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.4) !important;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

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

/* Custom Scrollbar for dark theme */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}