@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700;800;900&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --secondary: #f97316;
    --secondary-light: #fb923c;
    --secondary-dark: #ea580c;
    --danger: #ef4444;
    --success: #22c55e;
    --info: #06b6d4;
    --warning: #f59e0b;
    --border: #e5e7eb;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    background: #f8fafc;
    margin: 0;
    padding: 0;
    direction: rtl;
    min-height: 100vh;
    color: var(--text-dark);
    font-size: 16px;
    line-height: 1.6;
}

.container {
    background: var(--bg-white);
    max-width: 1100px;
    margin: 32px auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

h2 {
    font-size: 1.75rem;
    position: relative;
    padding-bottom: 0.75rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    height: 4px;
    width: 60px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 4px;
}

h3 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

label {
    color: var(--text-dark);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
    display: block;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    background: var(--bg-light);
    transition: var(--transition);
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    color: var(--text-dark);
}

input:focus, 
select:focus, 
textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Buttons */
.btn,
button {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn:hover,
button:hover {
    background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: linear-gradient(90deg, var(--secondary) 0%, var(--secondary-dark) 100%);
}

.btn-secondary:hover {
    background: linear-gradient(90deg, var(--secondary-dark) 0%, var(--secondary) 100%);
}

.btn-danger {
    background: linear-gradient(90deg, var(--danger) 0%, #dc2626 100%);
}

.btn-danger:hover {
    background: linear-gradient(90deg, #dc2626 0%, var(--danger) 100%);
}

.btn-success {
    background: linear-gradient(90deg, var(--success) 0%, #16a34a 100%);
}

.btn-success:hover {
    background: linear-gradient(90deg, #16a34a 0%, var(--success) 100%);
}

.status-result {
    margin-top: 24px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 18px 16px;
    color: #222;
    font-size: 1.05rem;
}

.status-result ul {
    list-style: none;
    padding: 0;
}

.status-result li {
    margin-bottom: 8px;
}

/* Tables */
.table-wrapper, table, th, td, tr, .dashboard, .dash-box, .crud-btns, .topbar { display: none !important; }

/* Dashboard */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.dash-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dash-box span {
    font-size: 1.75rem;
    font-weight: 700;
}

/* CRUD Buttons */
.crud-btns { 
    display: flex; 
    gap: 0.5rem; 
    justify-content: center; 
    flex-wrap: wrap;
}

.crud-btns button, 
.crud-btns a {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    text-align: center;
    min-width: 60px;
}

.crud-btns .edit { 
    background: var(--warning); 
    color: white; 
}

.crud-btns .delete { 
    background: var(--danger); 
    color: white; 
}

.crud-btns .save { 
    background: var(--success); 
    color: white; 
}

/* Top Bar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.topbar .user {
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar .user i {
    font-size: 1.25rem;
}

/* Responsiveness */
@media (max-width: 1024px) {
    .container {
        max-width: 96%;
        padding: 1.5rem;
    }
    
    .dash-box {
        padding: 1.25rem;
    }
    
    .dash-box span {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    .container {
        margin: 16px auto;
        padding: 1.25rem;
        gap: 1.25rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .topbar .actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        padding: 1rem;
    }
    
    h2 {
        font-size: 1.35rem;
    }
    
    .dashboard {
        gap: 0.75rem;
    }
    
    .dash-box {
        padding: 1rem;
    }
    
    .dash-box span {
        font-size: 1.35rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .crud-btns button, 
    .crud-btns a {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
        min-width: 50px;
    }
    
    input[type="text"],
    input[type="date"],
    select,
    textarea {
        padding: 0.65rem 0.75rem;
    }
}

img {
    max-width: 100%;
    height: auto;
}

/* Notifications */
.notif {
    position: fixed;
    top: 20px;
    left: 20px;
    right: auto;
    background: white;
    color: var(--text-dark);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow);
    transform: translateX(-120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1000;
    max-width: 400px;
    border-right: 6px solid var(--primary);
    font-weight: 500;
    font-size: 0.95rem;
}
.notif.success { border-right-color: var(--success); }
.notif.error { border-right-color: var(--danger); }
.notif.show {
    transform: translateX(0);
    opacity: 1;
}

/* Utilities */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

/* Button Animation */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-anim 0.6s linear;
    z-index: 1;
}

@keyframes ripple-anim {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* استایل مدرن و ریسپانسیو */
.main-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 2rem 1rem;
}
.hero {
    text-align: center;
    margin-bottom: 2rem;
}
.hero h1 {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}
.form-section {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem 1.5rem;
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.modern-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.form-group label {
    font-weight: 500;
    color: var(--text-dark);
}
.form-group input,
.form-group select {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-light);
    font-size: 1rem;
    transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    background: var(--bg-white);
    outline: none;
}
.form-links {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}
@media (max-width: 600px) {
    .form-section {
        padding: 1.2rem 0.5rem;
        max-width: 100%;
    }
    .hero h1 {
        font-size: 1.3rem;
    }
    .main-wrapper {
        padding: 1rem 0.2rem;
    }
    .form-links {
        flex-direction: column;
        gap: 0.7rem;
    }
}

.min-vh-80 {
    min-height: 80vh;
}
.card {
    border-radius: 1.5rem !important;
}
footer {
    background: none;
}