* {
    box-sizing: border-box;
}

:root {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --primary-color: #6366f1;
    --secondary-color: #ec4899;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-hover: rgba(255, 255, 255, 0.1);
    --font-main: 'Inter', sans-serif;
}

html,
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 20%);
    min-height: 100vh;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.025em;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

.history-link {
    color: #60a5fa !important;
    text-decoration: underline !important;
    font-weight: 500;
}

.history-link:hover {
    color: var(--secondary-color) !important;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Navbar */
.navbar {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 2rem;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    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;
}

.navbar .brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
}

.logo {
    height: 40px;
    width: auto;
    border-radius: 4px;
    -webkit-text-fill-color: initial;
    /* Fix for background-clip: text inheritance */
}

.beta-tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
    background: var(--glass-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
    -webkit-text-fill-color: initial;
    vertical-align: middle;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1001;
}

.mobile-nav-toggle svg {
    width: 24px;
    height: 24px;
}

.logout-btn {
    color: var(--secondary-color);
}

.signup-btn {
    background: var(--primary-color);
    color: white !important;
}

.signup-btn:hover {
    background: var(--secondary-color);
}

.nav-link:hover,
.nav-link.active {
    background: var(--glass-bg);
    color: white;
}

/* Cards */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 2rem;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

/* Tables */
.table-container {
    width: 100%;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
}

table {
    min-width: 600px;
    /* Ensures table doesn't collapse too much */
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

th {
    background: rgba(0, 0, 0, 0.2);
    font-weight: 600;
    color: var(--primary-color);
}

tr:hover {
    background: var(--glass-bg);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #94a3b8;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    color: white;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Handle Autofill Styles */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #1e293b inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}


/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Utility */
.mb-4 {
    margin-bottom: 1rem;
}

.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid-2,
.grid-3 {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}


/* Landing Page */
.hero {
    padding: 6rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(2.5rem, 10vw, 4rem);
    margin-bottom: 1.5rem;
    line-height: 1.1;
    display: block;
    width: 100%;
}

.hero p {
    font-size: 1.25rem;
    color: #94a3b8;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-group {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    padding: 3rem;
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Password Visibility Toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    z-index: 10;
    height: 100%;
}

.password-toggle:hover {
    color: var(--primary-color);
}


@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }

    .mobile-nav-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        transform: translateX(100%);
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        transition: transform 0.3s ease;
        border-left: 1px solid var(--glass-border);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-link {
        width: 100%;
        text-align: left;
        padding: 1rem;
        font-size: 1.125rem;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .hero h1 {
        font-size: clamp(2rem, 8vw, 2.8rem);
        line-height: 1.2;
        padding: 0 1rem;
    }

    .hero p {
        font-size: 1.1rem;
        padding: 0 0.5rem;
    }

    .mobile-stack {
        flex-direction: column !important;
        gap: 1rem;
    }

    .mobile-stack>* {
        width: 100% !important;
        flex: none !important;
    }
}

/* Video Section */
.video-section {
    margin-top: 5rem;
    text-align: center;
}

.video-section h2 {
    font-size: 2.5rem;
    margin-bottom: 2.5rem;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.video-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    padding: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 1.25rem;
}

.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 1.25rem;
}

@media (max-width: 768px) {
    .video-section h2 {
        font-size: 2rem;
    }

    .video-container {
        padding: 0.5rem;
        border-radius: 1.25rem;
    }
}