/**
 * ✅ Phase 8.2.1: Dashboard Selection Menu Styles
 * نمط قائمة اختيار لوحة التحكم
 * 
 * @package    Team_Portal
 * @subpackage Assets/CSS/Components
 * @version    1.7.2
 * @since      Phase 8.2.1
 */

/* ==========================================================================
   1. CONTAINER & OVERLAY
   ========================================================================== */

.tp-dashboard-selection-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000; /* Higher than modal */
    display: none;
    opacity: 0;
    animation: tpMenuFadeIn 0.2s ease forwards;
}

.tp-dashboard-selection-menu.tp-menu-visible {
    opacity: 1;
}

.tp-dashboard-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    animation: tpOverlayFadeIn 0.2s ease;
}

.tp-dashboard-menu-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    animation: tpMenuSlideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    z-index: 100001;
}

/* ==========================================================================
   2. HEADER
   ========================================================================== */

.tp-dashboard-menu-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.tp-dashboard-menu-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tp-dashboard-menu-header h3 i {
    font-size: 26px;
    opacity: 0.9;
}

.tp-menu-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.tp-menu-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.tp-menu-close:active {
    transform: rotate(90deg) scale(0.9);
}

/* ==========================================================================
   3. BODY
   ========================================================================== */

.tp-dashboard-menu-body {
    padding: 32px 28px;
    background: #f8f9fa;
    max-height: calc(85vh - 85px);
    overflow-y: auto;
}

/* Custom Scrollbar */
.tp-dashboard-menu-body::-webkit-scrollbar {
    width: 8px;
}

.tp-dashboard-menu-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.tp-dashboard-menu-body::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

.tp-dashboard-menu-body::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* ==========================================================================
   4. OPTIONS CONTAINER
   ========================================================================== */

.tp-dashboard-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* ==========================================================================
   5. DASHBOARD OPTION CARD
   ========================================================================== */

.tp-dashboard-option {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    display: grid;
    grid-template-columns: 70px 1fr 40px;
    gap: 20px;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.tp-dashboard-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transition: width 0.4s ease;
    z-index: 0;
}

.tp-dashboard-option:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.tp-dashboard-option:hover::before {
    width: 100%;
}

.tp-dashboard-option:active {
    transform: translateY(-2px) scale(0.98);
}

/* ==========================================================================
   6. OPTION ICON
   ========================================================================== */

.tp-dashboard-option-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.tp-dashboard-option:hover .tp-dashboard-option-icon {
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
}

.tp-dashboard-option-icon i {
    font-size: 32px;
    color: #ffffff;
    transition: transform 0.3s ease;
}

.tp-dashboard-option:hover .tp-dashboard-option-icon i {
    transform: scale(1.1);
}

/* Analytics Icon Variant */
.tp-dashboard-option-icon.tp-icon-analytics {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* ==========================================================================
   7. OPTION CONTENT
   ========================================================================== */

.tp-dashboard-option-content {
    position: relative;
    z-index: 1;
}

.tp-dashboard-option-content h4 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    transition: color 0.3s ease;
}

.tp-dashboard-option:hover .tp-dashboard-option-content h4 {
    color: #667eea;
}

.tp-dashboard-option-content p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #6c757d;
    line-height: 1.6;
}

/* ==========================================================================
   8. FEATURE BADGES
   ========================================================================== */

.tp-dashboard-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tp-feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tp-dashboard-option:hover .tp-feature-badge {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.tp-feature-badge i {
    font-size: 11px;
}

/* Analytics Badge Variant */
.tp-feature-badge.tp-badge-analytics {
    background: rgba(240, 147, 251, 0.1);
    color: #f5576c;
}

.tp-dashboard-option:hover .tp-feature-badge.tp-badge-analytics {
    background: rgba(240, 147, 251, 0.15);
}

/* ==========================================================================
   9. OPTION ARROW
   ========================================================================== */

.tp-dashboard-option-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.tp-dashboard-option-arrow i {
    font-size: 24px;
    color: #cbd5e0;
    transition: all 0.3s ease;
}

.tp-dashboard-option:hover .tp-dashboard-option-arrow i {
    color: #667eea;
    transform: translateX(-4px);
}

/* ==========================================================================
   10. ANIMATIONS
   ========================================================================== */

@keyframes tpMenuFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes tpOverlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes tpMenuSlideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ==========================================================================
   11. DARK MODE
   ========================================================================== */

body.dark-mode .tp-dashboard-menu-container {
    background: #1e293b;
}

body.dark-mode .tp-dashboard-menu-body {
    background: #0f172a;
}

body.dark-mode .tp-dashboard-option {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .tp-dashboard-option:hover {
    border-color: #667eea;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

body.dark-mode .tp-dashboard-option-content h4 {
    color: #f1f5f9;
}

body.dark-mode .tp-dashboard-option:hover .tp-dashboard-option-content h4 {
    color: #a5b4fc;
}

body.dark-mode .tp-dashboard-option-content p {
    color: #94a3b8;
}

body.dark-mode .tp-feature-badge {
    background: rgba(102, 126, 234, 0.15);
    color: #a5b4fc;
}

body.dark-mode .tp-dashboard-option:hover .tp-feature-badge {
    background: rgba(102, 126, 234, 0.25);
}

body.dark-mode .tp-feature-badge.tp-badge-analytics {
    background: rgba(240, 147, 251, 0.15);
    color: #fca5a5;
}

body.dark-mode .tp-dashboard-option:hover .tp-feature-badge.tp-badge-analytics {
    background: rgba(240, 147, 251, 0.25);
}

body.dark-mode .tp-dashboard-option-arrow i {
    color: #475569;
}

body.dark-mode .tp-dashboard-option:hover .tp-dashboard-option-arrow i {
    color: #a5b4fc;
}

body.dark-mode .tp-dashboard-menu-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .tp-dashboard-menu-body::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
}

body.dark-mode .tp-dashboard-menu-body::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* ==========================================================================
   12. RESPONSIVE DESIGN
   ========================================================================== */

/* Tablets */
@media (max-width: 768px) {
    .tp-dashboard-menu-container {
        width: 95%;
        max-height: 90vh;
    }
    
    .tp-dashboard-menu-header {
        padding: 20px 20px;
    }
    
    .tp-dashboard-menu-header h3 {
        font-size: 19px;
    }
    
    .tp-dashboard-menu-body {
        padding: 24px 20px;
        max-height: calc(90vh - 75px);
    }
    
    .tp-dashboard-option {
        padding: 20px;
        grid-template-columns: 60px 1fr 35px;
        gap: 16px;
    }
    
    .tp-dashboard-option-icon {
        width: 60px;
        height: 60px;
    }
    
    .tp-dashboard-option-icon i {
        font-size: 28px;
    }
    
    .tp-dashboard-option-content h4 {
        font-size: 18px;
    }
    
    .tp-dashboard-option-content p {
        font-size: 13px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .tp-dashboard-menu-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        transform: translate(-50%, -50%) scale(1);
    }
    
    .tp-dashboard-menu-header {
        padding: 18px 16px;
    }
    
    .tp-dashboard-menu-header h3 {
        font-size: 17px;
    }
    
    .tp-dashboard-menu-header h3 i {
        font-size: 20px;
    }
    
    .tp-menu-close {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .tp-dashboard-menu-body {
        padding: 20px 16px;
        max-height: calc(100vh - 68px);
    }
    
    .tp-dashboard-options {
        gap: 16px;
    }
    
    .tp-dashboard-option {
        padding: 16px;
        grid-template-columns: 1fr;
        gap: 12px;
        text-align: center;
    }
    
    .tp-dashboard-option-icon {
        width: 70px;
        height: 70px;
        margin: 0 auto;
    }
    
    .tp-dashboard-option-arrow {
        display: none;
    }
    
    .tp-dashboard-option-content h4 {
        font-size: 17px;
    }
    
    .tp-dashboard-option-content p {
        font-size: 12px;
    }
    
    .tp-dashboard-features {
        justify-content: center;
    }
    
    .tp-feature-badge {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* ==========================================================================
   13. ACCESSIBILITY
   ========================================================================== */

/* Focus States */
.tp-dashboard-option:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.tp-menu-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .tp-dashboard-selection-menu,
    .tp-dashboard-menu-overlay,
    .tp-dashboard-menu-container,
    .tp-dashboard-option,
    .tp-dashboard-option::before,
    .tp-dashboard-option-icon,
    .tp-dashboard-option-icon i,
    .tp-dashboard-option-arrow i,
    .tp-feature-badge,
    .tp-menu-close {
        animation: none !important;
        transition: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .tp-dashboard-option {
        border: 3px solid #000000;
    }
    
    body.dark-mode .tp-dashboard-option {
        border: 3px solid #ffffff;
    }
    
    .tp-dashboard-option:hover {
        border-color: #667eea;
    }
}

/* ==========================================================================
   14. RTL SUPPORT
   ========================================================================== */

[dir="rtl"] .tp-dashboard-option-arrow i {
    transform: rotate(180deg);
}

[dir="rtl"] .tp-dashboard-option:hover .tp-dashboard-option-arrow i {
    transform: rotate(180deg) translateX(4px);
}

[dir="rtl"] .tp-dashboard-menu-header h3 {
    flex-direction: row-reverse;
}

/* ==========================================================================
   END OF FILE
   ========================================================================== */
