/* === تنظیمات پایه === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Tahoma, 'Segoe UI', Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === هدر با انیمیشن ورود === */
header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 2.5rem 1rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

header p {
    font-size: 1rem;
    opacity: 0.9;
}

/* === بدنه اصلی === */
main {
    max-width: 900px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 1.8rem;
    margin-bottom: 1.8rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 1.25rem;
    color: #1e3c72;
    margin-bottom: 1.2rem;
    border-bottom: 2px solid #eef2f5;
    padding-bottom: 0.6rem;
}

.sub-title {
    font-size: 1rem;
    margin-bottom: 0.6rem;
    color: #444;
}

/* === ورودی نام افراد === */
.grid-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.88rem;
    margin-bottom: 0.4rem;
    color: #555;
    font-weight: bold;
}

.input-group input[type="text"],
.input-group input[type="number"] {
    padding: 0.7rem 0.9rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    font-size: 0.95rem;
}

.input-group input:focus {
    border-color: #2a5298;
    box-shadow: 0 0 0 4px rgba(42, 82, 152, 0.15);
    transform: scale(1.01);
}

/* === کارت‌های هزینه === */
.bill-card {
    background: #fafbfc;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1.2rem;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.bill-card:hover {
    border-color: #2a5298;
    background-color: #ffffff;
}

.payer-selection {
    margin-top: 0.9rem;
}

.payer-selection p {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
}

.radio-group label {
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s ease;
}

.radio-group label:hover {
    color: #2a5298;
}

/* === دکمه محاسبه با افکت اکشن === */
.btn-calc {
    width: 100%;
    background: #27ae60;
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    margin-top: 1rem;
}

.btn-calc:hover {
    background: #219150;
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.35);
    transform: translateY(-2px);
}

.btn-calc:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.2);
}

/* === نتایج === */
.summary-box {
    display: flex;
    justify-content: space-around;
    background: #eef7ed;
    border: 1px solid #c3e6cb;
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    animation: zoomIn 0.5s ease-out;
}

.summary-item h3 {
    font-size: 0.9rem;
    color: #155724;
    margin-bottom: 0.4rem;
}

.summary-item p {
    font-size: 1.4rem;
    font-weight: bold;
    color: #27ae60;
}

.result-list {
    list-style: none;
}

.result-list li {
    padding: 0.85rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-list li:last-child {
    border-bottom: none;
}

.badge {
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.badge:hover {
    transform: scale(1.05);
}

.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-neutral { background: #e2e3e5; color: #383d41; }

.settlement-item {
    background: #fff3cd;
    border-right: 4px solid #ffc107;
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.6rem;
    border-radius: 6px;
    color: #856404;
    font-size: 0.95rem;
}

/* === تعریف انیمیشن‌ها (Keyframes) === */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInList {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* === فوتر === */
footer {
    background: #1e3c72;
    color: white;
    text-align: center;
    padding: 1.2rem;
    margin-top: auto;
    font-size: 0.88rem;
}
