:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #ec4899;
    --background-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --success-color: #10b981;
    --error-color: #ef4444;
    --font-family: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Header */
header {
    background-color: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    z-index: 101;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

.mobile-menu-toggle:hover {
    color: var(--primary-color);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0.5rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
}

/* Main Content */
main {
    flex: 1;
    padding: 4rem 0;
}

.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Fact Card */
.fact-container {
    max-width: 800px;
    margin: 0 auto;
    perspective: 1000px;
}

.fact-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.fact-card::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 20px;
    font-size: 10rem;
    color: rgba(255, 255, 255, 0.03);
    font-family: serif;
}

.fact-content {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 1rem 2rem;
    border-radius: 2rem;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s;
}

.refresh-btn:active {
    transform: scale(0.95);
}

.refresh-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.5s ease;
}

.refresh-btn:hover svg {
    transform: rotate(180deg);
}

/* Forms */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-color);
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Footer */
footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-muted);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.copyright {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Admin Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.sidebar {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    height: fit-content;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: var(--primary-color);
    color: white;
}

.admin-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
}

.action-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

.btn-danger {
    background-color: var(--error-color);
}

.btn-danger:hover {
    background-color: #dc2626;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.refresh-btn:active {
    transform: scale(0.95);
}

.refresh-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.5s ease;
}

.refresh-btn:hover svg {
    transform: rotate(180deg);
}

/* Forms */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-color);
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Footer */
footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-muted);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.copyright {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Admin Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.sidebar {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    height: fit-content;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: var(--primary-color);
    color: white;
}

.admin-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
}

.action-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

.btn-danger {
    background-color: var(--error-color);
}

.btn-danger:hover {
    background-color: #dc2626;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 250px;
        background: linear-gradient(135deg, var(--card-bg) 0%, rgba(30, 41, 59, 0.98) 100%);
        flex-direction: column;
        padding: 4rem 1.5rem 2rem;
        gap: 0.5rem;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
        align-items: flex-start;
        overflow-y: auto;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
        margin: 0;
    }

    .nav-links a {
        display: block;
        padding: 0.75rem 1rem;
        width: 100%;
        border-radius: 0.5rem;
        transition: all 0.2s ease;
        font-size: 0.95rem;
    }

    .nav-links a:hover {
        background-color: rgba(99, 102, 241, 0.1);
        padding-left: 1.5rem;
    }

    .nav-links .btn {
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }

    /* Overlay when menu is open */
    .nav-links.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 250px;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: sticky;
        top: 70px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .fact-card {
        padding: 2rem 1.5rem;
    }

    .fact-content {
        font-size: 1.2rem;
        min-height: 80px;
    }

    .refresh-btn {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
    }

    .container {
        padding: 0 1rem;
    }

    main {
        padding: 2rem 0;
    }

    .hero {
        margin-bottom: 2rem;
    }

    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .auth-container {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .nav-links {
        width: 220px;
    }

    .nav-links.active::before {
        right: 220px;
    }

    .logo {
        font-size: 1.25rem;
    }

    .fact-content {
        font-size: 1.1rem;
    }

    .refresh-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    .container {
        padding: 0 0.75rem;
    }
}

@media (max-width: 360px) {
    .nav-links {
        width: 200px;
    }

    .nav-links.active::before {
        right: 200px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .fact-card {
        padding: 1.5rem 1rem;
    }
}