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

/* CSS Variables for consistent theming */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #10b981;
    --secondary-hover: #059669;
    --accent-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --background-primary: #ffffff;
    --background-secondary: #f9fafb;
    --background-accent: #f3f4f6;
    --border-color: #e5e7eb;
    --border-focus: #3b82f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Main content wrapper */
.main-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--background-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Header styling */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.page-header h1,
.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.page-header p,
.header p {
    font-size: 1.125rem;
    opacity: 0.9;
    font-weight: 300;
    position: relative;
    z-index: 1;
    margin: 0;
}

/* Content area */
.content-area {
    padding: 3rem 2rem;
    background: var(--background-secondary);
}

.content {
    padding: 40px;
}

/* Form container */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--background-primary);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.form-container h2,
.form-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

.form-container h2::after,
.form-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Form groups */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Input and select styling */
select,
input[type="number"],
input[type="date"],
.form-group select,
.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--background-primary);
    color: var(--text-primary);
    transition: all 0.2s ease-in-out;
    font-family: inherit;
}

select:focus,
input[type="number"]:focus,
input[type="date"]:focus,
.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

select:hover,
input[type="number"]:hover,
input[type="date"]:hover,
.form-group select:hover,
.form-group input:hover {
    border-color: var(--text-light);
}

input[type="number"]::placeholder {
    color: var(--text-light);
    font-style: italic;
}

/* Government info styling */
.government-info {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
    border-left: 4px solid #2196f3;
    display: none;
}

.government-info.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.basic-pay-info {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Button styling */
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

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;
}

button:hover::before {
    left: 100%;
}

#add-fields-btn {
    background: var(--primary-color);
    color: white;
    margin-right: 1rem;
    margin-bottom: 1rem;
}

#add-fields-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.submit-btn,
.submit-button {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-hover) 100%);
    color: white;
    width: 100%;
    font-size: 1.125rem;
    padding: 1rem 1.5rem;
    margin-top: 1rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.submit-btn:hover,
.submit-button:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(46, 204, 113, 0.3);
}

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

.calculator-button {
    display: inline-block;
    padding: 12px 25px;
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    margin: 10px 5px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.calculator-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(142, 68, 173, 0.3);
    text-decoration: none;
    color: white;
}

.calculator-button.secondary {
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
}

.calculator-button.secondary:hover {
    box-shadow: 0 8px 20px rgba(142, 68, 173, 0.3);
}

/* Features section */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
    color: white;
}

.feature-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.feature-card p {
    color: #7f8c8d;
    line-height: 1.6;
}

/* Result page specific styles */
.result-container {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.pension-highlight {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(243, 156, 18, 0.3);
}

.pension-highlight h2 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    font-weight: 600;
}

.pension-highlight p {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.9;
}

.calculation-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 5px solid #3498db;
}

.calculation-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

.calc-row:last-child {
    border-bottom: none;
    font-weight: bold;
    background: #e8f5e8;
    margin: 10px -10px -10px -10px;
    padding: 15px 20px;
    border-radius: 8px;
}

.calc-label {
    font-weight: 600;
    color: #2c3e50;
}

.calc-value {
    font-weight: 600;
    color: #27ae60;
}

.increases-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.increases-table th,
.increases-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.increases-table th {
    background: #3498db;
    color: white;
    font-weight: 600;
}

.increases-table tr:hover {
    background: #f8f9fa;
}

.action-buttons {
    text-align: center;
    margin-top: 30px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-top: 30px;
    text-align: center;
}

.chart-container h3 {
    color: #2c3e50;
}

/* Navbar container */
.navbar {
    background-color: #333;
    font-family: Arial, Helvetica, sans-serif;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* Links inside the navbar */
.navbar a {
    float: left;
    font-size: 16px;
    color: white;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

/* The dropdown container */
.dropdown {
    float: left;
    position: relative;
}

/* Dropdown button */
.dropdown .dropbtn {
    font-size: 16px;
    border: none;
    outline: none;
    color: white;
    padding: 14px 16px;
    background-color: inherit;
    font-family: inherit;
    margin: 0;
    cursor: pointer;
    width: 100%; /* Ensure button takes full width in mobile */
    text-align: left; /* Align text for mobile view */
}

/* Add a background color to navbar links on hover */
.navbar a:hover, .dropdown:hover .dropbtn {
    background-color: #555;
}

/* Dropdown content (hidden by default ) */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
}

/* Links inside the dropdown */
.dropdown-content a {
    float: none;
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

/* Add a background color to dropdown links on hover */
.dropdown-content a:hover {
    background-color: #ddd;
}

/* Show the dropdown menu on hover for desktop */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Hamburger icon for mobile */
.navbar .icon {
    display: none;
    float: right;
}

/* --- Mobile Responsiveness --- */
@media screen and (max-width: 768px) {
    /* Hide everything except the first link and the icon */
    .navbar a:not(:first-child), .dropdown {
        display: none;
    }
    .navbar a.icon {
        display: block;
    }

    /* When .responsive is added, stack items vertically */
    .navbar.responsive {
        flex-direction: column;
        align-items: flex-start;
    }
    .navbar.responsive .icon {
        position: absolute;
        right: 0;
        top: 0;
    }
    
    /* Display nav links and dropdown containers */
    .navbar.responsive a,
    .navbar.responsive .dropdown {
        display: block;
        width: 100%;
        text-align: left;
    }

    /* On mobile, don't show dropdown on hover */
    .navbar.responsive .dropdown:hover .dropdown-content {
        display: none;
    }
    
    /* When a dropdown is active in responsive mode, show its content */
    .navbar.responsive .dropdown.active .dropdown-content {
        display: block;
        position: static; /* Remove absolute positioning */
        width: 100%;
        box-shadow: none;
        background-color: #444; /* Slightly different background for clarity */
    }
    
    .navbar.responsive .dropdown-content a {
        padding-left: 32px; /* Indent sub-menu items */
    }
}


