/* Modern Calculator UI - Shared Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #667eea;
}

/* Header */
.calculator-header {
    text-align: center;
    color: white;
    padding: 3rem 0;
}

.calculator-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.calculator-header p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Calculator Card */
.calculator-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
    position: relative;
    overflow: hidden;
}

.calculator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

/* Layout */
.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

/* Input Section */
.input-section h2 {
    color: #333;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.input-wrapper {
    position: relative;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #f8fafc;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.1);
}

.input-prefix {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-weight: 600;
}

.input-with-prefix input {
    padding-left: 2.8rem;
}

.input-suffix {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-weight: 600;
}

.input-with-suffix input {
    padding-right: 2.8rem;
}

/* Results Section */
.results-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e1e8f0 100%);
    border-radius: 16px;
    padding: 2rem;
    position: sticky;
    top: 120px;
}

.results-section h2 {
    color: #333;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.5rem;
}

.result-main {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.result-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 3rem;
    font-weight: bold;
    color: #667eea;
    font-family: 'SF Mono', monospace;
}

.result-value.positive {
    color: #10b981;
}

.result-value.negative {
    color: #ef4444;
}

.result-grade {
    font-size: 1rem;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
}

.grade-excellent { background: #10b981; color: white; }
.grade-good { background: #3b82f6; color: white; }
.grade-fair { background: #f59e0b; color: white; }
.grade-poor { background: #ef4444; color: white; }

/* Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

/* Responsive */
@media (max-width: 1024px) {
    .calc-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .results-section {
        position: static;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .calculator-card {
        padding: 1rem;
        margin: 1rem auto;
        border-radius: 16px;
    }
    
    .calculator-header {
        padding: 2rem 0;
    }
    
    .calculator-header h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .calculator-header p {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .calc-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .input-section h2 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group input, .form-group select {
        padding: 0.8rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .input-with-prefix input {
        padding-left: 3rem;
    }
    
    .input-with-suffix input {
        padding-right: 3rem;
    }
    
    .input-prefix, .input-suffix {
        font-size: 0.9rem;
    }
    
    .results-section {
        padding: 1.5rem;
        position: static;
    }
    
    .results-section h2 {
        font-size: 1.2rem;
        margin-bottom: 1.5rem;
    }
    
    .result-main {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .result-value {
        font-size: 2rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .navbar {
        padding: 0.8rem 0;
    }
    
    .nav-content {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    .calculator-card {
        padding: 0.8rem;
        margin: 0.5rem auto;
        border-radius: 12px;
    }
    
    .calculator-header h1 {
        font-size: 1.8rem;
    }
    
    .result-value {
        font-size: 1.8rem;
    }
    
    .input-section h2 {
        font-size: 1.1rem;
    }
    
    .results-section h2 {
        font-size: 1.1rem;
    }
    
    .form-group input, .form-group select {
        padding: 0.7rem;
        border-radius: 8px;
    }
    
    .input-with-prefix input {
        padding-left: 3.2rem;
    }
    
    .input-with-suffix input {
        padding-right: 3.2rem;
    }
    
    .input-prefix, .input-suffix {
        font-size: 0.85rem;
        font-weight: 700;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .btn {
        width: 100%;
        padding: 0.9rem 1rem;
    }
}

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

.calculator-card {
    animation: slideIn 0.6s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}