:root {
    --primary: #312c7d;
    --primary-dark: #24205d;
    --secondary: #10B981;
    --accent: #F59E0B;
    --danger: #EF4444;
    --text-dark: #1F2937;
    --text-light: #6B7280;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.08);
    --radius-lg: 24px;
    --radius-md: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    min-height: 100vh;
    background: #f3f4f6;
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

/* Background Animation */
.background-globes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.globe {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
}

.globe-1 {
    width: 400px;
    height: 400px;
    background: #818cf8;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.globe-2 {
    width: 300px;
    height: 300px;
    background: #34d399;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.globe-3 {
    width: 200px;
    height: 200px;
    background: #fcd34d;
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(50px, 50px);
    }

    50% {
        transform: translate(0, 100px);
    }

    75% {
        transform: translate(-50px, 50px);
    }
}

.container {
    width: 100%;
    max-width: 800px;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 1rem;
    overflow: hidden;
    transition: transform 0.3s ease;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    background: rgba(49, 44, 125, 0.1);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(49, 44, 125, 0.3);
}

/* Sections */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.prefix {
    position: absolute;
    left: 1rem;
    color: var(--text-light);
    font-weight: 500;
}

input[type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem !important;
    border: 2px solid #e5e7eb !important;
    border-radius: var(--radius-md) !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
    background: rgba(255, 255, 255, 0.8) !important;
    color: var(--text-dark);
    outline: none;
}

select {
    padding-left: 1rem;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(49, 44, 125, 0.1);
}

/* Radio Cards */
.radio-group {
    display: flex;
    gap: 1rem;
}

.radio-card {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    opacity: 0;
}

.radio-card span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    font-weight: 500;
}

.radio-card input:checked+span {
    border-color: var(--primary);
    background: rgba(49, 44, 125, 0.05);
    color: var(--primary);
}

/* Buttons */
.btn-calculate,
.btn-save,
.btn-export,
.btn-clear {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-calculate {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(49, 44, 125, 0.3);
    margin-top: 1rem;
}

.btn-calculate:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-save {
    background: var(--secondary);
    color: white;
    margin-top: 1.5rem;
}

.btn-save:hover {
    filter: brightness(1.1);
}

.btn-export {
    width: auto;
    background: var(--text-dark);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-clear {
    background: transparent;
    color: var(--danger);
    border: 1px dashed var(--danger);
    margin-top: 2rem;
}

.btn-clear:hover {
    background: #FEF2F2;
}

/* Result Box */
.result-box {
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.6);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid #e5e7eb;
    animation: slideUp 0.5s ease;
}

.result-box.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-box h3 {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px dashed #e5e7eb;
}

.result-row:last-of-type {
    border-bottom: none;
}

.result-row span:first-child {
    color: var(--text-light);
    font-weight: 500;
}

.result-row .value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.highlight .value {
    color: var(--primary);
    font-size: 1.25rem;
}

.highlight-primary {
    background: rgba(49, 44, 125, 0.05);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid rgba(49, 44, 125, 0.1);
}

.highlight-primary span:first-child {
    color: var(--primary);
}

.highlight-primary .value {
    color: var(--primary);
    font-size: 1.5rem;
}

.note {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 1rem;
    font-style: italic;
}

.info-box {
    background: #EFF6FF;
    border-left: 4px solid var(--primary);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    display: flex;
    gap: 0.75rem;
    color: #1E40AF;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* History */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.history-item {
    background: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-info h4 {
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.history-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.history-amount {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #9CA3AF;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Table Styles */
.monthly-breakdown {
    margin-top: 1.5rem;
    border-top: 1px dashed #e5e7eb;
    padding-top: 1.5rem;
}

.monthly-breakdown h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.table-responsive {
    overflow-x: auto;
}

.table-details {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table-details th,
.table-details td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table-details th {
    background: rgba(49, 44, 125, 0.05);
    /* Based on new primary */
    color: var(--primary);
    font-weight: 600;
}

.table-details tr:last-child td {
    border-bottom: none;
}

/* Dec Special Row */
.row-dec {
    background: rgba(245, 158, 11, 0.1);
    /* Accent color hint */
    font-weight: 600;
}

/* Media Queries */
@media (max-width: 600px) {
    body {
        padding: 1rem;
    }

    .tabs {
        padding-bottom: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }
}

/* Toast Notification */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(49, 44, 125, 0.95);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    transform: translateX(120%);
    transition: transform 0.3s ease-out;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid #00b894;
}

.toast.error {
    border-left: 4px solid #e74c3c;
}

.toast.info {
    border-left: 4px solid #0984e3;
}

.toast i {
    font-size: 1.2rem;
}

.toast.success i {
    color: #00b894;
}

.toast.error i {
    color: #e74c3c;
}

.toast.info i {
    color: #0984e3;
}

.toast span {
    color: #312c7d !important;
}