@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=IBM+Plex+Mono:wght@400;500&family=Manrope:wght@400;600;700&display=swap');

:root {
    --primary: #C8102E;
    --primary-light: #E63946;
    --accent: #FF6B35;
    --accent-glow: #FFB997;
    --bg: #FFF9F5;
    --surface: #FFFFFF;
    --text: #1A1A1A;
    --text-muted: #6B7280;
    --border: #F0E6E0;
    --shadow: rgba(200, 16, 46, 0.08);
    --shadow-lg: rgba(200, 16, 46, 0.15);
    --success: #2D6A4F;
    --warning: #F77F00;
}

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

body {
    font-family: 'Manrope', -apple-system, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Animated Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 107, 53, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(200, 16, 46, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

/* Return Button */
.return-button-wrapper {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.6s ease-out;
}

.return-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(200, 16, 46, 0.2);
    position: relative;
    overflow: hidden;
}

.return-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.return-button:hover::before {
    left: 100%;
}

.return-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(200, 16, 46, 0.35);
}

.return-button:active {
    transform: translateY(0);
}

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

h1 {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    font-weight: 400;
    max-width: 700px;
    margin: 0 auto;
}

/* Calculator Card */
.calculator-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 
        0 4px 24px var(--shadow),
        0 0 0 1px var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out backwards;
    animation-delay: 0.1s;
    margin-bottom: 3rem;
}

.calculator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s ease;
}

.calculator-card:hover::before {
    transform: scaleX(1);
}

.calculator-card:hover {
    box-shadow: 
        0 8px 48px var(--shadow-lg),
        0 0 0 1px var(--primary);
    transform: translateY(-4px);
}

.calc-header {
    margin-bottom: 2rem;
    text-align: center;
}

.calc-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    box-shadow: 0 4px 16px rgba(200, 16, 46, 0.2);
}

.calc-title {
    font-family: 'DM Serif Display', serif;
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.calc-description {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}

input, select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Manrope', sans-serif;
    transition: all 0.3s ease;
    background: var(--bg);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.05);
}

input[type="number"] {
    font-family: 'IBM Plex Mono', monospace;
}

select {
    cursor: pointer;
}

.input-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.helper-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Manrope', sans-serif;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(200, 16, 46, 0.25);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(200, 16, 46, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--border);
    margin-top: 0.75rem;
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--primary);
    color: var(--primary);
}

/* Results */
.result-box {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 12px;
    color: white;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    box-shadow: 0 8px 32px rgba(200, 16, 46, 0.3);
}

.result-box.show {
    opacity: 1;
    transform: translateY(0);
}

.result-box.excellent {
    background: linear-gradient(135deg, var(--success) 0%, #40916C 100%);
}

.result-box.warning {
    background: linear-gradient(135deg, var(--warning) 0%, #FCBF49 100%);
}

.result-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.result-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 3rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-details {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.8;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 1rem;
}

.result-breakdown {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.25rem;
    border-radius: 8px;
    margin-top: 1rem;
    backdrop-filter: blur(10px);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.breakdown-item:last-child {
    margin-bottom: 0;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* Info Section */
.info-section {
    background: var(--surface);
    padding: 3rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 24px var(--shadow);
    margin-top: 3rem;
    animation: fadeInUp 1s ease-out backwards;
    animation-delay: 0.3s;
}

.info-section h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.info-card {
    padding: 1.5rem;
    background: var(--bg);
    border-radius: 12px;
    border-left: 4px solid var(--accent);
}

.info-card h3 {
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.info-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* FAQ Section */
.faq-section {
    margin-top: 3rem;
}

.faq-section h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.faq-item {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-light);
}

.faq-item h4 {
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.faq-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Best Practices */
.best-practices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.practice-item {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--accent);
}

.practice-item h4 {
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.practice-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4rem;
}

/* AdSense Placeholder */
.ad-space {
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
    border: 2px dashed #d0d0d0;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    color: #999;
    margin: 3rem 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.875rem;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }
    
    .calculator-card {
        padding: 1.75rem;
    }
    
    h1 {
        font-size: 2.25rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .result-value {
        font-size: 2.25rem;
    }
    
    .info-section {
        padding: 2rem 1.5rem;
    }
    
    .input-group {
        grid-template-columns: 1fr;
    }
    
    .best-practices {
        grid-template-columns: 1fr;
    }
}