:root {
    --brand-green: #006837;
    --nav-hover: #008a46;
    --accent-green: #10B981;
    --bg-page: #F3F4F6;
    --card-bg: #ffffff;
    --input-bg: #F9FAFB;
    --footer-bg: #006837;
    --text-main: #111827;
    --text-muted: #4B5563;
    --border-color: #D1D5DB;
    --premium-gold: #FFD700;
    --premium-orange: #FF8C00;
    --success-green: #10B981;
    --error-red: #EF4444;
}

body.dark-mode {
    --bg-page: #111827;
    --card-bg: #1F2937;
    --input-bg: #374151;
    --text-main: #ffffff;
    --text-muted: #9CA3AF;
    --border-color: #4B5563;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', 'Noto Kufi Arabic', sans-serif; }

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    user-select: none;
    -webkit-user-select: none;
}

/* --- Main Content --- */
.hero-section {
    background-color: var(--brand-green);
    color: white;
    text-align: center;
    padding: 3rem 1rem 6rem 1rem;
}

.main-container {
    max-width: 1100px;
    margin: -4rem auto 4rem auto;
    padding: 0 1.5rem;
    width: 100%;
}

.calc-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
}

@media (max-width: 850px) {
    .calc-grid { grid-template-columns: 1fr; }
}

.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
}

input, select {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.7rem;
    border-radius: 6px;
    outline: none;
}

.btn-primary {
    background-color: var(--accent-green);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    margin-top: 1rem;
}

.final-val {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-green);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid var(--success-green);
}

.toast.error {
    border-left: 4px solid var(--error-red);
}

.toast.info {
    border-left: 4px solid #3B82F6;
}

.toast i {
    font-size: 20px;
}

.toast.success i {
    color: var(--success-green);
}

.toast.error i {
    color: var(--error-red);
}

.toast.info i {
    color: #3B82F6;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-muted);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: var(--bg-page);
    color: var(--text-main);
}

.dark-mode .toast {
    background: var(--card-bg);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s;
}

.loading-overlay.show {
    display: flex;
    opacity: 1;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Guide / Info Sections */
.guide-container {
    max-width: 1100px;
    margin: 0 auto 3rem auto;
    padding: 0 1.5rem;
}

.guide-card-bottom {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.guide-card-bottom h1 {
    color: var(--brand-green);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 3px solid var(--accent-green);
    display: inline-block;
    padding-bottom: 5px;
}

.termination-type {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: 8px;
    background-color: var(--input-bg);
    border-left: 4px solid var(--brand-green);
}

.termination-type h3 {
    color: var(--brand-green);
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 700;
}

.termination-type ul {
    padding-left: 20px;
    list-style-type: disc;
}

.termination-type li {
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.highlight {
    color: var(--brand-green);
    font-weight: 700;
    background: #e6f4ea;
    padding: 2px 5px;
    border-radius: 4px;
}

body.dark-mode .highlight {
    background: #064e3b;
    color: #10B981;
}

.note-box {
    background-color: #fffbeb;
    border: 1px solid #fcd34d;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.note-box h2 {
    color: #92400e;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.note-box li {
    color: #92400e;
    list-style: none;
    margin-bottom: 5px;
    font-weight: 500;
}

@media (max-width: 600px) {
    .guide-card-bottom {
        padding: 1.5rem;
    }
    .guide-card-bottom h1 {
        font-size: 1.4rem;
    }
    
}