/* SIP Calculator Professional CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #06b6d4;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-gray: #f3f4f6;
    --lighter-gray: #f9fafb;
    --border-color: #e5e7eb;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    padding-top: 60px;
}

/* Mobile body adjustments */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
        font-size: 14px;
        line-height: 1.4;
    }
    
    * {
        box-sizing: border-box;
    }
    
    /* Prevent horizontal scroll */
    html, body {
        overflow-x: hidden;
        width: 100%;
    }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    height: 60px;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-brand a,
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.brand-text {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu,
.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    color: var(--gray);
}

.hamburger-icon {
    font-size: 18px;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    list-style: none;
    margin: 0;
    padding: 8px 0;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--gray);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border-radius: 0;
}

.dropdown-menu a:hover {
    background: var(--light-gray);
    color: var(--primary-color);
}

.nav-link {
    color: var(--gray);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-link:hover {
    color: var(--primary-color);
    background: var(--light-gray);
}

/* SIP Container */
.sip-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px 30px;
}

.sip-header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 10px;
    color: var(--dark);
}

.sip-header h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--dark);
}

.sip-header p {
    font-size: 18px;
    color: var(--gray);
}

@media (max-width: 768px) {
    .sip-container {
        padding: 5px 8px 20px;
        max-width: 100%;
        width: 100%;
    }
    
    .sip-header {
        margin-bottom: 15px;
        padding: 5px 8px;
        text-align: center;
    }
    
    .sip-header h1 {
        font-size: 22px;
        line-height: 1.2;
        margin-bottom: 8px;
        word-wrap: break-word;
    }
    
    .sip-header p {
        font-size: 13px;
        line-height: 1.4;
        margin-bottom: 0;
        padding: 0 10px;
    }
}

/* Calculator Grid */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .calculator-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
        width: 100%;
    }
    
    .left-column,
    .right-column {
        width: 100%;
        min-width: 0;
    }
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .card {
        border-radius: 10px;
        margin-bottom: 10px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
        width: 100%;
    }
    
    .card-content {
        padding: 12px;
    }
    
    .card-header {
        padding: 10px 12px;
    }
    
    .card-header h2 {
        font-size: 15px;
        font-weight: 600;
    }
    
    .card-header .icon {
        font-size: 18px;
    }
}

.card-header {
    padding: 20px;
    background: linear-gradient(135deg, #f6f8fb 0%, #fff 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header .icon {
    font-size: 24px;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

.card-content {
    padding: 25px;
}

/* Investment Type Selector */
.investment-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 768px) {
    .investment-type-selector {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.type-btn {
    padding: 20px;
    background: var(--lighter-gray);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.type-btn:hover {
    border-color: var(--primary-color);
    background: var(--light-gray);
    transform: translateY(-2px);
}

.type-btn.active {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-color: var(--primary-color);
    color: var(--dark);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.type-icon {
    font-size: 32px;
}

.type-text {
    font-weight: 600;
    font-size: 16px;
}

.type-desc {
    font-size: 12px;
    opacity: 0.8;
}

/* Form Elements */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 10px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 15px;
    font-size: 18px;
    color: var(--gray);
    font-weight: 500;
}

.input-suffix {
    position: absolute;
    right: 15px;
    font-size: 16px;
    color: var(--gray);
    font-weight: 500;
}

.form-group input[type="number"] {
    width: 100%;
    padding: 12px 45px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
}

.form-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Input with Slider */
.input-with-slider {
    margin-top: 10px;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--light-gray);
    border-radius: 5px;
    outline: none;
    margin: 15px 0;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray);
    margin-top: -10px;
}

/* Step-up Section */
.step-up-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.step-up-input {
    margin-top: 15px;
    animation: slideDown 0.3s ease;
}

/* Goals Grid */
.goals-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.goal-btn {
    padding: 15px;
    background: var(--lighter-gray);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.goal-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--dark);
    transform: translateY(-2px);
}

.goal-icon {
    font-size: 24px;
}

.goal-btn span:last-child {
    font-size: 12px;
    font-weight: 500;
}

/* Results Card */
.results-card .card-content {
    padding: 0;
}

.maturity-amount-display {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    padding: 30px;
    text-align: center;
    color: var(--dark);
}

.maturity-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.maturity-value {
    font-size: 42px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.returns-percentage {
    font-size: 20px;
    font-weight: 600;
    color: #10b981;
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    margin-top: 10px;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 25px;
}

.result-item {
    padding: 15px;
    background: var(--lighter-gray);
    border-radius: 10px;
    text-align: center;
}

.result-label {
    display: block;
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 8px;
}

.result-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.result-value.blue {
    color: var(--info-color);
}

.result-value.green {
    color: var(--success-color);
}

/* Chart Container */
.chart-container {
    padding: 25px;
    height: 300px;
}

/* Breakdown Section */
.breakdown-section {
    padding: 25px;
    background: var(--lighter-gray);
}

.breakdown-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark);
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.breakdown-item {
    text-align: center;
}

.breakdown-label {
    display: block;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 5px;
}

.breakdown-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

/* Chart Tabs */
.chart-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.chart-tab {
    padding: 10px 20px;
    background: var(--lighter-gray);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.chart-tab.active {
    background: var(--primary-color);
    color: var(--dark);
}

.line-chart-container {
    height: 300px;
}

/* Funds List */
.funds-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fund-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--lighter-gray);
    border-radius: 8px;
    transition: all 0.3s;
}

.fund-item:hover {
    background: var(--light-gray);
    transform: translateX(5px);
}

.fund-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
}

.fund-return {
    font-size: 13px;
    font-weight: 600;
    color: var(--success-color);
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.btn-icon {
    font-size: 18px;
}

.btn-secondary {
    background: var(--light-gray);
    color: var(--dark);
}

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

.btn-primary {
    background: var(--primary-color);
    color: var(--dark);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.btn-success {
    background: var(--success-color);
    color: var(--dark);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

/* Full Width Card */
.full-width-card {
    grid-column: span 2;
}

/* Projection Table */
.projection-table {
    overflow-x: auto;
}

.projection-table table {
    width: 100%;
    border-collapse: collapse;
}

.projection-table th {
    background: var(--light-gray);
    padding: 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid var(--border-color);
}

.projection-table td {
    padding: 12px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.projection-table tr:hover {
    background: var(--lighter-gray);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .full-width-card {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 10px;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 15px;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
        border-radius: 8px;
    }
    
    .type-btn {
        width: 100%;
        padding: 15px;
        min-height: 60px;
        font-size: 14px;
    }
    
    .type-icon {
        font-size: 24px;
    }
    
    .type-text {
        font-size: 14px;
    }
    
    .type-desc {
        font-size: 11px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .input-wrapper {
        margin-bottom: 10px;
    }
    
    .input-wrapper input {
        font-size: 16px;
        padding: 12px;
        min-height: 44px;
        border-radius: 8px;
    }
    
    .input-prefix, .input-suffix {
        padding: 12px;
        font-size: 14px;
    }
    
    .range-input {
        margin: 10px 0;
        min-height: 44px;
    }
    
    .range-labels {
        font-size: 12px;
        margin-top: 5px;
    }
    
    .projection-table {
        font-size: 12px;
        overflow-x: auto;
        border-radius: 8px;
    }
    
    .projection-table th,
    .projection-table td {
        padding: 6px 8px;
        font-size: 11px;
        white-space: nowrap;
    }
    
    .chart-container {
        height: 250px !important;
        margin: 15px 0;
    }
    
    /* Mobile form optimizations */
    select {
        font-size: 16px;
        padding: 12px;
        min-height: 44px;
        border-radius: 8px;
    }
    
    button {
        min-height: 44px;
        font-size: 14px;
        border-radius: 8px;
    }
    
    input[type="range"] {
        min-height: 44px;
        width: 100%;
    }
    
    /* Mobile specific utility classes */
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-text-center {
        text-align: center !important;
    }
    
    /* Reduce spacing on mobile */
    .quick-goals-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .goal-btn {
        padding: 10px;
        font-size: 12px;
        min-height: 60px;
    }
    
    .goal-icon {
        font-size: 20px;
    }
    
    .goal-text {
        font-size: 12px;
    }
}

/* Mobile Navigation Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
        z-index: 1002;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        background: var(--white);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 0;
        transition: max-height 0.3s ease, padding 0.3s ease;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--border-color);
    }
    
    .nav-links.active {
        max-height: 500px;
        padding: 15px 0;
    }
    
    .nav-links li {
        width: 100%;
        margin: 0;
    }
    
    .nav-link {
        padding: 12px 20px;
        width: 100%;
        display: block;
        border-radius: 0;
        font-size: 16px;
        border-bottom: 1px solid var(--light-gray);
    }
    
    .nav-link:hover {
        background: var(--light-gray);
    }
    
    .dropdown {
        width: 100%;
    }
    
    .dropdown-toggle {
        width: 100%;
        justify-content: space-between;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0;
        background: var(--lighter-gray);
        border-radius: 0;
    }
    
    .dropdown-menu a {
        padding: 10px 30px;
        font-size: 14px;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    .sip-header h1 {
        font-size: 32px;
    }
    
    .maturity-value {
        font-size: 32px;
    }
    
    .investment-type-selector {
        grid-template-columns: 1fr;
    }
    
    .goals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .breakdown-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

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

.card {
    animation: fadeIn 0.5s ease;
}