﻿/* Main Styles for Educational Management System */

/* RTL Support & Font */
body {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

.bounce-in {
    animation: bounceIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* Progress Bars */
.progress-bar {
    transition: width 0.8s ease-in-out;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dasharray 0.8s ease-in-out;
}

/* Status Indicators */
.status-pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #f59e0b;
}

.status-approved {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #10b981;
}

.status-rejected {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #ef4444;
}

.status-in-progress {
    background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
    color: #713f12;
    border: 1px solid #ca8a04;
}

.status-completed {
    background: linear-gradient(135deg, #fef9c3 0%, #fde047 100%);
    color: #713f12;
    border: 1px solid #eab308;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
}

.card-gradient {
    background: linear-gradient(135deg, #ca8a04 0%, #eab308 100%);
    color: white;
}

/* Button Styles */
.btn {
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #ca8a04 0%, #a16207 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #a16207 0%, #713f12 100%);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Timeline Styles */
.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
}

.timeline-item {
    position: relative;
    padding-right: 50px;
    margin-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: 11px;
    top: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e5e7eb;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #e5e7eb;
}

.timeline-item.completed::before {
    background: #10b981;
    box-shadow: 0 0 0 3px #10b981;
}

.timeline-item.in-progress::before {
    background: #eab308;
    box-shadow: 0 0 0 3px #eab308;
}

.timeline-item.rejected::before {
    background: #ef4444;
    box-shadow: 0 0 0 3px #ef4444;
}

/* Dashboard Cards */
.dashboard-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-right: 4px solid;
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.dashboard-card.blue {
    border-right-color: #ca8a04;
}

.dashboard-card.green {
    border-right-color: #10b981;
}

.dashboard-card.lime {
    border-right-color: #f59e0b;
}

.dashboard-card.red {
    border-right-color: #ef4444;
}

.dashboard-card.lime {
    border-right-color: #eab308;
}

/* Modal Styles */
.modal-backdrop {
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.5);
}

.modal {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 1.125rem; /* text-lg equivalent - 18px */
}

.form-control:focus {
    outline: none;
    border-color: #ca8a04;
    box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.15);
}

.form-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-success {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    animation: notificationSlide 0.3s ease-out;
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
}

.notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.notification.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.notification.info {
    background: linear-gradient(135deg, #ca8a04 0%, #a16207 100%);
}

@keyframes notificationSlide {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid #374151;
    border-top: 3px solid #ca8a04;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .dashboard-card {
        padding: 16px;
    }
    
    .timeline-item {
        padding-right: 40px;
    }
    
    .modal {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

/* PWA Specific Styles */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    header {
        padding-top: calc(env(safe-area-inset-top) + 1rem);
    }
    
    footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .dark-mode {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .dark-mode .card {
        background-color: #374151;
        border-color: #4b5563;
    }
    
    .dark-mode .form-control {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-before: always;
    }
    
    body {
        background: white !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #e5e7eb !important;
    }
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, #ca8a04 0%, #eab308 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.shadow-glow {
    box-shadow: 0 0 20px rgba(202, 138, 4, 0.3);
}

/* Messages Page Styles */
.conversation-item {
    transition: all 0.2s ease;
}

.conversation-item:hover {
    transform: translateX(-2px);
}

#messages-area {
    scroll-behavior: smooth;
}

#messages-area::-webkit-scrollbar {
    width: 6px;
}

#messages-area::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 10px;
}

#messages-area::-webkit-scrollbar-thumb {
    background: rgba(202, 138, 4, 0.5);
    border-radius: 10px;
}

#messages-area::-webkit-scrollbar-thumb:hover {
    background: rgba(202, 138, 4, 0.7);
}

/* Message animations */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-item {
    animation: messageSlideIn 0.3s ease-out;
}

/* Voice recording pulse animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Attachment preview */
#attachment-preview {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 100px;
        transform: translateY(0);
    }
}

/* Voice recording UI */
#voice-recording-ui {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Textarea auto-resize */
#message-input {
    transition: height 0.2s ease;
}

/* Online status indicator */
.online-indicator {
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Agent Tasks Styles */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Timer warning animation */
@keyframes pulse-warning {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.animate-pulse {
    animation: pulse-warning 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Task card hover effect */
.bg-slate-700:hover {
    transform: translateY(-2px);
}

/* ═══ jalalidatepicker — dark theme override (Work Hours page) ═══ */
/* فقط روی صفحه ساعات کاری که background تیره دارد اعمال می‌شود */
#workHoursForm input[data-jdp],
#deductionForm input[data-jdp],
#expenseForm input[data-jdp] {
    background: rgba(67, 141, 44, 0.1) !important;
    color: #1a0451 !important;
    border-color: rgba(84, 178, 66, 0.2) !important;
}

#workHoursForm input[data-jdp]::placeholder,
#deductionForm input[data-jdp]::placeholder,
#expenseForm input[data-jdp]::placeholder {
    color: rgba(37, 83, 135, 0.6) !important;
}

#workHoursForm input[data-jdp]:focus,
#deductionForm input[data-jdp]:focus,
#expenseForm input[data-jdp]:focus {
    border-color: #3d5d85 !important;
    outline: none !important;
}

/* تم تاریک برای popup تقویم — فقط وقتی از صفحه ساعات کاری باز شده */
body.jdp-dark-mode jdp-container {
    --jdp-color-0: #1e3a5f;
    --jdp-color-1: #162d4a;
    --jdp-color-2: #2d5080;
    --jdp-color-3: #4a7ab5;
    --jdp-color-4: #93c5fd;
    --jdp-color-5: #e2e8f0;
    --jdp-primary:  #3b82f6;
    --jdp-red:      #f87171;
    font-family: 'Vazirmatn', sans-serif !important;
    z-index: 99999 !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
}

/* همیشه z-index و font بالا باشه */
jdp-container {
    font-family: 'Vazirmatn', sans-serif !important;
    z-index: 99999 !important;
}

/* input تقویم در modal مدیر */
#mgr-ded-date-jdp {
    background: #51ac3d !important;
    color: #170362 !important;
    border-color: #42b954 !important;
    cursor: pointer;
}
