/* =========================================================
   MODULE: style.css
   DESCRIPTION: استایل اصلی پروژه فیش حقوق اینترنتی
   ========================================================= */

/* ---------- تنظیمات پایه ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1e3c72;
    --primary-dark: #162d57;
    --secondary-color: #2a5298;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    --bg-light: #f0f2f5;
    --bg-white: #ffffff;
    --border-color: #d0d7de;
    --text-dark: #2c3e50;
    --text-muted: #7f8c8d;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 6px 18px rgba(0, 0, 0, 0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

html, body {
    font-family: 'B Nazanin', 'Tahoma', 'Segoe UI', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.7;
    font-size: 15px;
    min-height: 100vh;
}

/* ---------- چیدمان کلی ---------- */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- هدر ---------- */
.main-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 14px 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.header-title {
    font-size: 18px;
    font-weight: bold;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.user-name {
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
}

.user-cod {
    font-size: 13px;
    opacity: 0.9;
}

.btn-logout {
    color: white;
    background: var(--danger-color);
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* ---------- محتوای اصلی ---------- */
.main-content {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ---------- فوتر ---------- */
.main-footer {
    background: var(--primary-dark);
    color: white;
    padding: 12px 0;
    text-align: center;
    font-size: 13px;
}

/* ---------- پیام‌های Flash ---------- */
.flash-messages {
    margin-bottom: 20px;
}

.flash {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    font-weight: bold;
    border-right: 4px solid;
    animation: slideIn 0.3s ease;
}

.flash-success {
    background: #d4edda;
    color: #155724;
    border-color: var(--success-color);
}

.flash-danger {
    background: #f8d7da;
    color: #721c24;
    border-color: var(--danger-color);
}

.flash-warning {
    background: #fff3cd;
    color: #856404;
    border-color: var(--warning-color);
}

.flash-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: var(--info-color);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- فرم ورود ---------- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 20px;
}

.login-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 460px;
    overflow: hidden;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 24px 20px;
    text-align: center;
}

.login-header h1 {
    font-size: 22px;
    margin-bottom: 6px;
}

.login-header p {
    font-size: 14px;
    opacity: 0.9;
}

.login-form {
    padding: 24px 26px;
}

.login-footer {
    background: #f8f9fa;
    padding: 12px 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

/* ---------- گروه فرم ---------- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    font-size: 14px;
    color: var(--text-dark);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    background: var(--bg-white);
    transition: all 0.2s;
    direction: rtl;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.12);
}

.form-group input::placeholder {
    color: #b0b8c1;
    font-size: 13px;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ---------- دکمه چشم (نمایش رمز) ---------- */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-left: 46px;
}

.btn-eye {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    color: var(--text-dark);
}

.btn-eye:hover {
    background: #eef2f7;
}

/* ---------- دکمه‌ها ---------- */
.btn {
    display: inline-block;
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #7f8c8d;
    color: white;
}

.btn-secondary:hover {
    background: #5f6b6c;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #1e8449;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #d68910;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #2471a3;
}

.btn-block {
    display: block;
    width: 100%;
    margin-bottom: 10px;
}

.form-actions {
    margin-top: 20px;
}

/* ---------- داشبورد ---------- */
.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.welcome-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 22px 26px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.welcome-card h2 {
    font-size: 20px;
    margin-bottom: 6px;
}

.welcome-cod {
    font-size: 14px;
    opacity: 0.95;
}

.welcome-cod strong {
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    margin-right: 6px;
}

/* ---------- جعبه‌ها ---------- */
.box {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 22px 24px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.box:hover {
    box-shadow: var(--shadow-md);
}

.box-title {
    font-size: 17px;
    margin-bottom: 16px;
    color: var(--primary-color);
    padding-bottom: 10px;
    border-bottom: 2px solid #eef2f7;
}

.change-password-box {
    border-right: 4px solid var(--warning-color);
}

.fish-box {
    border-right: 4px solid var(--info-color);
}

/* ---------- فرم ردیفی ---------- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ---------- دکمه‌های فیش ---------- */
.fish-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.fish-actions .btn {
    flex: 1;
    min-width: 180px;
}

/* ---------- حالت خالی ---------- */
.empty-state {
    text-align: center;
    padding: 30px 20px;
    background: #fff8e1;
    border-radius: var(--radius-md);
    color: #856404;
}

.empty-state p {
    margin-bottom: 8px;
    font-size: 15px;
}

/* ---------- واکنش‌گرایی ---------- */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-user {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-content {
        padding: 20px 12px;
    }

    .login-card {
        max-width: 100%;
    }

    .box {
        padding: 16px;
    }
}

/* =========================================================
   کشو (Accordion) برای بخش تغییر رمز عبور
   ========================================================= */
.accordion-box {
    padding: 0;
    overflow: hidden;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    background: var(--bg-white);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    border-right: 4px solid var(--warning-color);
}

.accordion-header:hover {
    background: #fdf6e8;
}

.accordion-title {
    font-size: 17px;
    font-weight: bold;
    color: var(--primary-color);
}

.accordion-icon {
    font-size: 14px;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 22px;
}

.accordion-content.active {
    max-height: 3000px;
    padding: 10px 22px 22px 22px;
    border-top: 1px solid var(--border-color);
}