:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --secondary: #06b6d4;
    --accent: #f43f5e;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

h1, h2, h3, .logo-text {
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 600px) {
    .container {
        padding: 0 1rem;
    }
}

/* Header & Nav */
header {
    padding: 1.5rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

@media (max-width: 768px) {
    header {
        backdrop-filter: none;
        background: var(--bg-dark);
    }
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo span span {
    color: var(--secondary);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--text-main);
}

@media (max-width: 480px) {
    .nav-links {
        display: none; /* Hide nav links on very small phones to avoid overlap */
    }
    
   

    .logo {
        font-size: 1.25rem;
        text-align: right;
        
    }
}

/* Hero Section */
.hero {
    padding: 10rem 0 5rem;
    text-align: center;
    position: relative;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    margin-bottom: 1.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
     background-clip: text;              /* estándar */
    -webkit-background-clip: text;      /*compatibilidad*/

    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}


@media (max-width: 600px) {
    .hero h1 {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 1.1rem;
        padding: 0 0.5rem;
    }
}

.hero p {
    color: var(--text-dim);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
}

.hero-shapes .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
}

.circle-1 {
    width: 300px;
    height: 300px;
    background: var(--primary-glow);
    top: -50px;
    left: -50px;
}

.circle-2 {
    width: 250px;
    height: 250px;
    background: rgba(6, 182, 212, 0.3);
    bottom: 50px;
    right: -50px;
}

@media (max-width: 768px) {
    .hero-shapes .shape {
        filter: blur(40px); /* Reduced blur for performance */
        opacity: 0.5;
    }
    
    .hero {
        padding: 8rem 0 3rem;
    }
}

/* Calculator Section */
.calculator-section {
    padding: 2rem 0 6rem;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .glass-card {
        padding: 1.5rem;
        backdrop-filter: none;
        background: rgba(30, 41, 59, 0.95);
        border-radius: 20px;
    }
}

.calculator-card {
    max-width: 700px;
    margin: 0 auto;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.mode-selector {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.4rem;
    border-radius: 12px;
    display: flex;
    gap: 0.5rem;
}

.mode-selector button {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.mode-selector button.active {
    background: var(--primary);
    color: white;
}

/* Grade Rows */
.grade-row {
    display: grid;
    grid-template-columns: 1fr 120px 80px 48px;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: center;
    animation: fadeIn 0.4s ease-out forwards;
    position: relative;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    transition: background 0.3s;
}

.grade-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.grade-rows.mode-weighted .grade-row {
    grid-template-columns: 1fr 120px 80px 48px;
}

.grade-rows.mode-simple .grade-row {
    grid-template-columns: 1fr 120px 48px;
}

input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    color: white;
    outline: none;
    transition: all 0.3s;
    font-size: 0.95rem;
}

input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-remove {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent);
    border: 1px solid rgba(244, 63, 94, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
    justify-self: end;
}

.btn-remove:hover {
    background: var(--accent);
    color: white;
    transform: rotate(90deg);
}

.card-actions {
    margin-top: 1.5rem;
}

.btn-secondary {
    background: transparent;
    border: 1px dashed var(--text-dim);
    color: var(--text-dim);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

/* Result Area */
.result-container {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}



.result-box {
    margin-bottom: 1rem;
}

.result-label {
    display: block;
    color: var(--text-dim);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 4rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--secondary);
    text-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

.status-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
}

.status-badge.pass { background: rgba(34, 197, 94, 0.1); color: #4ade80; }
.status-badge.fail { background: rgba(244, 63, 94, 0.1); color: #fb7185; }

@media (max-width: 768px) {
    .result-value {
        font-size: 3rem;
        text-shadow: none;
    }
}

/* Info Section */
.info-section {
    padding: 6rem 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

@media (max-width: 600px) {
    .grid {
        gap: 1rem;
    }
    
    .info-card {
        padding: 1.5rem;
    }
    
    .info-section {
        padding: 4rem 0;
    }
}

.info-card {
    background: rgba(255, 255, 255, 0.02);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.info-card h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.info-card p {
    color: var(--text-dim);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-up {
    animation: fadeIn 0.8s ease-out;
}

.delay-1 { animation-delay: 0.2s; }

@media (max-width: 768px) {
    * {
        animation-duration: 0.3s !important; /* Faster animations */
    }
    
    .hero-shapes .shape {
        animation: none !important;
    }
}

/* Responsive */
@media (max-width: 600px) {
    .grade-rows.mode-weighted .grade-row {
        grid-template-columns: 1fr 75px 60px 32px;
        gap: 0.4rem;
        padding: 0.4rem;
    }
    
    .grade-rows.mode-simple .grade-row {
        grid-template-columns: 1fr 75px 32px;
        gap: 0.4rem;
        padding: 0.4rem;
    }

    input {
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
        min-width: 0; /* Critical to allow shrinking within grid */
    }

    .btn-remove {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .mode-selector {
        width: 100%;
        justify-content: center;
    }
    
    .mode-selector button {
        flex: 1;
        padding: 0.6rem 0.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 380px) {

    .logo {
        font-size: 1.2rem;   
    }

    .container {
        padding: 0 0.75rem;
    }
    
    .glass-card {
        padding: 1.25rem 0.75rem;
    }
    
    .grade-rows.mode-weighted .grade-row {
        grid-template-columns: 1fr 65px 50px 28px;
        gap: 0.25rem;
    }
    
    .grade-rows.mode-simple .grade-row {
        grid-template-columns: 1fr 65px 28px;
        gap: 0.25rem;
    }
    
    input {
        padding: 0.5rem 0.3rem;
        font-size: 0.8rem;
    }
    
    .btn-remove {
        width: 28px;
        height: 28px;
    }
}

/* Footer */
footer {
    padding: 3rem 0;
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

footer p {
    color: var(--text-dim);
    font-size: 0.95rem;
}
