﻿body {
    font-family: "Vazirmatn", sans-serif;
    background: linear-gradient(135deg, #dfe9f3, #ffffff);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    transition: background 0.5s ease, color 0.5s ease;
}

    body.dark {
        background: linear-gradient(135deg, #1e1e2f, #2c2c3e);
        color: #eee;
    }

.card {
    background: #fff;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    position: relative;
    width: 90%;
    max-width: 400px;
    text-align: center;
    animation: fadeIn 0.8s ease;
    transition: background 0.5s ease, color 0.5s ease;
}

body.dark .card {
    background: #2a2a3b;
    color: #eee;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

h2 {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-top: 10px;
    text-align: right;
    font-weight: 500;
}

select, input, button.calc-btn, button.work-btn, button.back-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-size: 16px;
    margin-bottom: 15px;
    outline: none;
    transition: all 0.3s ease;
}

input {
    width: 70%;
    padding: 8px;
    margin-top: 5px;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-size: 15px;
    text-align: center;
    background: #fff;
}

body.dark input {
    background: #3b3b4f;
    border: 1px solid #666;
    color: #fff;
}

select {
    border: 1px solid #ccc;
    background: #fff;
}

body.dark select {
    background: #3b3b4f;
    border: 1px solid #666;
    color: #fff;
}

select:focus, input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 6px rgba(74,144,226,0.5);
}

button.calc-btn, button.work-btn {
    border: none;
    background: linear-gradient(135deg, #4a90e2, #357ABD);
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.3s ease;
}

    button.calc-btn:hover, button.work-btn:hover {
        transform: scale(1.05);
        background: linear-gradient(135deg, #5aa0f2, #3f6db8);
    }

button.back-btn {
    border: none;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.3s ease;
}

    button.back-btn:hover {
        transform: scale(1.05);
        background: linear-gradient(135deg, #f15a4a, #d14d3e);
    }

#result {
    margin-top: 15px;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.6;
}

.toggle-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    border: none;
    background: #444;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.3s ease;
    width: auto;
}

    .toggle-btn:hover {
        background: #666;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.back-btn-small {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #ff3333; /* پس‌زمینه قرمز */
    border: none;
    color: white;
    font-size: 24px; /* فلش بزرگ‌تر */
    cursor: pointer;
    padding: 8px 12px; /* پدینگ بیشتر برای ظاهر بهتر */
    border-radius: 50%; /* دکمه دایره‌ای */
    transition: background-color 0.3s, transform 0.2s;
}

.back-btn-small:hover {
    background-color: #cc0000; /* قرمز تیره‌تر در hover */
    transform: scale(1.1); /* بزرگ‌تر شدن در hover */
}

body.dark .back-btn-small {
    background-color: #ff4d4d; /* قرمز روشن‌تر در تم تیره */
}

body.dark .back-btn-small:hover {
    background-color: #ff1a1a; /* قرمز تیره‌تر در تم تیره */
}
