@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Gradients */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --light-gradient: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);

    /* Light Theme Colors */
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-light: #a0aec0;

    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-tertiary: #edf2f7;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-hover: #f7fafc;

    --border-light: #e2e8f0;
    --border-medium: #cbd5e0;

    --body-bg: radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
               radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
               radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%),
               linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);

    --pattern-dots: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    --pattern-circles: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M20 20c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10zm10 0c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10z'/%3E%3C/g%3E%3C/svg%3E");

    --chart-grid-color: rgba(0, 0, 0, 0.1);
    --chart-text-color: #666;

    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --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);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-3xl: 2rem;
}

/* Dark Theme */
[data-theme="dark"] {
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e0;
    --text-muted: #a0aec0;
    --text-light: #718096;

    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-tertiary: #4a5568;
    --bg-card: #2d3748;
    --bg-input: #1a202c;
    --bg-hover: #4a5568;

    --border-light: #4a5568;
    --border-medium: #718096;

    --body-bg: radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
               radial-gradient(circle at 80% 20%, rgba(240, 147, 251, 0.15) 0%, transparent 50%),
               radial-gradient(circle at 40% 40%, rgba(79, 172, 254, 0.1) 0%, transparent 50%),
               linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #4a5568 100%);

    --pattern-dots: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    --pattern-circles: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.015'%3E%3Cpath d='M20 20c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10zm10 0c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10z'/%3E%3C/g%3E%3C/svg%3E");

    --chart-grid-color: rgba(255, 255, 255, 0.1);
    --chart-text-color: #cbd5e0;

    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--body-bg);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    transition: background 0.3s ease, color 0.3s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--pattern-dots) repeat, var(--pattern-circles) repeat;
    pointer-events: none;
    z-index: -1;
    transition: background 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
    position: relative;
}

header::before {
    content: '';
    position: absolute;
    top: -2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    border-radius: 2px;
}

header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    letter-spacing: -0.02em;
    color: white;
}

[data-theme="light"] header h1 {
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

header p {
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0.95;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-xl);
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
}

.theme-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    background: rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-lg);
}

.theme-toggle:active {
    transform: translateY(0) scale(0.98);
}

.theme-icon-light {
    display: block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-icon-dark {
    display: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

[data-theme="dark"] .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-icon-dark {
    display: block;
}

[data-theme="dark"] .theme-toggle {
    background: rgba(26, 32, 44, 0.5);
    border-color: rgba(74, 85, 104, 0.5);
}

/* Presets Section */
.presets-section {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.presets-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.02em;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.preset-btn {
    background: var(--bg-hover);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 1.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.preset-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

.preset-btn:active {
    transform: translateY(-2px);
}

.preset-icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.preset-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.preset-details {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.calculator {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    box-shadow: var(--shadow-2xl);
    margin-bottom: 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    border: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.calculator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), transparent);
}

.calculator::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.inputs-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.input-group-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    transition: background 0.3s ease, border-color 0.3s ease;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.group-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.group-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-medium), transparent);
    margin-left: 0.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    margin-bottom: 1rem;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
}

.input-group input[type="number"] {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-primary);
    color: var(--text-primary);
    position: relative;
}

.input-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), var(--shadow-md);
    transform: translateY(-1px);
}

.input-group input[type="number"]:hover {
    border-color: var(--border-medium);
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.slider-container {
    margin-top: 0.25rem;
    position: relative;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid white;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow-xl);
}

.slider::-webkit-slider-thumb:active {
    transform: scale(1.05);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.25rem;
    font-weight: 400;
}

.input-group input[readonly] {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: var(--border-light);
}

.input-group input[readonly]:focus {
    transform: none;
    box-shadow: none;
}

.results-section {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

.result-card {
    background: 
        var(--primary-gradient),
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M20 20c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10z'/%3E%3C/g%3E%3C/svg%3E") repeat;
    color: white;
    padding: 1.25rem;
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.total-amount-card {
    background: 
        linear-gradient(135deg, #667eea 0%, #764ba2 100%),
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M20 20c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10z'/%3E%3C/g%3E%3C/svg%3E") repeat;
}

.contributions-card {
    background:
        linear-gradient(135deg, #4facfe 0%, #00f2fe 100%),
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M20 20c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10z'/%3E%3C/g%3E%3C/svg%3E") repeat;
}

.employer-card {
    background:
        linear-gradient(135deg, #FDB99B 0%, #CF8BF3 100%),
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M20 20c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10z'/%3E%3C/g%3E%3C/svg%3E") repeat;
}

.earnings-card {
    background:
        linear-gradient(135deg, #43e97b 0%, #38f9d7 100%),
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M20 20c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10z'/%3E%3C/g%3E%3C/svg%3E") repeat;
}

.pension-card {
    background:
        linear-gradient(135deg, #f093fb 0%, #f5576c 100%),
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M20 20c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10z'/%3E%3C/g%3E%3C/svg%3E") repeat;
}

.tax-card {
    background:
        linear-gradient(135deg, #fa709a 0%, #fee140 100%),
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M20 20c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10z'/%3E%3C/g%3E%3C/svg%3E") repeat;
}

.net-card {
    background:
        linear-gradient(135deg, #30cfd0 0%, #330867 100%),
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M20 20c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10z'/%3E%3C/g%3E%3C/svg%3E") repeat;
}

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

.action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn .btn-icon {
    font-size: 1.1rem;
}

.reset-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.export-btn {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.share-btn {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.pdf-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.csv-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.print-btn {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: var(--text-primary);
}

/* One-time Contributions Section */
.one-time-contributions-section {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.one-time-contributions-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.02em;
}

.one-time-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.one-time-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 40px;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-light);
}

.one-time-list:empty::before {
    content: 'Nav pievienotu vienreizēju iemaksu';
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.one-time-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.one-time-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.one-time-item-remove {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.one-time-item-remove:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.one-time-add-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.one-time-add-form input {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.one-time-add-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.one-time-add-btn {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
}

.one-time-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.one-time-add-btn:active {
    transform: translateY(0);
}

/* Inflation Toggle Section */
.inflation-toggle-section {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    transition: background 0.3s ease, border-color 0.3s ease;
    align-items: center;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    position: relative;
}

.toggle-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    width: 60px;
    height: 30px;
    background: var(--bg-tertiary);
    border-radius: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--border-light);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--bg-primary);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.toggle-container input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.toggle-container input:checked + .toggle-slider::before {
    transform: translateX(30px);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.toggle-icon {
    font-size: 1.25rem;
}

.toggle-text {
    letter-spacing: -0.01em;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-2xl);
}

.result-card:hover .card-icon {
    animation-duration: 1s;
    transform: scale(1.1);
}

.result-card:hover .result-value {
    transform: scale(1.05);
}

.result-card:hover::before {
    opacity: 1;
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

.result-card h3 {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    opacity: 0.95;
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.card-subtitle {
    font-size: 0.7rem;
    opacity: 0.85;
    font-weight: 400;
    margin-top: 0.25rem;
    font-style: italic;
}

.result-card small {
    font-size: 0.7rem;
    opacity: 0.85;
    font-weight: 400;
}

.chart-section, .table-section, .info-section {
    background: var(--bg-card);
    border-radius: var(--radius-3xl);
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.chart-section::before, .table-section::before, .info-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), transparent);
}

.chart-section {
    min-height: 500px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-header h3 {
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.chart-type-toggle {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.chart-type-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.chart-type-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.chart-type-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.chart-type-btn span:first-child {
    font-size: 1.1rem;
}

.chart-reset-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.chart-reset-btn:hover {
    background: var(--bg-primary);
    border-color: #667eea;
    color: #667eea;
}

.chart-reset-btn span:first-child {
    font-size: 1.1rem;
}

#growthChart {
    max-height: 350px;
    cursor: pointer;
}

.chart-info {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border-left: 4px solid #667eea;
    font-size: 0.95rem;
    color: var(--text-primary);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-info:empty::before {
    content: 'Noklikšķiniet uz diagrammas, lai redzētu detalizētu informāciju';
    color: var(--text-muted);
    font-style: italic;
}

.chart-info.has-selection {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

.table-section h3, .info-section h3 {
    margin-bottom: 2rem;
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.02em;
}

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
    font-size: 0.95rem;
}

th, td {
    padding: 1.25rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

th {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    font-size: 0.9rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

tr:hover {
    background: var(--bg-secondary);
}

tr:hover td {
    color: var(--text-primary);
}

tr.table-selected {
    background: rgba(255, 107, 107, 0.2) !important;
    border-left: 4px solid #ff6b6b;
}

tr.table-selected td {
    font-weight: 700;
    color: var(--text-primary) !important;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.info-card {
    background: 
        var(--secondary-gradient),
        url("data:image/svg+xml,%3Csvg width='50' height='50' viewBox='0 0 50 50' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M25 25c0-6.9-5.6-12.5-12.5-12.5S0 18.1 0 25s5.6 12.5 12.5 12.5S25 31.9 25 25z'/%3E%3C/g%3E%3C/svg%3E") repeat;
    color: white;
    padding: 2.5rem;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.info-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-2xl);
}

.info-card:hover::before {
    opacity: 1;
}

.info-card h4 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.info-card p {
    line-height: 1.7;
    opacity: 0.95;
    font-weight: 400;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 1.5rem;
    }
    
    .calculator {
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .chart-section, .table-section, .info-section {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .calculator {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.25rem;
    }

    .results-section {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .preset-buttons {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2.5rem;
    }

    .info-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .chart-section, .table-section, .info-section {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .result-card {
        padding: 0.875rem;
        min-height: 120px;
    }
    
    .result-value {
        font-size: 1.25rem;
    }
    
    .result-card h3 {
        font-size: 0.7rem;
        margin-bottom: 0.375rem;
    }
    
    .card-icon {
        font-size: 1.5rem;
        margin-bottom: 0.375rem;
    }
    
    .card-subtitle {
        font-size: 0.65rem;
    }
    
    .inputs-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .input-group-section {
        padding: 1.25rem;
    }
    
    .group-title {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }

    .calculator {
        padding: 1rem;
        border-radius: var(--radius-2xl);
        gap: 1rem;
    }

    .results-section {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .result-value {
        font-size: 1.125rem;
    }

    .result-card {
        padding: 0.75rem;
        min-height: 100px;
    }

    .result-card h3 {
        font-size: 0.65rem;
        margin-bottom: 0.25rem;
    }

    .result-card small {
        font-size: 0.65rem;
    }

    .card-icon {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }

    .card-subtitle {
        font-size: 0.6rem;
    }

    .result-value {
        font-size: 1rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .input-group input[type="number"] {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .chart-section, .table-section, .info-section {
        padding: 1rem;
        border-radius: var(--radius-2xl);
    }
    
    .info-card {
        padding: 1.5rem;
    }
    
    .inputs-section {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .input-group-section {
        padding: 1rem;
    }
    
    .group-title {
        font-size: 0.8rem;
    }
    
    .input-group {
        margin-bottom: 0.75rem;
    }
}

/* Animation for result updates */
.result-value {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-value.updated {
    animation: pulse 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Loading animation */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* Notification animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Print Styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    body::before {
        display: none !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    header {
        color: black !important;
        margin-bottom: 1rem;
    }

    header::before {
        display: none;
    }

    header h1 {
        color: black !important;
        -webkit-text-fill-color: black !important;
        text-shadow: none !important;
    }

    header p {
        color: black !important;
        text-shadow: none !important;
    }

    /* Hide interactive elements */
    .presets-section,
    .inputs-section,
    .action-buttons,
    .inflation-toggle-section {
        display: none !important;
    }

    /* Show only results, chart, and table */
    .calculator {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        padding: 1rem !important;
        page-break-inside: avoid;
    }

    .results-section {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem !important;
        page-break-inside: avoid;
    }

    .result-card {
        background: white !important;
        color: black !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .result-card::before,
    .result-card::after {
        display: none !important;
    }

    .card-icon {
        filter: none !important;
    }

    .result-value,
    .card-subtitle,
    .result-card h3 {
        color: black !important;
        text-shadow: none !important;
    }

    .chart-section,
    .table-section {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        page-break-before: always;
        page-break-inside: avoid;
    }

    .chart-section::before,
    .table-section::before {
        display: none !important;
    }

    .chart-section h3,
    .table-section h3 {
        color: black !important;
    }

    table {
        border: 1px solid #ccc !important;
    }

    th {
        background: #f0f0f0 !important;
        color: black !important;
        border: 1px solid #ccc !important;
    }

    td {
        border: 1px solid #ccc !important;
        color: black !important;
    }

    .info-section {
        display: none !important;
    }

    /* Add footer with date */
    .calculator::after {
        content: "Izveidots: " attr(data-print-date);
        display: block;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #ccc;
        font-size: 0.8rem;
        color: #666;
    }
}

/* Goal-Based Planning Sections */

/* Goal Section */
.goal-section {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.goal-header h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.goal-toggle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.goal-toggle-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.goal-toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--bg-tertiary);
    border-radius: 13px;
    transition: all 0.3s ease;
    border: 2px solid var(--border-light);
}

.goal-toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--bg-primary);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.goal-toggle-container input:checked + .goal-toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.goal-toggle-container input:checked + .goal-toggle-slider::before {
    transform: translateX(24px);
}

.goal-toggle-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.goal-content {
    margin-top: 1.5rem;
}

.goal-inputs {
    margin-bottom: 1.5rem;
}

.goal-input-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.goal-input-group input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.goal-input-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.goal-progress {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.goal-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.status-icon {
    font-size: 1.5rem;
}

.status-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.progress-bar-container {
    position: relative;
    height: 32px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.75rem;
}

.progress-bar.on-track {
    background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
}

.progress-bar.exceeded {
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    z-index: 1;
}

.goal-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.goal-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Gap Analysis Section */
.gap-analysis-section {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(238, 90, 111, 0.1) 100%);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 2px solid rgba(255, 107, 107, 0.3);
    backdrop-filter: blur(20px);
}

.gap-analysis-section h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    text-align: center;
}

.gap-summary {
    text-align: center;
    margin-bottom: 2rem;
}

.gap-amount {
    font-size: 2rem;
    font-weight: 800;
    color: #ff6b6b;
    margin-bottom: 0.5rem;
}

.gap-description {
    font-size: 1rem;
    color: var(--text-secondary);
}

.gap-solutions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.gap-solution-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: center;
    transition: background 0.3s ease;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 2px solid var(--border-light);
}

.gap-solution-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #667eea;
}

.solution-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.solution-content h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.solution-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #667eea;
    margin-bottom: 1rem;
}

.solution-apply-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.solution-apply-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.solution-apply-btn:active {
    transform: scale(0.98);
}

/* Withdrawal Scenarios Section */
.withdrawal-scenarios-section {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.withdrawal-scenarios-section h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    text-align: center;
}

.withdrawal-intro {
    text-align: center;
    margin-bottom: 1.5rem;
}

.withdrawal-intro p {
    font-size: 1rem;
    color: var(--text-secondary);
}

.withdrawal-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.withdrawal-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: background 0.3s ease;
    transition: all 0.3s ease;
    border: 2px solid var(--border-light);
}

.withdrawal-card.conservative {
    border-color: rgba(67, 233, 123, 0.3);
}

.withdrawal-card.moderate {
    border-color: rgba(255, 193, 7, 0.3);
}

.withdrawal-card.aggressive {
    border-color: rgba(255, 107, 107, 0.3);
}

.withdrawal-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.withdrawal-rate {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.rate-icon {
    font-size: 1.25rem;
}

.rate-label {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.rate-percent {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.withdrawal-amount {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.withdrawal-longevity {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Reverse Calculator Section */
.reverse-calculator-section {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.reverse-calculator-section h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    text-align: center;
}

.reverse-calc-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.reverse-calc-mode {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    grid-column: 1 / -1;
}

.radio-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-option:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.radio-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked ~ span {
    font-weight: 700;
    color: #667eea;
}

.radio-option span {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.reverse-calc-inputs {
    grid-column: 1;
}

.reverse-input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-row label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.input-row input[type="number"] {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-row input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.reverse-calc-results {
    grid-column: 2;
}

.reverse-result-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    border: 2px solid var(--border-light);
}

.reverse-result-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.reverse-result-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    transition: background 0.3s ease;
}

.result-item.status-item {
    border: 2px solid var(--border-light);
}

.result-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.result-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-value.status {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.result-value.status.on-track {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.result-value.status.shortfall {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.result-value.status.surplus {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.reverse-recommendation {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 4px solid #667eea;
    transition: background 0.3s ease;
}

.reverse-recommendation p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Responsive Adjustments for Goal-Based Features */
@media (max-width: 1024px) {
    .gap-solutions,
    .withdrawal-cards {
        grid-template-columns: 1fr;
    }

    .reverse-calc-content {
        grid-template-columns: 1fr;
    }

    .reverse-calc-inputs,
    .reverse-calc-results {
        grid-column: 1;
    }

    .goal-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .goal-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .reverse-calc-mode {
        flex-direction: column;
    }
}

/* Print Styles for Goal-Based Features */
@media print {
    .goal-section,
    .gap-analysis-section,
    .withdrawal-scenarios-section,
    .reverse-calculator-section {
        page-break-inside: avoid;
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* PWA Styles */

/* Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 10000;
}

.pwa-install-banner.show {
    transform: translateY(0);
}

.pwa-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pwa-banner-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.pwa-banner-text {
    flex: 1;
}

.pwa-banner-text strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.pwa-banner-text p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.pwa-banner-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.pwa-install-button {
    background: var(--bg-primary);
    color: #667eea;
    border: none;
    padding: 0.75rem 1.5rem;
    transition: background 0.3s ease;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.pwa-install-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.pwa-dismiss-button {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.pwa-dismiss-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ff6b6b;
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10000;
    animation: slideInDown 0.3s ease;
}

.offline-icon {
    font-size: 1.2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Update Banner */
.pwa-update-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 10000;
    animation: slideInDown 0.3s ease;
}

.pwa-update-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.update-icon {
    font-size: 1.5rem;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.pwa-reload-button {
    background: var(--bg-primary);
    color: #43e97b;
    border: none;
    padding: 0.5rem 1rem;
    transition: background 0.3s ease;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-reload-button:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* PWA Mode Adjustments */
body.pwa-mode {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Hide install banner in print */
@media print {
    .pwa-install-banner,
    .offline-indicator,
    .pwa-update-banner {
        display: none !important;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pwa-banner-content {
        flex-direction: column;
        text-align: center;
    }

    .pwa-banner-icon {
        font-size: 2.5rem;
    }

    .pwa-banner-actions {
        width: 100%;
        justify-content: center;
    }

    .pwa-install-button {
        flex: 1;
    }

    .offline-indicator {
        top: 10px;
        right: 10px;
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

    .pwa-update-banner {
        top: 10px;
        left: 10px;
        right: 10px;
        transform: none;
    }
}
