/* ================================================
   لوحة التحكم الترحيبية - Welcome Dashboard
   ================================================ */

/* الخلفية المعتمة */
.welcome-dashboard {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-dashboard.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.dashboard-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.4s ease-out;
}

/* الحاوية الرئيسية */
.dashboard-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 85vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideInScale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}

/* رأس اللوحة */
.dashboard-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.header-text {
    flex: 1;
}

.dashboard-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.2;
}

.dashboard-title span {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-subtitle {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: #718096;
}

/* أزرار الرأس */
.header-actions {
    display: flex;
    gap: 8px;
}

.dashboard-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f7fafc;
    color: #4a5568;
}

.dashboard-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dashboard-btn--minimize:hover {
    background: #fef5e7;
    color: #f39c12;
}

.dashboard-btn--close:hover {
    background: #fee;
    color: #e53e3e;
}

/* قسم التاريخ والوقت */
.dashboard-datetime {
    padding: 20px 28px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

.datetime-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.datetime-icon {
    font-size: 36px;
    line-height: 1;
}

.datetime-info {
    flex: 1;
}

.datetime-date {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.datetime-time {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Courier New', monospace;
}

/* المحتوى الرئيسي */
.dashboard-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background: rgba(255, 255, 255, 0.1);
}

.dashboard-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* البطاقات */
.dashboard-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
}

.card-action-btn {
    padding: 6px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.card-body {
    padding: 20px 24px;
}

/* إحصائيات سريعة */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f7fafc;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: #edf2f7;
    transform: translateX(-4px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon--blue {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

.stat-icon--green {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.stat-icon--orange {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.stat-icon--purple {
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #2d3748;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: #718096;
    font-weight: 500;
}

/* قائمة المهام */
.tasks-list {
    max-height: 300px;
    overflow-y: auto;
}

.task-item {
    padding: 14px;
    background: #f7fafc;
    border-radius: 10px;
    margin-bottom: 10px;
    border-right: 4px solid #667eea;
    transition: all 0.3s ease;
    cursor: pointer;
}

.task-item:hover {
    background: #edf2f7;
    transform: translateX(-4px);
}

.task-item:last-child {
    margin-bottom: 0;
}

.task-title {
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 6px;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #718096;
}

.task-priority {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.task-priority--high {
    background: #fee;
    color: #e53e3e;
}

.task-priority--medium {
    background: #fef5e7;
    color: #f39c12;
}

.task-priority--low {
    background: #e6f7ff;
    color: #3182ce;
}

/* قائمة النشاط */
.activity-list {
    max-height: 280px;
    overflow-y: auto;
}

.activity-item {
    padding: 14px;
    background: #f7fafc;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: #edf2f7;
    transform: translateX(-4px);
}

.activity-item:last-child {
    margin-bottom: 0;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 14px;
    color: #2d3748;
    margin-bottom: 4px;
}

.activity-time {
    font-size: 12px;
    color: #a0aec0;
}

/* المساهمات */
.contributions-summary {
    margin-bottom: 24px;
}

.contribution-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.contribution-item:last-child {
    border-bottom: none;
}

.contribution-label {
    font-size: 14px;
    color: #4a5568;
}

.contribution-value {
    font-size: 16px;
    font-weight: 700;
    color: #667eea;
}

.contributions-progress {
    background: #f7fafc;
    padding: 16px;
    border-radius: 12px;
}

.progress-bar {
    height: 12px;
    background: #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
    margin: 0;
    font-size: 13px;
    color: #718096;
    text-align: center;
}

.progress-text span {
    font-weight: 700;
    color: #667eea;
}

/* حالة فارغة */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #a0aec0;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* التذييل */
.dashboard-footer {
    padding: 20px 28px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer-tip {
    margin: 0;
    text-align: center;
    font-size: 14px;
    color: #718096;
}

/* أيقونة Dashboard في الشريط العلوي - مدمجة مع الأزرار */
.control-btn.dashboard-btn {
    position: relative;
}

.control-btn.dashboard-btn .dashboard-icon-svg {
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
    color: #6ee7b7; /* لون أخضر زمردي مشابه للأيقونات الأخرى */
    stroke: #6ee7b7;
    filter: drop-shadow(0 0 10px rgba(110, 231, 183, 0.85)) drop-shadow(0 0 18px rgba(16, 185, 129, 0.45));
}

.control-btn.dashboard-btn:hover .dashboard-icon-svg {
    transform: translateY(-1px) scale(1.08) rotate(5deg);
    filter: drop-shadow(0 0 12px rgba(110, 231, 183, 0.95)) drop-shadow(0 0 22px rgba(16, 185, 129, 0.55)) brightness(1.1);
}

.control-btn.dashboard-btn:active .dashboard-icon-svg {
    transform: none;
    filter: drop-shadow(0 0 10px rgba(110, 231, 183, 0.85)) drop-shadow(0 0 18px rgba(16, 185, 129, 0.45)) brightness(0.98);
}

/* Responsive: reduce on small screens */
@media (max-width: 640px) {
    .control-btn.dashboard-btn .dashboard-icon-svg {
        width: 28px;
        height: 28px;
    }
}

/* Dark mode adjustments */
body.dark-mode .control-btn.dashboard-btn .dashboard-icon-svg {
    filter: drop-shadow(0 0 10px rgba(110, 231, 183, 0.85)) drop-shadow(0 0 18px rgba(16, 185, 129, 0.45)) saturate(1.1);
}

.control-btn.dashboard-btn .icon-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--dark-bg);
    animation: pulse 2s infinite;
}

/* animation للـ badge */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.85;
    }
}

/* الأنيميشن */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* تأثير التصغير */
.welcome-dashboard.minimizing .dashboard-container {
    animation: minimizeToIcon 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes minimizeToIcon {
    to {
        transform: scale(0) translate(-500px, -400px);
        opacity: 0;
    }
}

/* الوضع الداكن */
body.dark-mode .dashboard-container {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
}

body.dark-mode .dashboard-header,
body.dark-mode .dashboard-footer,
body.dark-mode .datetime-card,
body.dark-mode .dashboard-card {
    background: rgba(45, 55, 72, 0.95);
}

body.dark-mode .dashboard-title,
body.dark-mode .card-title,
body.dark-mode .stat-value,
body.dark-mode .task-title,
body.dark-mode .activity-text {
    color: #e2e8f0;
}

body.dark-mode .dashboard-subtitle,
body.dark-mode .stat-label,
body.dark-mode .task-meta,
body.dark-mode .activity-time,
body.dark-mode .contribution-label,
body.dark-mode .progress-text,
body.dark-mode .footer-tip {
    color: #a0aec0;
}

body.dark-mode .stat-item,
body.dark-mode .task-item,
body.dark-mode .activity-item,
body.dark-mode .contributions-progress {
    background: rgba(74, 85, 104, 0.3);
}

body.dark-mode .stat-item:hover,
body.dark-mode .task-item:hover,
body.dark-mode .activity-item:hover {
    background: rgba(74, 85, 104, 0.5);
}

body.dark-mode .datetime-date {
    color: #e2e8f0;
}

body.dark-mode .card-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .contribution-item {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .progress-bar {
    background: rgba(74, 85, 104, 0.5);
}

/* الاستجابة للشاشات الصغيرة */
@media (max-width: 968px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-container {
        width: 95%;
        max-height: 90vh;
    }

    .dashboard-header {
        padding: 20px;
    }

    .dashboard-content {
        padding: 16px 20px;
    }

    .card-body {
        padding: 16px;
    }
}

@media (max-width: 640px) {
    .dashboard-title {
        font-size: 20px;
    }

    .datetime-time {
        font-size: 20px;
    }

    .stat-value {
        font-size: 24px;
    }

    .dashboard-icon-wrapper {
        top: 15px;
        left: 15px;
    }

    .dashboard-toggle-icon {
        width: 44px;
        height: 44px;
    }
}
