/* php_app/frontend/css/style.css */

/* Import Vazirmatn Font */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100..900&display=swap');

:root {
    --primary: #00C2D1;
    --secondary: #0D2B38;
    --tertiary: #FFB300;
    --alternate: #E6F9FA;
    --primary-text: #0D2B38;
    --secondary-text: #5A6E7A;
    --primary-bg: #E6F9FA;
    --secondary-bg: #F0F4F8;
    --success: #34C759;
    --warning: #FF9500;
    --error: #FF3B30;
    --font-family: 'Vazirmatn', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--secondary-bg);
    color: var(--primary-text);
    margin: 0;
    padding: 0;
    direction: rtl;
    /* Default for Persian apps */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    margin: 0;
    padding: 0;
    background-color: var(--background);
}

/* Responsive Container */
.container {
    padding: 20px;
    max-width: 100%;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #00A0AC;
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 1rem;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
    text-align: right;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--secondary-text);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

/* Legacy input-group cleanup (optional, keeping for compatibility if utilized) */
.input-group {
    margin-bottom: 15px;
    text-align: right;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--secondary-text);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 1rem;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Layout Utilities */
/* The original .container rule is now superseded by the responsive one above, but keeping it for context if needed elsewhere. */
/* The instruction implies the responsive container should be the primary definition. */
/* Original .container definition:
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
*/

/* Responsive Flex */
.flex {
    display: flex;
    gap: 10px;
}

@media (max-width: 600px) {
    .flex {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Table Responsive */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    min-width: 600px;
    /* Ensure table doesn't squash too much */
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

/* Login Page Specific */
.login-page {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--secondary-bg) 0%, #dbe9f6 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--primary);
}

.login-header h2 {
    color: var(--secondary);
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.login-header p {
    color: var(--secondary-text);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.login-footer {
    margin-top: 25px;
    font-size: 0.85rem;
}

.login-footer a {
    color: var(--secondary-text);
    text-decoration: none;
    transition: color 0.2s;
}

.login-footer a:hover {
    color: var(--primary);
}

.error-msg {
    background-color: #ffebee;
    color: var(--error);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 15px;
    display: none;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 16px;
    color: var(--primary);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-text);
    margin-bottom: 8px;
}

.stat-label {
    color: var(--secondary-text);
    font-size: 14px;
}

/* Sidebar Premium Design */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--secondary) 0%, #081d26 100%);
    color: white;
    padding: 25px 20px;
    height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1001;
}

.sidebar h2 {
    background: transparent;
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.sidebar nav {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s;
    font-size: 0.95rem;
    font-weight: 400;
}

.menu-item:hover,
.menu-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(-5px);
}

.menu-item.active {
    background: linear-gradient(90deg, var(--primary) 0%, rgba(0, 194, 209, 0.5) 100%);
    box-shadow: 0 4px 15px rgba(0, 194, 209, 0.3);
    font-weight: 500;
}

.menu-item .material-icons {
    margin-left: 12px;
    font-size: 20px;
    opacity: 0.9;
}

.main-content {
    margin-right: 280px;
    padding: 20px;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
        z-index: 1000;
    }

    .active-sidebar .sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}