:root {
    /* Color Palette - Dark Mode Finance Dashboard */
    --primary-color: #3B82F6;
    --primary-dark: #2563EB;
    --primary-light: #60A5FA;
    
    --secondary-color: #10B981;
    --accent-color: #F59E0B;
    --warning-color: #FBBF24;
    
    /* Dark Mode Colors */
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;
    --bg-input: #475569;
    
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-tertiary: #94A3B8;
    
    --border-color: #334155;
    --border-light: #475569;
    
    /* Investment Type Colors */
    --lumpsum-color: #8B5CF6;
    --lumpsum-gradient: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    --recurring-color: #EC4899;
    --recurring-gradient: linear-gradient(135deg, #EC4899 0%, #DB2777 100%);
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
}

html {
    overflow-x: hidden;
    width: 100%;
}

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

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.logo-link:hover {
    opacity: 0.8;
    background: rgba(0, 102, 255, 0.1);
    transform: translateY(-2px);
}

.logo-link:active {
    transform: translateY(0);
}

.logo i {
    font-size: 28px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.language-selector {
    display: flex;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.lang-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-btn:hover {
    background: var(--bg-input);
}

.lang-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Main Content */
.main-content {
    padding: 48px 0;
    min-height: calc(100vh - 200px);
}

.page-header {
    text-align: center;
    margin-bottom: 48px;
}

.page-title {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Calculator Panel */
.calculator-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.panel-grid {
    display: grid;
    grid-template-columns: 450px 1fr;
    min-height: 900px;
}

.input-panel {
    background: var(--bg-secondary);
    padding: 40px;
    color: var(--text-primary);
    border-right: 1px solid var(--border-color);
}

.results-panel {
    padding: 40px;
    background: var(--bg-secondary);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 900px;
}

.logo-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
    width: 55%;
    max-width: 450px;
}

.logo-watermark img {
    width: 100%;
    height: auto;
    display: block;
}

.panel-header {
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.panel-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.input-panel .panel-header h2 {
    color: white;
}

/* Form Elements */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.info-text {
    margin-top: 8px;
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    font-weight: 400;
}

.info-text-warning {
    background: rgba(251, 191, 36, 0.15);
    border-left: 3px solid var(--warning-color);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: slideDown 0.3s ease-out;
}

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

.info-text-warning i {
    color: var(--warning-color);
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.info-text-auto {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--secondary-color);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.info-text-auto i {
    color: var(--secondary-color);
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-option {
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.btn-option:hover {
    background: var(--bg-input);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

/* Investment Type Specific Colors */
.btn-option[data-type="lumpsum"].active {
    background: var(--lumpsum-gradient);
    color: white;
    border-color: var(--lumpsum-color);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.btn-option[data-type="recurring"].active {
    background: var(--recurring-gradient);
    color: white;
    border-color: var(--recurring-color);
    box-shadow: 0 4px 16px rgba(236, 72, 153, 0.4);
}

/* Payment Method Colors */
.btn-option[data-method].active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.amount-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

#lumpsumAmountGroup .amount-options {
    grid-template-columns: repeat(2, 1fr);
}

#recurringAmountGroup .amount-options {
    grid-template-columns: repeat(2, 1fr);
}

.btn-amount {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-amount:hover {
    background: var(--bg-input);
    border-color: var(--border-light);
    transform: scale(1.02);
}

#lumpsumAmountGroup .btn-amount.active {
    background: var(--lumpsum-gradient);
    color: white;
    border-color: var(--lumpsum-color);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

#recurringAmountGroup .btn-amount.active {
    background: var(--recurring-gradient);
    color: white;
    border-color: var(--recurring-color);
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.custom-input {
    margin-top: 12px;
    position: relative;
}

.form-input {
    width: 100%;
    padding: 14px 60px 14px 16px;
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-input);
}

.input-suffix {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: var(--text-secondary);
}

.rate-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.btn-rate {
    padding: 14px 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: not-allowed;
    transition: var(--transition);
    pointer-events: none;
}

.btn-rate:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    transform: none;
}

.btn-rate.active {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #059669 100%);
    color: white;
    border-color: var(--secondary-color);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    pointer-events: none;
}

.btn-calculate {
    margin-top: 16px;
    padding: 18px 32px;
    border: none;
    background: linear-gradient(135deg, var(--accent-color) 0%, #D97706 100%);
    color: white;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-calculate:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.6);
}

.btn-calculate:active {
    transform: translateY(-1px);
}

/* Currency Selector */
.currency-selector {
    position: relative;
}

.currency-select {
    padding: 10px 36px 10px 16px;
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23CBD5E1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.currency-select:hover {
    border-color: var(--primary-color);
    background: var(--bg-input);
}

.currency-select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--bg-input);
}

/* Exchange Rate Info */
.exchange-rate-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.3s ease-out;
}

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

.exchange-rate-info i {
    color: var(--secondary-color);
    font-size: 14px;
    animation: rotate 2s linear infinite;
}

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

.exchange-rate-info .update-time {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-left: 4px;
}

/* Results Table */
.results-table-container {
    margin-bottom: 32px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-tertiary);
}

.results-table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.results-table th {
    padding: 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.results-table tbody tr:hover {
    background: var(--bg-input);
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

.no-data {
    text-align: center !important;
    color: var(--text-tertiary);
    font-style: italic;
    padding: 40px !important;
}

.period-cell {
    color: var(--primary-color);
    font-weight: 700;
}

.amount-cell {
    font-family: 'Inter', monospace;
    font-weight: 600;
}

.interest-cell {
    color: var(--secondary-color);
}

.total-cell {
    color: var(--text-primary);
    font-weight: 700;
}

/* Chart */
.chart-container {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 32px;
    height: 400px;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

/* Comment Section */
.comment-section {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
    border-left: 4px solid var(--warning-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    gap: 20px;
    animation: slideIn 0.5s ease-out;
    border: 1px solid rgba(251, 191, 36, 0.3);
    position: relative;
    z-index: 1;
}

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

.comment-icon {
    font-size: 32px;
    color: var(--warning-color);
    flex-shrink: 0;
}

.comment-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.comment-content p {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.7;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 32px 0 24px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
}

.footer p {
    margin-bottom: 8px;
}

.footer-disclaimer {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 24px;
}

.footer-company {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.company-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.company-address {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.company-contact {
    font-size: 13px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.company-contact .separator {
    opacity: 0.5;
}

.company-contact a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.company-contact a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .panel-grid {
        grid-template-columns: 400px 1fr;
    }
}

@media (max-width: 992px) {
    .panel-grid {
        grid-template-columns: 1fr;
    }
    
    .input-panel {
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }
    
    .page-title {
        font-size: 32px;
    }
    
    .page-subtitle {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .main-content {
        padding: 32px 0;
        width: 100%;
        overflow-x: hidden;
    }
    
    .page-header {
        margin-bottom: 32px;
        text-align: center;
    }
    
    .page-title {
        font-size: 28px;
    }
    
    .page-subtitle {
        font-size: 15px;
        padding: 0 8px;
    }
    
    .calculator-panel {
        width: 100%;
        overflow-x: hidden;
    }
    
    .input-panel, .results-panel {
        padding: 20px 16px;
        width: 100%;
    }
    
    .panel-grid {
        min-height: 800px;
        width: 100%;
        margin: 0;
    }
    
    .results-panel {
        min-height: 800px;
    }
    
    .logo-watermark {
        width: 65%;
        max-width: 320px;
    }
    
    .button-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .amount-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .btn-amount, .btn-rate, .btn-option {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    .rate-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .form-label {
        font-size: 15px;
    }
    
    .info-text {
        font-size: 13px;
    }
    
    .results-table th,
    .results-table td {
        padding: 10px 6px;
        font-size: 12px;
    }
    
    .chart-container {
        height: 300px;
        padding: 16px 8px;
        width: 100%;
    }
    
    .comment-section {
        flex-direction: column;
        padding: 16px;
    }
    
    .company-contact {
        flex-direction: column;
        gap: 4px;
    }
    
    .company-contact .separator {
        display: none;
    }
}

@media (max-width: 480px) {
    body {
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 12px;
        max-width: 100vw;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .logo i {
        font-size: 22px;
    }
    
    .language-selector {
        flex-direction: column;
        gap: 4px;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .page-header {
        padding: 0 4px;
    }
    
    .page-title {
        font-size: 22px;
        line-height: 1.3;
    }
    
    .page-subtitle {
        font-size: 13px;
        line-height: 1.5;
    }
    
    .input-panel, .results-panel {
        padding: 16px 12px;
        border-radius: var(--radius-lg);
    }
    
    .panel-header h2 {
        font-size: 20px;
    }
    
    .form-label {
        font-size: 14px;
    }
    
    .btn-amount, .btn-rate, .btn-option {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .info-text {
        font-size: 12px;
        padding: 10px;
    }
    
    .results-summary {
        padding: 16px 12px;
    }
    
    .summary-item {
        padding: 12px;
    }
    
    .summary-label {
        font-size: 12px;
    }
    
    .summary-value {
        font-size: 20px;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .chart-container {
        height: 250px;
        padding: 12px 4px;
    }
    
    .footer {
        padding: 24px 0;
    }
    
    .footer p {
        font-size: 12px;
    }
    
    .company-name {
        font-size: 14px;
    }
    
    .company-address, .company-contact {
        font-size: 11px;
    }
}
