﻿/* ===== VARIABLES ===== */
:root {
    /* Colors */
    --primary-color: #764ba2;
    --primary-dark: #5a2d8a;
    --secondary-color: #4dabf7;
    --accent-color: aqua;
    --text-primary: blue;
    --text-secondary: #2c3e50;
    --danger-color: #ff4444;
    --light-bg: #f8f9fa;
    --border-color: #e9ecef;
    --card-bg: #ffffff;
    /* Shadows */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 5px 15px rgba(0, 0, 0, 0.2);
    --shadow-card-hover: 0 10px 30px rgba(0, 0, 0, 0.1);
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    /* Transitions */
    --transition: all 0.3s ease;
    /* Spacing */
    --spacing-xs: 5px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;
    --spacing-xxl: 40px;
}

/* ===== FONTS ===== */
@font-face {
    font-family: 'Vazir';
    src: url('/fonts/Vazir.woff2') format('woff2'), url('/fonts/Vazir.woff') format('woff');
    font-display: swap;
}

/* ===== BASE STYLES ===== */
html {
    position: relative;
    min-height: 100%;
    font-size: 14px;
}

body {
    margin-bottom: 60px;
    background-size: cover;
    justify-content: center;
    align-items: center;
    direction: rtl;
    text-align: right;
    font-family: 'Vazir', 'B Nazanin', sans-serif;
    line-height: 1.6;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

/* ===== FORM CONTROLS ===== */
.form-control,
.form-select {
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    transition: var(--transition);
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: right;
    font-family: inherit;
}

    .form-control:focus,
    .form-select:focus,
    .btn:focus,
    .btn:active:focus,
    .btn-link.nav-link:focus,
    .form-control:focus,
    .form-check-input:focus {
        border-color: var(--secondary-color);
        box-shadow: 0 0 0 0.3rem rgba(77, 171, 247, 0.15);
        transform: translateY(-2px);
        outline: none;
    }

.form-label {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-bottom: 1rem;
}

    .form-group label {
        display: block;
    }

/* ===== BUTTONS ===== */
.btn {
    border-radius: var(--radius-md);
    transition: var(--transition);
    padding: var(--spacing-sm) var(--spacing-xl);
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

    .btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-hover);
        background-color: var(--accent-color);
    }

.btn-login {
    background: var(--primary-color);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

    .btn-login:hover {
        background: var(--primary-dark);
    }

/* ===== NAVIGATION & NAVBAR ===== */
.nav-item {
    border-radius: var(--radius-sm);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

    .nav-item:hover {
        background: rgba(0, 0, 0, 0.05);
    }

.navbar-nav .active {
    border-right: 3px solid #0d6efd;
    background: rgba(0, 0, 0, 0.05);
    border-left: none !important;
}

/* ===== CARDS ===== */
.card {
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    border: none;
    background-color: var(--card-bg);
}

.card-header {
    background-color: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    border-radius: 0 !important;
    padding: 1rem 1.25rem;
}

.child-card {
    transition: var(--transition);
    border: 1px solid #e3f2fd !important;
    padding: 1.5rem;
}

    .child-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-card-hover);
    }

/* ===== TABLES ===== */
table {
    text-align: center;
    margin: 20px;
    width: auto;
    justify-self: center;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border-collapse: collapse;
    overflow: hidden;
}

/* ===== LOGIN PAGE ===== */
.login-container {
    justify-self: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xxl);
    box-shadow: var(--shadow-lg);
    width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.login-header {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: var(--spacing-xl);
    font-size: 24px;
    font-weight: bold;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* ===== INPUT FIELDS ===== */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"] {
    background: rgba(0, 0, 0, 0.1);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 16px;
    border-top: 3px solid rgba(255, 255, 255, 0.1);
    border-right: 3px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid rgba(255, 255, 255, 0.1);
    border-bottom: 3px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

/* ===== VALIDATION & MESSAGES ===== */
.text-danger {
    color: var(--danger-color);
    font-size: 14px;
    margin-top: 5px;
    display: block;
}

.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
}

.badge {
    border-radius: var(--radius-sm);
    padding: 0.5em 0.75em;
}

/* ===== UTILITY CLASSES ===== */
.bg-light-subtle {
    background-color: var(--light-bg) !important;
}

.rounded-4 {
    border-radius: 1rem !important;
}

.rounded-3 {
    border-radius: 0.75rem !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

/* ===== ANIMATIONS ===== */
.header-icon {
    animation: headerBounce 2s infinite;
}

@keyframes headerBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet and Desktop */
@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .card-body {
        padding: 2rem !important;
    }

    .btn-lg {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .child-card {
        padding: 2rem !important;
    }

    .header-icon {
        animation: none;
    }

    .login-container {
        width: 90%;
        padding: var(--spacing-xl) var(--spacing-lg);
    }

    table {
        margin: 10px;
        font-size: 0.9rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .login-container {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .card-body,
    .child-card {
        padding: 1.5rem !important;
    }
}
/* ===== LAYOUT FIXES ===== */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-bottom: 0;
    padding-top: 80px; /* اضافه کردن padding برای هدر ثابت */
}

.container {
    flex: 1;
    padding-bottom: 2rem; /* فضای اضافه در پایین */
}

.footer {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    margin-top: auto;
    position: relative;
    bottom: 0;
    width: 100%;
}

/* برای موبایل */
@media (max-width: 768px) {
    body {
        padding-top: 70px; /* padding کمتر برای موبایل */
    }
}