@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;300;400;600;800&display=swap');

:root {
    /* Dark Theme (Default) */
    --bg-main: #0f172a;
    --bg-panel: #111827;
    --bg-card: #1f2937;
    --text-primary: #f8fafc;
    --text-secondary: #9ca3af;
    --border-color: #1f2937;
    --input-bg: #1e293b;
    --input-border: #334155;
    --glass-bg: rgba(30, 41, 59, 0.8);
    --glass-border: rgba(255,255,255,0.05);
    --bg-image: url('https://www.transparenttextures.com/patterns/dark-matter.png');
    --primary-gradient-start: #ca8a04;
    --primary-gradient-end: #eab308;
    --accent-color: #eab308;
}

body.light-theme {
    /* Light Theme */
    --bg-main: #f1f5f9;
    --bg-panel: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0,0,0,0.05);
    --bg-image: none;
}

/* Tailwind Overrides for Light Theme */
body.light-theme .bg-gray-900,
body.light-theme .bg-slate-900 { background-color: var(--bg-panel) !important; }
body.light-theme .bg-gray-900\/50 { background-color: rgba(255, 255, 255, 0.8) !important; }
body.light-theme .bg-gray-900\/40 { background-color: rgba(241, 245, 249, 0.8) !important; }

body.light-theme .bg-gray-800 { background-color: var(--bg-card) !important; }
body.light-theme .bg-gray-800\/50 { background-color: rgba(255, 255, 255, 0.5) !important; }
body.light-theme .bg-gray-800\/40 { background-color: rgba(248, 250, 252, 0.8) !important; }
body.light-theme .bg-gray-800\/80 { background-color: rgba(255, 255, 255, 0.9) !important; }

body.light-theme .bg-gray-700 { background-color: #e2e8f0 !important; }
body.light-theme .bg-gray-700\/30 { background-color: rgba(226, 232, 240, 0.5) !important; }
body.light-theme .bg-gray-700\/50 { background-color: rgba(226, 232, 240, 0.8) !important; }

/* Gradient Overrides */
body.light-theme .from-blue-900\/30 { --tw-gradient-from: rgba(59, 130, 246, 0.1) !important; }
body.light-theme .to-purple-900\/30 { --tw-gradient-to: rgba(147, 51, 234, 0.1) !important; }

body.light-theme .hover\:bg-gray-700:hover { background-color: #cbd5e1 !important; }
body.light-theme .hover\:bg-gray-800\/50:hover { background-color: rgba(203, 213, 225, 0.5) !important; }
body.light-theme .hover\:bg-gray-800\/40:hover { background-color: rgba(203, 213, 225, 0.4) !important; }

body.light-theme .text-white { color: var(--text-primary) !important; }
body.light-theme .text-gray-100 { color: #0f172a !important; }
body.light-theme .text-gray-200 { color: #1e293b !important; }
body.light-theme .text-gray-300 { color: #334155 !important; }
body.light-theme .text-gray-400 { color: var(--text-secondary) !important; }
body.light-theme .text-gray-500 { color: #64748b !important; }

body.light-theme .border-gray-800,
body.light-theme .border-gray-700 { border-color: var(--border-color) !important; }
body.light-theme .divide-gray-700 > * + * { border-color: var(--border-color) !important; }

body.light-theme .hover\:text-white:hover { color: var(--text-primary) !important; }

/* Table Header Specific */
body.light-theme thead.bg-gray-800 { background-color: #f1f5f9 !important; color: #475569 !important; }
body.light-theme thead.bg-gray-800 th { color: #475569 !important; font-weight: 600 !important; }

/* Scrollbar refinement for light mode */
body.light-theme ::-webkit-scrollbar-thumb { background: #cbd5e1; }
body.light-theme ::-webkit-scrollbar-track { background: #f1f5f9; }

body { 
    font-family: 'Vazirmatn', sans-serif; 
    background: var(--bg-main); 
    background-image: var(--bg-image);
    color: var(--text-primary); 
}

/* Branding Watermark */
body::before {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background-image: url('/logo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

.glass { 
    background: var(--glass-bg); 
    backdrop-filter: blur(8px); 
    border: 1px solid var(--glass-border); 
    border-radius: 12px; 
}

.input { 
    background: var(--input-bg); 
    border: 1px solid var(--input-border); 
    color: var(--text-primary); 
    padding: 10px; 
    border-radius: 6px; 
    width: 100%; 
    transition: 0.2s; 
}

.input:focus { 
    border-color: var(--accent-color); 
    outline: none; 
}

.btn-primary { 
    background: linear-gradient(135deg, #ca8a04, #eab308); 
    color: black; 
    font-weight: bold; 
    transition: 0.3s; 
}

.btn-primary:hover { 
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.3); 
    transform: translateY(-1px); 
}

.sidebar-item { 
    padding: 12px; 
    margin: 4px 0; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: 0.2s; 
    color: #94a3b8; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.sidebar-item:hover, .sidebar-item.active { 
    background: rgba(234, 179, 8, 0.1); 
    color: #eab308; 
}

::-webkit-scrollbar { 
    width: 6px; 
    height: 6px; 
}

::-webkit-scrollbar-thumb { 
    background: #475569; 
    border-radius: 3px; 
}

.deal-card { 
    transition: all 0.2s; 
}

.deal-card:hover {
    transform: translateY(-2px);
    border-color: #eab308;
}

/* Persian Date Picker Custom Styles */
.pdp-container {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
    padding: 15px !important;
    z-index: 10000 !important;
    font-family: 'Vazirmatn', sans-serif !important;
}

.pdp-header {
    background: rgba(59, 130, 246, 0.1) !important;
    border-radius: 8px !important;
    padding: 10px !important;
    margin-bottom: 10px !important;
}

.pdp-header .pdp-header-title {
    color: #e2e8f0 !important;
    font-weight: 600 !important;
}

.pdp-day {
    color: #e2e8f0 !important;
    border-radius: 6px !important;
    transition: all 0.2s !important;
    margin: 2px !important;
    padding: 8px !important;
}

.pdp-day:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    transform: scale(1.05) !important;
    color: #fff !important;
}

.pdp-day-selected {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6) !important;
    color: #fff !important;
    font-weight: bold !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4) !important;
}

.pdp-day-today {
    border: 2px solid #3b82f6 !important;
    font-weight: bold !important;
    color: #3b82f6 !important;
}

.pdp-day-other-month {
    color: #64748b !important;
    opacity: 0.5 !important;
}

.pdp-day-disabled {
    color: #475569 !important;
    opacity: 0.3 !important;
    cursor: not-allowed !important;
}

.pdp-weekday {
    color: #94a3b8 !important;
    font-weight: 600 !important;
    padding: 8px !important;
}

.pdp-navbar {
    background: transparent !important;
    border: none !important;
}

.pdp-navbar button {
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    color: #3b82f6 !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    transition: all 0.2s !important;
}

.pdp-navbar button:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    transform: scale(1.05) !important;
}

.pdp-time-picker {
    background: rgba(59, 130, 246, 0.1) !important;
    border-radius: 8px !important;
    padding: 10px !important;
}

.pdp-time-picker input {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    color: #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 8px !important;
}

.pdp-time-picker input:focus {
    border-color: #3b82f6 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Time Select Styling */
#activity-due-hour,
#activity-due-minute {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    color: #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 10px !important;
    transition: all 0.2s !important;
    font-weight: 500 !important;
}

#activity-due-hour:focus,
#activity-due-minute:focus {
    border-color: #3b82f6 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    background: rgba(30, 41, 59, 1) !important;
}

#activity-due-hour:hover,
#activity-due-minute:hover {
    border-color: rgba(59, 130, 246, 0.5) !important;
    background: rgba(30, 41, 59, 0.9) !important;
}

/* Schedule Fields Container */
#activity-schedule-fields {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Notification Popup Styles */
.notification-popup {
    position: fixed;
    top: 80px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-in-out;
    direction: rtl;
    font-family: 'Vazirmatn', sans-serif;
}

.notification-popup.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-popup.hide {
    opacity: 0;
    transform: translateX(100%);
}

.notification-popup-content {
    padding: 16px;
    color: var(--text-primary);
}

.notification-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-direction: row;
}

.notification-popup-title {
    font-weight: bold;
    font-size: 14px;
    color: var(--text-primary);
}

.notification-popup-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
}

.notification-popup-close:hover {
    color: var(--text-primary);
}

.notification-popup-close-all {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
    font-size: 14px;
}

.notification-popup-close-all:hover {
    color: #ef4444; /* Red color for close all */
}

.notification-popup-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notification-popup-footer {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-popup-time {
    font-size: 11px;
    color: #6b7280;
}

.notification-popup-actions {
    display: flex;
    gap: 8px;
}

.notification-popup-action {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 500;
}

.notification-popup-action.primary {
    background-color: #3b82f6;
    color: white;
}

.notification-popup-action.primary:hover {
    background-color: #2563eb;
}

.notification-popup-action.secondary {
    background-color: #6b7280;
    color: white;
}

.notification-popup-action.secondary:hover {
    background-color: #4b5563;
}

/* Stack multiple popups */
.notification-popup:nth-child(2) { top: 170px; }
.notification-popup:nth-child(3) { top: 260px; }
.notification-popup:nth-child(4) { top: 350px; }
.notification-popup:nth-child(5) { top: 440px; }
.notification-popup:nth-child(6) { top: 530px; }
.notification-popup:nth-child(7) { top: 620px; }
.notification-popup:nth-child(8) { top: 710px; }
.notification-popup:nth-child(9) { top: 800px; }
.notification-popup:nth-child(10) { top: 890px; }

/* For very small screens, reduce spacing */
@media (max-height: 900px) {
    .notification-popup:nth-child(2) { top: 140px; }
    .notification-popup:nth-child(3) { top: 210px; }
    .notification-popup:nth-child(4) { top: 280px; }
    .notification-popup:nth-child(5) { top: 350px; }
    .notification-popup:nth-child(6) { top: 420px; }
    .notification-popup:nth-child(7) { top: 490px; }
    .notification-popup:nth-child(8) { top: 560px; }
    .notification-popup:nth-child(9) { top: 630px; }
    .notification-popup:nth-child(10) { top: 700px; }
}

/* Light theme support for popups */
body.light-theme .notification-popup {
    background: var(--bg-panel);
    border-color: var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body.light-theme .notification-popup-title {
    color: var(--text-primary);
}

body.light-theme .notification-popup-message {
    color: var(--text-secondary);
}

body.light-theme .notification-popup-close {
    color: var(--text-secondary);
}

body.light-theme .notification-popup-close:hover {
    color: var(--text-primary);
}
/* Quick Filter Chips */
.quick-filter-chip {
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.3s ease;
    white-space: nowrap;
    border-width: 1px;
    background-color: rgba(31, 41, 55, 0.4);
    border-color: rgba(55, 65, 81, 0.5);
    color: #9ca3af;
    cursor: pointer;
}

.quick-filter-chip:hover {
    background-color: #374151;
    color: #ffffff;
}

.quick-filter-chip.active {
    background-color: #eab308;
    border-color: #ca8a04;
    color: #000000;
    box-shadow: 0 10px 15px -3px rgba(234, 179, 8, 0.2);
}

/* No scrollbar utility */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
