/* ===============================================
   INVESTMENT CALCULATOR - MODERNTOOLS THEME
   =============================================== */

/* CSS Variables - Exact Match with Password Generator */
:root {
    /* Brand Colors */
    --brand-primary: #3B82F6;
    --brand-secondary: #10B981;
    --accent-color: #8B5CF6;
    --primary-color: #3B82F6;
    --secondary-color: #10B981;

    /* Text Colors */
    --text-color: #1F2937;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --text-muted: #9CA3AF;
    --text-primary: #1F2937;
    --text-inverse: #FFFFFF;

    /* Background Colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;

    /* Border Colors */
    --border-color: #E5E7EB;
    --border-light: #F3F4F6;
    --border-dark: #D1D5DB;

    /* Shadows */
    --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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-base: 0.5rem;
    --radius-2xl: 1.5rem;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Typography */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Text Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;

    /* Status Colors */
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
    --info-color: #3B82F6;
}

/* Dark Theme Overrides - Exact Match with Password Generator */
[data-theme="dark"] {
    --text-color: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-tertiary: #9CA3AF;
    --text-muted: #9CA3AF;
    --text-primary: #F9FAFB;
    --bg-primary: #111827;
    --bg-secondary: #1F2937;
    --bg-tertiary: #374151;
    --border-color: #374151;
    --border-light: #4B5563;
    --border-dark: #6B7280;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* ===============================================
   GLOBAL STYLES
   =============================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-color);
    line-height: 1.6;
    transition: all 0.3s ease;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* ===============================================
   NAVBAR FIXES & ENHANCEMENTS - EXACT MATCH
   =============================================== */

/* Override navbar styles to match password generator exactly */
.navbar {
    border-bottom: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .navbar {
    border-bottom: 1px solid var(--border-color) !important;
}

/* REMOVED: Back-button styles - using global styles instead */

/* Navigation container layout with proper gaps */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 24px;
    min-height: 60px;
    position: relative;
}

/* Centered navigation with proper spacing */
.nav-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-size: var(--text-base);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
}

.nav-link:hover {
    color: var(--brand-primary);
    background: rgba(59, 130, 246, 0.1);
}

.nav-link:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--brand-primary);
    transform: translateX(-50%);
    transition: width var(--transition-base);
}

.nav-link:hover:after {
    width: 80%;
}

/* Right side navigation */
.nav-end {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Mobile navigation adjustments */
@media (max-width: 768px) {
    .nav-center {
        display: none;
    }
    
    .nav-container {
        padding: 10px 20px;        min-height: 55px;
    }
    
    /* REMOVED: Mobile back-button styles - using global styles instead */
}

/* ===============================================
   HERO SECTION - EXACT MATCH WITH PASSWORD GENERATOR
   =============================================== */

.tool-hero {
    margin-top: 0 ;
    padding: 120px 0 80px;
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(59, 130, 246, 0.1) 30%, rgba(16, 185, 129, 0.1) 70%, var(--bg-primary) 100%);
    overflow: hidden;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-hero .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    display: flex;
    justify-content: center;
}

@keyframes heroBackgroundPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* Specific override for investment calculator hero content */
.tool-hero .hero-content {
    display: block !important;
    grid-template-columns: none !important;
    gap: normal !important;
    text-align: center !important;
    max-width: 800px !important;
    width: 100% !important;
    margin: 0 auto !important;
    position: relative;
    z-index: 2;
    padding: 0 var(--space-4);
}

.hero-content {
    text-align: center;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    padding: 0 var(--space-4);
    display: block !important;
    grid-template-columns: unset !important;
    gap: unset !important;
}

/* Hero Icon - Exact Match with Password Generator */
.hero-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    margin: 0 auto 30px auto;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
    border-radius: 50%;
    box-shadow: 
        0 15px 35px rgba(59, 130, 246, 0.4),
        0 0 0 10px rgba(59, 130, 246, 0.1),
        0 0 0 20px rgba(59, 130, 246, 0.05);
    position: relative;
    overflow: hidden;
}

.hero-icon i {
    font-size: 3rem;
    color: white;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 2;
}


.hero-text h1 {
    font-size: 3.5rem;
    font-weight: var(--font-weight-extrabold);
    color: var(--text-color);
    margin-bottom: var(--space-6);
    line-height: 1.1;
    text-align: center;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
    flex-wrap: wrap;
}

.feature-tag {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.feature-tag:hover {
    background: var(--primary-color);
    color: var(--text-inverse);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.feature-tag i {
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.feature-tag:hover i {
    color: var(--text-inverse);
}

/* ===============================================
   CALCULATOR SECTION STYLES
   =============================================== */

.calculator-section {
    padding: var(--space-12) 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.calculator-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

/* Mode Selector */
.mode-selector {
    display: flex;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.mode-btn {
    flex: 1;
    min-width: 200px;
    padding: var(--space-4) var(--space-6);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    position: relative;
}

.mode-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-color);
}

.mode-btn.active {
    background: var(--bg-primary);
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.mode-btn i {
    font-size: 1.5rem;
    margin-bottom: var(--space-1);
}

.mode-btn span {
    font-size: var(--text-sm);
    text-align: center;
}

/* Calculator Mode Content */
.calculator-mode {
    display: none;
}

.calculator-mode.active {
    display: block;
}

.calculator-card {
    padding: var(--space-8);
}

.calculator-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.calculator-header h2 {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    color: var(--text-color);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
}

.calculator-header p {
    color: var(--text-secondary);
    font-size: var(--text-lg);
}

/* Input Sections */
.input-sections {
    display: grid;
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.input-section {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    border: 1px solid var(--border-color);
}

.section-header {
    margin-bottom: var(--space-6);
}

.section-header h3 {
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    color: var(--text-color);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.section-header p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-6);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.input-group label {
    font-weight: var(--font-weight-medium);
    color: var(--text-color);
    font-size: var(--text-sm);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix,
.input-suffix {
    position: absolute;
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    z-index: 1;
    pointer-events: none;
}

.input-prefix {
    left: var(--space-3);
}

.input-suffix {
    right: var(--space-3);
}

.input-wrapper input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-color);
    font-size: var(--text-base);
    transition: all 0.3s ease;
}

.input-wrapper input:has(+ .input-prefix) {
    padding-left: calc(var(--space-8) + 10px);
}

.input-wrapper input:has(~ .input-suffix) {
    padding-right: calc(var(--space-8) + 10px);
}

.input-wrapper:has(.input-prefix) input {
    padding-left: calc(var(--space-8) + 10px);
}

.input-wrapper:has(.input-suffix) input {
    padding-right: calc(var(--space-8) + 10px);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Risk Selector */
.risk-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

.risk-option {
    padding: var(--space-6);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.risk-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.risk-option.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.risk-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--space-3);
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.risk-option.active .risk-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.risk-option h4 {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-2);
}

.risk-option p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.risk-option.active p {
    color: rgba(255, 255, 255, 0.8);
}

/* Calculate Button */
.calculate-section {
    text-align: center;
    margin-bottom: var(--space-8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.calculate-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-8);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--text-lg);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    margin-bottom: 0.5rem;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* Clear Button - Exact Match with Password Generator */
.clear-btn {
    margin-top: 0.7rem;
    margin-left: 0;
    background: rgb(163, 163, 163);
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.5rem 1.2rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.clear-btn:hover, .clear-btn:focus {
    background: #f87171;
    color: #fff;
    border-color: #ef4444;
}

/* Results Section */
.results-section {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    border: 1px solid var(--border-color);
    margin-top: var(--space-8);
}

.results-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.results-header h3 {
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.result-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.result-card.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--primary-color);
}

.result-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.result-card.primary .result-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.result-content {
    flex: 1;
}

.result-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
}

.result-card.primary .result-label {
    color: rgba(255, 255, 255, 0.8);
}

.result-value {
    display: block;
    font-size: var(--text-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-color);
}

.result-card.primary .result-value {
    color: white;
}

/* Chart Container */
.chart-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    border: 1px solid var(--border-color);
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Portfolio Breakdown */
.portfolio-breakdown {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-8);
    align-items: center;
}

@media (max-width: 900px) {
    .portfolio-breakdown {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    .allocation-chart {
        height: 240px;
        padding: var(--space-4);
        margin-bottom: var(--space-4);
    }
    .allocation-details {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-3);
        justify-content: center;
    }
    .allocation-item {
        min-width: 140px;
        flex: 1 1 40%;
        justify-content: space-between;
    }
}

@media (max-width: 600px) {
    .portfolio-breakdown {
        gap: var(--space-2);
        padding: var(--space-2);
        background: var(--bg-secondary);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
    }
    .allocation-chart {
        width: 100%;
        min-width: 0;
        height: 160px;
        padding: 0;
        margin-bottom: var(--space-2);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .allocation-details {
        width: 100%;
        flex-direction: column;
        gap: var(--space-1);
        padding: 0;
    }
    .allocation-item {
        width: 100%;
        min-width: unset;
        font-size: 0.98rem;
        padding: var(--space-1) var(--space-2);
        margin: 0;
        border-radius: var(--radius-base);
        background: var(--bg-primary);
        box-shadow: none;
    }
}

.allocation-chart {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    border: 1px solid var(--border-color);
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.allocation-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.allocation-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.allocation-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.allocation-color.equity {
    background: var(--primary-color);
}

.allocation-color.debt {
    background: var(--secondary-color);
}

.allocation-color.gold {
    background: #F59E0B;
}

.allocation-color.international {
    background: var(--accent-color);
}

.allocation-label {
    flex: 1;
    font-weight: var(--font-weight-medium);
    color: var(--text-color);
}

.allocation-percentage {
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
}

/* ===============================================
   MINI TOOLS HUB SECTION
   =============================================== */

.mini-tools-hub {
    padding: var(--space-12) 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.mini-hub-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.mini-hub-header h2 {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    color: var(--text-color);
    margin-bottom: var(--space-3);
}

.mini-hub-header p {
    color: var(--text-secondary);
    font-size: var(--text-lg);
}

.mini-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-6);
}

.mini-tool-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.mini-tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.mini-tool-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.mini-tool-content h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-color);
    margin-bottom: var(--space-1);
}

.mini-tool-content p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

/* Ensure hero content is always centered on all screen sizes */
@media (min-width: 1024px) {
    .tool-hero .hero-content {
        display: block !important;
        grid-template-columns: none !important;
        text-align: center !important;
        margin: 0 auto !important;
    }
}

/* Responsive design for hero section */
@media (max-width: 1200px) {
    .tool-hero {
        padding: 100px 0 60px;
    }
    
    .hero-content {
        max-width: 700px;
        padding: 0 var(--space-6);
    }
    
    .hero-text h1 {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .tool-hero {
        padding: 80px 0 40px;
    }
    
    .tool-hero .container {
        padding: 0 var(--space-4);
    }
    
    .hero-content {
        max-width: 600px;
        padding: 0 var(--space-2);
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
        max-width: 500px;
    }
    
    .hero-features {
        gap: var(--space-4);
        flex-direction: column;
        align-items: center;
    }
    
    .feature-tag {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .mode-selector {
        flex-direction: column;
    }
    
    .mode-btn {
        min-width: auto;
        flex-direction: row;
        justify-content: center;
        padding: var(--space-3) var(--space-4);
    }
    
    .input-grid {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-breakdown {
        grid-template-columns: 1fr;
    }
    
    .mini-tools-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tool-hero {
        padding: 100px 0 30px;
    }
    
    .hero-content {
        max-width: 100%;
        padding: 0 var(--space-1);
    }
    
    .hero-text h1 {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
        max-width: 400px;
    }
    
    .calculator-card {
        padding: var(--space-4);
    }
    
    .input-section {
        padding: var(--space-4);
    }
    
    .results-section {
        padding: var(--space-4);
    }
}

/* Ensure .hero-icon matches password generator theme on all screen sizes */
@media (max-width: 768px) {
    .hero-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 20px;
    }
    .hero-icon i {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-icon {
        width: 54px;
        height: 54px;
        margin-bottom: 16px;
    }
    .hero-icon i {
        font-size: 1.4rem;
    }
}

/* Windows-specific improvements */
@media screen and (min-width: 1024px) {
    .tool-hero {
        min-height: 400px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .tool-hero .container {
        min-height: 300px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ===============================================
   ENHANCED RESPONSIVE DESIGN - INVESTMENT CALCULATOR
   =============================================== */

/* Investment calculator responsive variables */
:root {
    /* Fluid spacing for investment calculator */
    --invest-fluid-space-xs: clamp(0.25rem, 1vw, 0.5rem);
    --invest-fluid-space-sm: clamp(0.5rem, 2vw, 1rem);
    --invest-fluid-space-md: clamp(1rem, 3vw, 2rem);
    --invest-fluid-space-lg: clamp(1.5rem, 4vw, 3rem);
    --invest-fluid-space-xl: clamp(2rem, 5vw, 4rem);
    
    /* Fluid typography for investment calculator */
    --invest-fluid-text-xs: clamp(0.7rem, 1.8vw, 0.75rem);
    --invest-fluid-text-sm: clamp(0.8rem, 2vw, 0.875rem);
    --invest-fluid-text-base: clamp(0.9rem, 2.5vw, 1rem);
    --invest-fluid-text-lg: clamp(1rem, 3vw, 1.125rem);
    --invest-fluid-text-xl: clamp(1.1rem, 3.5vw, 1.25rem);
    --invest-fluid-text-2xl: clamp(1.3rem, 4vw, 1.5rem);
    --invest-fluid-text-3xl: clamp(1.5rem, 5vw, 1.875rem);
}

/* Enhanced investment calculator container */
.investment-calculator-container,
.calculator-main-wrapper {
    max-width: min(900px, 95vw);
    margin: 0 auto;
    padding: var(--invest-fluid-space-md);
    box-sizing: border-box;
}

/* Responsive investment form layout */
.investment-form,
.calculator-input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: var(--invest-fluid-space-md);
    width: 100%;
}

/* Enhanced investment input responsiveness */
.investment-input,
.calculator-field,
.form-control {
    padding: var(--invest-fluid-space-sm);
    font-size: var(--invest-fluid-text-base);
    border-radius: var(--radius-lg);
    min-height: 48px;
    width: 100%;
    box-sizing: border-box;
}

/* Responsive investment calculator buttons */
.investment-calculate-btn,
.calc-button {
    padding: var(--invest-fluid-space-md) var(--invest-fluid-space-lg);
    font-size: var(--invest-fluid-text-lg);
    border-radius: var(--radius-xl);
    min-height: 52px;
    width: 100%;
    max-width: 320px;
    margin: var(--invest-fluid-space-md) auto 0;
}

/* Investment results section responsiveness */
.investment-results,
.results-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: var(--invest-fluid-space-md);
    padding: var(--invest-fluid-space-lg);
    border-radius: var(--radius-2xl);
    margin-top: var(--invest-fluid-space-lg);
}

.investment-result-item,
.result-metric {
    padding: var(--invest-fluid-space-md);
    border-radius: var(--radius-xl);
    text-align: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

/* Enhanced investment chart responsiveness */
.investment-chart-container,
.chart-section {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: var(--radius-xl);
    margin-top: var(--invest-fluid-space-lg);
}

.investment-chart-container canvas,
.chart-section canvas {
    max-width: 100%;
    height: auto;
    min-height: 320px;
}

/* Investment projection table responsiveness */
.investment-projection-table,
.growth-table {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    overflow-x: auto;
    margin-top: var(--invest-fluid-space-lg);
}

.investment-projection-table table,
.growth-table table {
    width: 100%;
    font-size: var(--invest-fluid-text-sm);
    min-width: 600px;
}

.investment-projection-table th,
.investment-projection-table td,
.growth-table th,
.growth-table td {
    padding: var(--invest-fluid-space-sm);
    text-align: center;
}

/* Investment scenario tabs responsiveness */
.investment-scenarios,
.scenario-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--invest-fluid-space-xs);
    margin-bottom: var(--invest-fluid-space-md);
}

.investment-scenario-tab,
.scenario-tab {
    flex: 1;
    min-width: 140px;
    padding: var(--invest-fluid-space-sm);
    font-size: var(--invest-fluid-text-sm);
    border-radius: var(--radius-lg);
    text-align: center;    cursor: pointer;
    transition: all 0.3s ease;
}

/* Currency Selector */
.currency-selector-wrapper {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-4) var(--space-6);
}

.currency-selector {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    max-width: 300px;
}

.currency-selector label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: var(--font-weight-medium);
    color: var(--text-color);
    font-size: var(--text-sm);
    white-space: nowrap;
}

.currency-selector label i {
    color: var(--primary-color);
    font-size: 1rem;
}

.currency-selector select {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    background: var(--bg-primary);
    color: var(--text-color);
    font-size: var(--text-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 180px;
}

.currency-selector select:hover {
    border-color: var(--primary-color);
}

.currency-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Dark theme support for currency selector */
[data-theme="dark"] .currency-selector select {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .currency-selector select option {
    background: var(--bg-tertiary);
    color: var(--text-color);
}

/* Clear Button - Exact Match with Password Generator */
.clear-btn {
    margin-top: 0.7rem;
    margin-left: 0;
    background: rgb(163, 163, 163);
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.5rem 1.2rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.clear-btn:hover, .clear-btn:focus {
    background: #f87171;
    color: #fff;
    border-color: #ef4444;
}
