/* * Main Stylesheet for Remote Work Platform
 * Design System: Glassmorphism / Dark Modern
 */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;700&display=swap');

:root {
    /* --- پالت رنگی (Color Palette) --- */
    --primary: #6366f1;       /* رنگ اصلی (بنفش مایل به آبی) */
    --primary-hover: #4f46e5;
    --secondary: #64748b;     /* رنگ فرعی (خاکستری) */
    --success: #10b981;       /* سبز (برای دکمه شروع و وضعیت‌ها) */
    --danger: #ef4444;        /* قرمز (برای دکمه پایان و حذف) */
    --warning: #f59e0b;       /* نارنجی */
    
    /* --- رنگ‌های متن --- */
    --text-main: #ffffff;
    --text-muted: #cbd5e1;
    --text-dark: #1e293b;

    /* --- متغیرهای شیشه‌ای (Glass Effect) --- */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-bg-hover: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --blur-amount: 12px;

    /* --- پس‌زمینه کلی --- */
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
}

/* --- تنظیمات پایه (Reset & Base) --- */
* {
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Vazirmatn', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    direction: rtl;
}

/* اسکرول‌بار سفارشی */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.02); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

/* --- کامپوننت‌های شیشه‌ای (Glass Components) --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
}

.glass-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.2s ease, background 0.2s;
}

.glass-header {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* --- کانتینر اصلی --- */
.app-container {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    position: relative;
    overflow: hidden;
}

/* --- صفحه ورود (Login Styles) --- */
#login-view {
    width: 90%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
}

.login-header h1 { font-size: 1.5rem; margin-bottom: 5px; }
.login-header p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 30px; }

.logo-circle {
    width: 80px; height: 80px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem; color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* --- فرم‌ها --- */
.input-group { position: relative; margin-bottom: 20px; }
.input-group i { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.input-group input, .input-group textarea {
    width: 100%; padding: 12px 45px 12px 15px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px; color: white; font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus, .input-group textarea:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}
.input-group input:focus + i { color: var(--primary); }

/* --- دکمه‌ها --- */
.btn {
    cursor: pointer; border: none; border-radius: 12px;
    padding: 12px 24px; font-size: 1rem; font-weight: bold;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.2s ease;
}
.btn:active { transform: scale(0.96); }
.btn-block { width: 100%; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-secondary { background: var(--secondary); color: white; }

.btn-icon {
    background: rgba(255,255,255,0.1); border: none; color: white;
    width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; transition: 0.2s;
}
.btn-icon:hover { background: rgba(255,255,255,0.2); }

/* --- داشبورد --- */
.dashboard-container { height: 100%; display: flex; flex-direction: column; }
.dashboard-content { flex: 1; overflow-y: auto; padding: 20px; padding-bottom: 80px; }

.user-info { display: flex; align-items: center; gap: 15px; }
.user-info h3 { margin: 0; font-size: 1rem; }
.avatar-sm {
    width: 45px; height: 45px; border-radius: 50%;
    border: 2px solid var(--primary); object-fit: cover;
    background: white; /* برای آیکون‌های شفاف */
}
.date-badge {
    font-size: 0.8rem; background: rgba(255,255,255,0.1);
    padding: 2px 8px; border-radius: 6px; color: var(--text-muted);
}

/* --- تایمر --- */
.timer-card {
    text-align: center; padding: 30px;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
}
.timer-display {
    font-size: 3.5rem; font-weight: 700; font-family: monospace;
    margin: 20px 0; color: var(--text-main);
    text-shadow: 0 0 20px rgba(255,255,255,0.2);
}
.status-indicator {
    display: inline-block; padding: 5px 15px; border-radius: 20px;
    font-size: 0.9rem; background: rgba(255,255,255,0.1);
}

.clock-btn {
    width: 160px; height: 160px; border-radius: 50%;
    border: 5px solid rgba(255,255,255,0.1);
    background: var(--success); color: white;
    font-size: 1.2rem; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; margin: 0 auto; transition: all 0.3s ease;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}
.clock-btn i { font-size: 2.5rem; }
.clock-btn:hover { transform: scale(1.05); }
.clock-btn.end-mode {
    background: var(--danger);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

/* --- جدول‌ها --- */
.table-responsive { overflow-x: auto; }
.modern-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.modern-table th {
    text-align: right; padding: 15px; color: var(--text-muted);
    font-weight: normal; border-bottom: 1px solid var(--glass-border);
}
.modern-table td { padding: 15px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.modern-table tr:last-child td { border-bottom: none; }
.modern-table tr:hover { background: rgba(255,255,255,0.03); }

/* --- گزارش ماهانه آکاردئونی (Accordion) --- */
.accordion-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
}

.accordion-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.2s;
}
.accordion-header:hover { background: rgba(255, 255, 255, 0.06); }

.accordion-title { display: flex; align-items: center; gap: 10px; font-weight: bold; color: var(--text-main); }
.accordion-meta { display: flex; align-items: center; gap: 15px; }

.total-hours-badge {
    background: rgba(99, 102, 241, 0.2); color: #a5b4fc;
    padding: 4px 12px; border-radius: 20px; font-size: 0.85rem;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.accordion-icon {
    transition: transform 0.3s ease; font-size: 0.9rem; color: var(--text-muted);
}
.accordion-item.active .accordion-icon { transform: rotate(180deg); }

.accordion-body {
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.2);
}
.accordion-content { padding: 15px; }

.log-item {
    display: flex; justify-content: space-between;
    padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.9rem;
}
.log-item:last-child { border-bottom: none; }

/* --- پنل ادمین --- */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px; margin-bottom: 30px;
}
.stat-card {
    background: rgba(255,255,255,0.05); border-radius: 16px; padding: 20px;
    display: flex; align-items: center; gap: 20px;
}
.stat-card i {
    font-size: 2rem; padding: 15px; border-radius: 12px;
    background: rgba(255,255,255,0.1); color: var(--primary);
}
.stat-card span { display: block; font-size: 1.5rem; font-weight: bold; }
.active-stat i { color: var(--success); }

/* --- مودال‌ها --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); z-index: 100;
    display: flex; justify-content: center; align-items: center;
    padding: 20px; backdrop-filter: blur(5px);
}
.modal-glass {
    background: #1e293b; border: 1px solid var(--glass-border);
    width: 100%; max-width: 500px; border-radius: 20px;
    overflow: hidden; animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-header { padding: 20px; background: rgba(0,0,0,0.2); border-bottom: 1px solid var(--glass-border); }
.modal-header h3 { margin: 0; color: var(--text-main); }
.modal-body { padding: 20px; }
.modal-body textarea {
    background: rgba(255,255,255,0.05); color: white; border: 1px solid var(--glass-border);
}
.modal-footer {
    padding: 15px 20px; display: flex; justify-content: flex-end; gap: 10px; background: rgba(0,0,0,0.2);
}

@keyframes modalPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.hidden { display: none !important; }

/* استایل برای وضعیت آنلاین کاربران (نقطه سبز) */
.user-name-wrapper { display: flex; align-items: center; gap: 10px; }
.status-dot {
    width: 10px; height: 10px; border-radius: 50%;
    display: inline-block; flex-shrink: 0;
}
.status-dot.online {
    background-color: var(--success);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    animation: pulse-green 2s infinite;
}
.status-dot.offline {
    background-color: var(--secondary); opacity: 0.6;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}