/* =============================================
   E-Portal Dashboard Styles
   Module Grid + Mobile Nav
   ============================================= */

/* Dashboard Layout */
.dashboard-wrapper {
    min-height: 100vh;
    background: #ffffff;
    position: relative;
    z-index: 1;
}

/* Top Navbar */
.top-navbar {
    background: var(--bg-white);
    padding: 12px var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: var(--z-navbar);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.navbar-brand .brand-logo {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
}

.navbar-brand .brand-logo svg {
    width: 30px;
    height: 30px;
    color: var(--primary);
}

.navbar-brand .brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.navbar-brand .brand-info h2 {
    font-family: var(--font-heading);
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.navbar-brand .brand-info span {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-weight: 500;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.navbar-actions .nav-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

.navbar-actions .nav-btn:hover {
    background: var(--primary);
    color: white;
}

.navbar-actions .nav-btn svg {
    width: 20px;
    height: 20px;
}

/* User Avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    cursor: pointer;
    border: 2px solid var(--bg-white);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    overflow: hidden;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 220px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-base);
    z-index: var(--z-dropdown);
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--bg-dark);
}

.user-dropdown-header .user-name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.user-dropdown-header .user-role {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 12px var(--space-lg);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.user-dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.user-dropdown-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.user-dropdown-item.danger {
    color: var(--danger);
}

/* Dashboard Content */
.dashboard-content {
    padding: var(--space-lg);
    max-width: 1600px;
    margin: 0 auto;
}

/* Welcome Section */
.welcome-section {
    background: var(--primary-gradient);
    border-radius: var(--radius-xl);
    padding: var(--space-xl) var(--space-lg);
    color: white;
    margin-bottom: var(--space-xl);
    position: relative;
    overflow: hidden;
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.welcome-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 179, 0, 0.15);
    border-radius: 50%;
}

.welcome-section h2 {
    font-family: var(--font-heading);
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.welcome-section p {
    font-size: var(--font-size-sm);
    opacity: 0.85;
    position: relative;
    z-index: 1;
}

.welcome-date {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    font-size: var(--font-size-xs);
    opacity: 0.75;
    position: relative;
    z-index: 1;
}

.welcome-date svg {
    width: 14px;
    height: 14px;
}

/* Module Section */
.section-title {
    font-family: var(--font-heading);
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-title .title-accent {
    width: 4px;
    height: 24px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

/* Module Grid */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.module-card {
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    color: white;
}

/* White Gradient Glass Border */
.module-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0.3) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 10;
}

.module-card.list-view {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    text-align: left;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    filter: brightness(1.05);
}

.module-card:active {
    transform: translateY(-2px) scale(0.98);
}

.module-card.list-view .module-icon {
    width: 52px;
    height: 52px;
    margin: 0;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.module-card.list-view .module-icon svg {
    width: 26px;
    height: 26px;
    transition: all var(--transition-base);
}

.module-card:hover .module-icon {
    transform: scale(1.1);
}

.module-card.list-view .module-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.module-card.list-view .module-name {
    font-family: var(--font-heading);
    font-size: var(--font-size-base);
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.module-card.list-view .module-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Skeleton for modules */
.module-card.skeleton-module {
    pointer-events: none;
    background: var(--bg-white) !important;
}

.module-card.skeleton-module .module-icon,
.module-card.skeleton-module .module-name,
.module-card.skeleton-module .module-desc {
    background: linear-gradient(90deg, var(--bg-dark) 25%, var(--bg-light) 50%, var(--bg-dark) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    color: transparent;
    border-radius: var(--radius-sm);
}

.module-card.skeleton-module .module-name {
    width: 70%;
    height: 18px;
    margin-bottom: 6px;
}

.module-card.skeleton-module .module-desc {
    width: 90%;
    height: 12px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .module-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .module-card.list-view .module-icon {
        width: 44px;
        height: 44px;
    }

    .module-card.list-view .module-icon svg {
        width: 20px;
        height: 20px;
    }

    .module-card.list-view .module-name {
        font-size: var(--font-size-sm);
    }

    .module-card.list-view .module-desc {
        font-size: 11px;
    }

    .welcome-section {
        padding: var(--space-lg);
    }

    .welcome-section h2 {
        font-size: var(--font-size-lg);
    }
}

@media (max-width: 480px) {
    .module-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-content {
        padding: var(--space-md);
    }

    .navbar-brand .brand-info h2 {
        font-size: var(--font-size-sm);
    }
}
