/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

a {
    text-decoration: none;
    color: #0066cc;
    transition: color 0.3s ease;
}

a:hover {
    color: #0052a3;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 1.5rem 0 1rem 0;
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
}

/* Header and Navigation */
.header {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    padding: 1rem 0;
}

.navbar > .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.logo {
    color: #0066cc;
    font-weight: bold;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.navbar-menu a {
    color: #333;
    font-weight: 500;
}

.navbar-menu a.btn-secondary {
    background-color: #f0f0f0;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-align: center;
    font-size: 0.95rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    border-color: #d1d5db;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    padding: 6rem 0;
    text-align: center;
}

.hero-content h1 {
    color: white;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .btn {
    padding: 1rem 2rem;
}

/* Features Section */
.features {
    padding: 4rem 0;
}

.features h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.feature-card h3 {
    color: #0066cc;
    margin-top: 0;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Home Info Cards */
.home-info {
    padding: 4rem 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
    border-radius: 16px;
    margin-top: 3rem;
}

.info-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.info-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.info-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.info-card h2 {
    color: #1f2937;
    margin-top: 0;
}

/* Hello World Section */
.hello-world-section {
    padding: 2rem 0;
}

.hello-world-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hello-content {
    margin-top: 2rem;
}

.hello-content h2 {
    color: #0066cc;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.feature-list, .db-list, .getting-started {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.feature-list li, .db-list li, .getting-started li {
    margin-bottom: 0.5rem;
}

.code-block {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

/* Forms */
.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.625rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: white;
    color: #1f2937;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Error and Success Messages */
.error-message {
    background-color: #fee;
    color: #c33;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.success-message {
    background-color: #efe;
    color: #3c3;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.login-box h1 {
    text-align: center;
    color: #0066cc;
    margin-top: 0;
}

.login-form {
    margin-top: 2rem;
}

.back-link {
    text-align: center;
    margin-top: 1.5rem;
}

/* Admin Panel */
.admin-header {
    background: linear-gradient(135deg, #1a1f36 0%, #2d3142 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 6px;
    transition: all 0.3s ease;
}

.menu-toggle:hover span {
    background: #6366f1;
}

.menu-toggle span {
    width: 24px;
    height: 2.5px;
    background: white;
    display: block;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.admin-title {
    color: white;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-spacer {
    flex: 1;
}

.admin-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 60px);
}

.admin-sidebar {
    background: linear-gradient(180deg, #f8fafb 0%, #f3f4f6 100%);
    color: #1f2937;
    padding: 0;
    overflow-y: auto;
    transition: transform 0.3s ease;
    border-right: 1px solid #e5e7eb;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 {
    color: #1f2937;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.close-menu {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    padding: 0;
    transition: color 0.3s ease;
}

.close-menu:hover {
    color: #1f2937;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
}

.nav-item {
    padding: 0.875rem 1.25rem;
    color: #4b5563;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin: 0.25rem 0;
    border-radius: 0 8px 8px 0;
    text-decoration: none;
    font-weight: 500;
}

.nav-item .icon {
    font-size: 1.1rem;
}

.nav-item:hover {
    background-color: rgba(99, 102, 241, 0.08);
    color: #6366f1;
    border-left-color: #6366f1;
}

.nav-item.active {
    background-color: rgba(99, 102, 241, 0.15);
    color: #6366f1;
    border-left-color: #6366f1;
    font-weight: 600;
}

.admin-sidebar hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 0.5rem 1.25rem;
}

.admin-content {
    padding: 2.5rem;
    background: #fafbfc;
    overflow-y: auto;
}

.admin-content h1,
.admin-content h2 {
    color: #1f2937;
    margin-top: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.75rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.stat-card h3 {
    color: #6b7280;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin: 0 0 1rem 0;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

/* Tables */
.activity-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
}

.activity-table thead {
    background-color: #f9fafb;
    border-bottom: 1px solid #f0f0f0;
}

.activity-table th {
    padding: 1.25rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.activity-table td {
    padding: 1.25rem;
    border-top: 1px solid #f9fafb;
    color: #4b5563;
}

.activity-table tbody tr:hover {
    background-color: #f9fafb;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-page_view {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-user_action {
    background-color: #fce7f3;
    color: #be185d;
}

.badge-info {
    background-color: #dcfce7;
    color: #166534;
}

/* Error Page */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
}

.error-container {
    text-align: center;
    color: white;
}

.error-container h1 {
    font-size: 4rem;
    margin: 0 0 1rem 0;
}

.error-container p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

.footer p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }

    .navbar > .container {
        flex-direction: column;
        gap: 1rem;
    }

    .navbar-menu {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .navbar-menu a {
        display: block;
        padding: 0.5rem;
    }

    .hero {
        padding: 3rem 0;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .cta-buttons .btn {
        width: 100%;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .admin-container {
        grid-template-columns: 1fr;
    }

    .menu-toggle {
        display: flex !important;
    }

    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 60px;
        width: 260px;
        height: calc(100vh - 60px);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 99;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .close-menu {
        display: flex !important;
    }

    .sidebar-nav {
        flex-direction: column;
    }

    .nav-item {
        flex: none;
        padding: 0.875rem 1.25rem;
        text-align: left;
        border-left: 3px solid transparent;
        border-bottom: none;
        border-radius: 0 8px 8px 0;
        margin: 0.25rem 0;
    }

    .nav-item.active {
        border-left-color: #6366f1;
        border-bottom: none;
    }

    .admin-content {
        padding: 1.5rem;
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .activity-table {
        font-size: 0.9rem;
    }

    .activity-table th,
    .activity-table td {
        padding: 0.75rem;
    }

    .error-container h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }
    h3 { font-size: 1rem; }

    .login-box {
        padding: 1.5rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .hello-world-card {
        padding: 1rem;
    }

    .stats-grid {
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

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