:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --accent: #f59e0b;
    --bg-dark: #0f0f23;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    position: relative;
    min-height: 100vh;
}

.bg-gradient {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(245, 158, 11, 0.08) 0%, transparent 40%);
    animation: rotate 30s linear infinite;
    z-index: 0;
}

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

.bg-blur {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(100px);
    z-index: 1;
}

.main-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

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

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-icon {
    font-size: 2.5rem;
    animation: bounce 2s ease-in-out infinite;
}

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

.logo h1 {
    font-size: 2.2rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

.calculator-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
}

.input-section {
    display: grid;
    gap: 28px;
    margin-bottom: 40px;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-wrapper .currency,
.input-wrapper .unit {
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 500;
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 12px 8px;
    text-align: right;
}

.input-wrapper input::-webkit-outer-spin-button,
.input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quick-amounts {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.quick-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: var(--text-primary);
}

.slider-container {
    margin-top: 12px;
}

.slider-container input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.5);
    transition: transform 0.2s ease;
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.payment-type-toggle {
    display: flex;
    gap: 8px;
}

.type-btn {
    flex: 1;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.type-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.type-btn.active {
    background: var(--gradient-1);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.results-section {
    border-top: 1px solid var(--border);
    padding-top: 32px;
}

.result-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.result-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.result-card.primary {
    background: var(--gradient-1);
    border: none;
    margin-bottom: 20px;
}

.result-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.result-value.small {
    font-size: 1.5rem;
}

.currency-small {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.8;
}

.result-note {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.chart-container {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
}

.breakdown-section h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-detail {
    font-size: 0.85rem;
    color: var(--primary-light);
    cursor: pointer;
    transition: color 0.2s ease;
}

.toggle-detail:hover {
    color: var(--primary);
}

.breakdown-table-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.breakdown-table-container.expanded {
    max-height: 400px;
    overflow-y: auto;
}

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

.breakdown-table th,
.breakdown-table td {
    padding: 12px 8px;
    text-align: right;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.breakdown-table th {
    color: var(--text-muted);
    font-weight: 500;
}

.breakdown-table td {
    color: var(--text-secondary);
}

.breakdown-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer strong {
    color: var(--primary-light);
}

.footer-note {
    margin-top: 8px;
    font-size: 0.8rem;
}

@media (max-width: 640px) {
    .main-content {
        padding: 20px 16px;
    }
    
    .calculator-card {
        padding: 20px;
        border-radius: 20px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .input-wrapper input {
        font-size: 1.2rem;
    }
    
    .result-value {
        font-size: 2rem;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-amounts {
        justify-content: center;
    }
}
