/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --info: #17a2b8;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --text: #333;
    --text-light: #7f8c8d;
    --border: #ddd;
    --shadow: 0 10px 30px rgba(0,0,0,0.1);
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.navbar {
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo a {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    background: var(--gradient);
    color: white;
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: var(--gradient);
    color: white;
    margin-bottom: 3rem;
    border-radius: 0 0 30px 30px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.3rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Calculator Sections */
.calculators-section {
    margin-bottom: 4rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.2rem;
    color: var(--primary);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

/* Landscape Calculator Grid */
.calculators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.calculator-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.calculator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}

.calculator-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.calculator-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.calculator-card h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.calculator-card h3 a:hover {
    color: var(--secondary);
}

.calculator-card p {
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Calculator Container */
.calculator-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 2rem auto;
    max-width: 800px;
}

.calculator-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.calculator-header h1 {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.calculator-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 1rem;
}

.input-group input,
.input-group select {
    padding: 1rem 1.2rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

/* Buttons */
.btn {
    display: inline-block;
    background: var(--gradient);
    color: white;
    padding: 1.2rem 2.5rem;
    border: none;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn::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:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.calculate-btn {
    width: 100%;
    font-size: 1.1rem;
    padding: 1.3rem;
    margin-top: 1rem;
}

.btn-secondary {
    background: var(--text-light);
}

.btn-secondary:hover {
    background: var(--text);
}

/* Results */
.result {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-radius: 15px;
    border-left: 5px solid var(--success);
    margin-top: 2rem;
    display: none;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.result p {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    color: var(--text);
}

/* Special Sections */
.popular-section {
    background: var(--gradient);
    color: white;
    padding: 4rem 0;
    border-radius: 30px;
    margin: 4rem 0;
}

.popular-section .section-title {
    color: white;
}

.popular-section .section-title::after {
    background: rgba(255, 255, 255, 0.5);
}

.popular-card {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.popular-card h3 a {
    color: var(--primary);
}

/* Input Rows and Groups */
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.radio-group {
    display: flex;
    gap: 2rem;
    margin-top: 0.5rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    margin: 0;
}

/* Experience Periods */
.experience-periods {
    margin-bottom: 2rem;
}

.period-group {
    background: var(--light);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--secondary);
}

.period-group h4 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.btn-remove {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.btn-remove:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* Ads Container */
.ads-container {
    margin: 3rem auto;
    text-align: center;
    max-width: 1200px;
    padding: 0 20px;
}

/* Footer */
footer {
    background: var(--primary);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1.5rem;
    color: var(--secondary);
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #bdc3c7;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .calculators-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .calculator-container {
        padding: 2rem;
        margin: 1rem;
    }
    
    .input-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .calculator-card {
        padding: 2rem;
    }
    
    .calculator-container {
        padding: 1.5rem;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
}

/* Animation for calculator cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calculator-card {
    animation: fadeInUp 0.6s ease;
}

.calculator-card:nth-child(odd) {
    animation-delay: 0.1s;
}

.calculator-card:nth-child(even) {
    animation-delay: 0.2s;
}

/* Loading state for buttons */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}