/* style.css - استایل‌های اصلی سایت */

/* استایل‌های عمومی */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Vazirmatn', sans-serif;
    background-color: #e7fcff;
    overflow-x: hidden;
}

/* انیمیشن‌ها */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 1.2s ease forwards;
}

.fade-in-delay {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 1.2s ease forwards;
    animation-delay: .4s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: none;
    }
}

/* بخش بالایی */
.top-section {
    background: linear-gradient(135deg, #00a1b5 0%, #00c7df 100%);
    color: white;
    text-align: center;
    padding: 10px 10px 20px;
    position: relative;
    min-height: 180px;
}

.top-section h1 {
    margin: 10px 0 5px 0;
    font-size: 28px;
    font-weight: 700;
}

/* لینک‌های ادمین */
.admin-links {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 8px;
}

.admin-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* دکمه اصلی */
.main-calc-button {
    margin: 15px auto;
    text-align: center;
    position: relative;
    display: inline-block;
    width: auto;
}

.main-calc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 35px;
    background: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 20px;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
    border: none;
    cursor: pointer;
}

.main-calc-btn:hover {
    background: linear-gradient(135deg, #ff9800 0%, #ffcc80 100%);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 152, 0, 0.4);
}

/* دکمه بروزرسانی تاریخ */
.refresh-date-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid white;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
    vertical-align: middle;
}

.refresh-date-btn:hover {
    background: white;
    color: #ff9800;
    transform: rotate(180deg);
}

.date-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* بخش ماشین حساب */
.calculator-section {
    max-width: 900px;
    margin: 25px auto;
    padding: 25px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.calculator-section h2 {
    color: #003b55;
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
}

/* فرم */
#insuranceForm {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

#insuranceForm label {
    font-weight: 600;
    color: #00486e;
    margin-bottom: 6px;
    font-size: 14px;
}

#insuranceForm label.required::after {
    content: " *";
    color: #f44336;
    font-size: 16px;
}

#insuranceForm input,
#insuranceForm select {
    padding: 10px 12px;
    border: 2px solid #b8f2ff;
    border-radius: 8px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 15px;
    background: white;
    width: 100%;
}

#insuranceForm input:focus,
#insuranceForm select:focus {
    border-color: #00a1b5;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 161, 181, 0.1);
}

#insuranceForm input.error {
    border-color: #f44336;
    background-color: #ffebee;
}

/* انتخاب تخفیف */
.discount-select {
    padding: 10px 12px;
    border: 2px solid #b8f2ff;
    border-radius: 8px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 15px;
    background: white;
    width: 100%;
    box-sizing: border-box;
}

/* گروه مبلغ بیمه */
.insurance-amount-group {
    position: relative;
}

.insurance-amount-info {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #f0f9ff;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    color: #0077b6;
    border: 1px solid #b8f2ff;
}

/* دکمه محاسبه */
.calc-button {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 15px;
}

.calc-button button {
    background: linear-gradient(135deg, #00a1b5 0%, #00c7df 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Vazirmatn', sans-serif;
    box-shadow: 0 4px 15px rgba(0, 161, 181, 0.3);
}

.calc-button button:hover {
    background: linear-gradient(135deg, #00c7df 0%, #00e5ff 100%);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 199, 223, 0.4);
}

/* بخش نتیجه */
#result {
    display: none;
    margin-top: 30px;
    background: linear-gradient(135deg, #f8fdff 0%, #ffffff 100%);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #00a1b5;
}

#result h3 {
    color: #003b55;
    text-align: center;
    margin-bottom: 25px;
    font-size: 22px;
    border-bottom: 2px dashed #00a1b5;
    padding-bottom: 10px;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

/* باکس‌های نتیجه */
.result-box-white {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #00a1b5;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 10px;
}

.result-box-red {
    background: linear-gradient(135deg, #f44336 0%, #ef5350 100%);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #d32f2f;
    text-align: center;
    color: white;
    box-shadow: 0 4px 10px rgba(244, 67, 54, 0.3);
}

.result-box-green {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #388E3C;
    text-align: center;
    color: white;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

.result-box-yellow {
    background: linear-gradient(135deg, #FFC107 0%, #FFD54F 100%);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #FFA000;
    text-align: center;
    color: #333;
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.3);
}

.result-box-light-yellow {
    background: linear-gradient(135deg, #FFF9C4 0%, #FFFDE7 100%);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #FFD54F;
    text-align: center;
    color: #333;
    box-shadow: 0 4px 10px rgba(255, 213, 79, 0.3);
}

.result-label {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
    display: block;
}

.result-box-white .result-label {
    color: #00486e;
}

.result-box-red .result-label,
.result-box-green .result-label {
    color: white;
}

.result-box-yellow .result-label,
.result-box-light-yellow .result-label {
    color: #333;
}

.result-value {
    font-size: 28px;
    font-weight: 800;
    direction: ltr;
    text-align: center;
    letter-spacing: 1px;
    display: block;
    margin-top: 5px;
}

.result-box-white .result-value {
    color: #003b55;
    font-size: 32px;
}

.result-box-red .result-value,
.result-box-green .result-value {
    color: white;
    font-size: 26px;
}

.result-box-yellow .result-value {
    color: #333;
    font-size: 24px;
}

.result-box-light-yellow .result-value {
    color: #333;
    font-size: 22px;
}

/* توضیحات نتیجه */
.result-note {
    text-align: center;
    font-size: 13px;
    color: #666;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ccc;
    font-style: italic;
}

/* اطلاعات انتخاب شده */
.selected-info {
    background: #f8fdff;
    padding: 15px;
    border-radius: 10px;
    margin-top: 30px;
    border: 2px solid #b8f2ff;
}

.selected-info h4 {
    color: #003b55;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    text-align: center;
    border-bottom: 2px solid #00a1b5;
    padding-bottom: 8px;
}

.selected-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.selected-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid #e0f7fa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.selected-item strong {
    color: #00486e;
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
}

.selected-value {
    font-weight: 600;
    font-size: 15px;
}

/* کلاس‌های تخفیف */
.discount-positive {
    color: #388E3C;
    background-color: #E8F5E9;
    padding: 2px 8px;
    border-radius: 4px;
    border-right: 3px solid #4CAF50;
}

.discount-negative {
    color: #D32F2F;
    background-color: #FFEBEE;
    padding: 2px 8px;
    border-radius: 4px;
    border-right: 3px solid #F44336;
}

.discount-neutral {
    color: #666;
    padding: 2px 8px;
    border-radius: 4px;
}

/* سابقه خسارت */
.damage-history {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ccc;
}

.damage-item {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    background: #f8f9fa;
}

.damage-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.damage-value {
    font-weight: 700;
    font-size: 14px;
}

.no-damage {
    color: #388E3C;
    background-color: #E8F5E9;
}

.has-damage {
    color: #D32F2F;
    background-color: #FFEBEE;
}

/* پیام خطا */
.error-message {
    color: #f44336;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

/* اطلاعات جریمه */
.penalty-discount-info {
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    margin-top: 5px;
    border-top: 1px dashed rgba(255,255,255,0.3);
    padding-top: 5px;
}

/* کانتینر تاریخ */
.date-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-input-container input {
    flex: 1;
}

.date-input-container button {
    padding: 10px 15px;
    background: #00a1b5;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.3s;
}

.date-input-container button:hover {
    background: #008c9e;
    transform: translateY(-2px);
}

/* رسپانسیو */
@media(max-width: 768px){
    .top-section { 
        padding: 25px 10px 15px; 
        min-height: 150px;
    }
    .top-section h1 { 
        font-size: 22px; 
    }
    .admin-links { 
        position: static; 
        justify-content: center; 
        margin-bottom: 10px; 
    }
    .calculator-section { 
        margin: 15px 10px; 
        padding: 20px; 
    }
    #insuranceForm { 
        grid-template-columns: 1fr; 
    }
    .damage-history {
        flex-direction: column;
    }
    .date-container {
        flex-direction: column;
    }
    .refresh-date-btn {
        margin-right: 0;
        margin-top: 10px;
    }
}

@media(max-width: 480px){
    .top-section h1 { 
        font-size: 20px; 
    }
    .calculator-section h2 { 
        font-size: 18px; 
    }
    
    .result-value {
        font-size: 20px;
    }
    
    .result-box-white .result-value {
        font-size: 24px;
    }
}

/* استایل برای موبایل */
@media(max-width: 360px){
    .main-calc-btn {
        font-size: 16px;
        padding: 10px 20px;
    }
    
    .date-input-container {
        flex-direction: column;
    }
    
    .date-input-container button {
        width: 100%;
    }
}

/* استایل برای چاپ */
@media print {
    .top-section,
    .admin-links,
    .calc-button,
    .refresh-date-btn {
        display: none;
    }
    
    .calculator-section {
        box-shadow: none;
        margin: 0;
        padding: 10px;
    }
    
    #result {
        border: 1px solid #ccc;
    }
}