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

:root {
    --bg-dark: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.4);
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-bg: rgba(15, 23, 42, 0.8);
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --glow-1: #8b5cf6;
    --glow-2: #3b82f6;
    --glow-3: #ec4899;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 5rem;
    line-height: 1.6;
}

/* Background animated blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(140px);
}

.blob {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    mix-blend-mode: screen;
    animation: float 20s infinite alternate;
}

.blob-1 { background: var(--glow-1); top: -100px; left: -100px; opacity: 0.15; }
.blob-2 { background: var(--glow-2); bottom: 10%; right: -50px; opacity: 0.15; animation-duration: 25s; }
.blob-3 { background: var(--glow-3); top: 40%; left: 30%; opacity: 0.1; width: 600px; height: 600px; animation-duration: 30s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.1); }
}

/* Layout Containers */
.container, .app-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.container.small { max-width: 600px; }

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

/* Glass UI Elements */
.glass, .glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.8s ease-out;
}

/* Form Elements */
input[type="number"], input[type="text"], input[type="email"], select, .glass-input, .math-input {
    width: 100%;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1.1rem;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
}

input:focus, select:focus, .glass-input:focus, .math-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(15, 23, 42, 0.9);
}

/* Help Icons & Universal Tooltips */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 11px;
    margin-left: 8px;
    cursor: help;
    transition: all 0.2s ease;
    vertical-align: middle;
    color: var(--text-secondary);
    position: relative;
    font-style: normal;
}

.help-icon:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.1);
}

.help-icon:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    width: 260px;
    white-space: normal;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    line-height: 1.4;
    text-align: center;
    font-weight: 400;
    text-shadow: none;
    text-transform: none;
}

.help-icon:hover::before {
    content: '';
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    z-index: 9999;
}

.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 100px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.nav-btn {
    padding: 0.8rem 1.8rem;
    border-radius: 100px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 10px 20px var(--accent-glow);
}

/* Footer Styling */
.app-footer {
    text-align: center;
    padding: 3rem 1rem;
    margin-top: 4rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(10px);
}

.footer-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.footer-link:hover {
    color: var(--accent);
}

.footer-link i {
    font-size: 1.1rem;
}

.hidden { display: none !important; }

/* Modal System */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    width: 90%;
    max-width: 450px;
    padding: 2.5rem;
    position: relative;
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--accent);
}

.modal-btns {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
}

.btn-text:hover {
    color: white;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 600px) {
    .nav-tabs {
        flex-direction: column;
        border-radius: 20px;
        width: 100%;
        gap: 0.5rem;
    }
    .nav-btn {
        text-align: center;
        padding: 0.6rem;
    }
    header h1 { font-size: 2rem; }
    .glass, .glass-panel { padding: 1.5rem; }
}
