/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background: #f0f2f5;
}

/* Sidebar Styles */
.dashboard-sidebar {
    width: 280px;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 20px;
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: #506690;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    margin: 5px 15px;
    border-radius: 8px;
    font-size: 15px;
}

.sidebar-menu li a:hover {
    background: #f8f9fa;
    color: #0047AB;
}

.sidebar-menu li a.active {
    background: #e7f0ff;
    color: #0047AB;
    font-weight: 600;
    border-left: none;
}

.sidebar-menu li a i {
    margin-right: 10px;
    font-size: 1.2em;
    width: 20px;
    text-align: center;
}

.sidebar-menu li a:hover:not(.active) {
    background: #f8f9fa;
    color: #0047AB;
    transform: translateX(5px);
}

/* Submenu Styles */
.has-submenu > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.submenu-arrow {
    transition: transform 0.3s ease;
    font-size: 0.8em;
}

.has-submenu.open .submenu-arrow {
    transform: rotate(180deg);
}

.submenu {
    display: none;
    padding-left: 20px;
    background: rgba(0, 0, 0, 0.02);
}

.submenu.open {
    display: block;
}

.submenu li a {
    padding: 10px 15px;
    font-size: 0.9em;
}

.submenu li a i {
    font-size: 0.9em;
}

/* Active submenu item */
.submenu li a.active {
    background: #e7f0ff;
    color: #0047AB;
}

/* Dashboard Nav */
.dashboard-nav {
    position: fixed;
    top: 0;
    right: 0;
    left: 280px;
    height: 70px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transition: left 0.3s ease;
    width: calc(100% - 280px); /* Add explicit width calculation */
}

.nav-logo img {
    height: 40px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.welcome-text {
    color: #506690;
    font-weight: 500;   
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: #ff4757;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #ff6b81;
    transform: translateY(-1px);
}

/* Main Content Area */
.dashboard-main {
    flex: 1;
    margin-left: 280px;
}

/* Dashboard Content Styles */
.dashboard-content {
    padding: 90px 30px 30px;
}

.welcome-section {
    background: linear-gradient(135deg, #0047AB, #003380);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 71, 171, 0.2);
}

.welcome-heading {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.welcome-subtitle {
    font-size: 16px;
    opacity: 0.9;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin: 30px 0;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card.primary .stat-icon { 
    background: rgba(0,71,171,0.1); 
    color: #0047AB;
}

.stat-card.success .stat-icon { 
    background: rgba(40,167,69,0.1);
    color: #28a745;
}

.stat-card.warning .stat-icon { 
    background: rgba(255,193,7,0.1);
    color: #ffc107;
}

.stat-card.info .stat-icon { 
    background: rgba(23,162,184,0.1);
    color: #17a2b8;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin: 5px 0;
    color: #2d3748;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
}

.stat-trend.positive { color: #28a745; }
.stat-trend.negative { color: #dc3545; }
.stat-trend.neutral { color: #6c757d; }

.stat-info h3 {
    color: #6c757d;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.dashboard-card {
    background: white;
    border-radius: 15px;
    padding: 24px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #edf2f7;
}

.card-header h2 {
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

.view-all {
    color: #0047AB;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    gap: 12px;
    padding: 15px 0;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-align: left;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 10px;
}

.action-btn:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.action-btn i {
    margin-right: 10px;
    color: #0047AB;
}

/* Activity List */
.activity-list {
    padding: 15px 0;
}

.activity-item {
    padding: 15px;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    gap: 15px;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 71, 171, 0.1);
    color: #0047AB;
}

.activity-details h4 {
    font-size: 14px;
    color: #2d3748;
    margin-bottom: 5px;
}

.activity-time {
    font-size: 12px;
    color: #6c757d;
}

/* Enhanced Nav Styles */
.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #506690;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: #f0f2f5;
    color: #0047AB;
}

.breadcrumb {
    color: #2d3748;
    font-weight: 500;
    font-size: 16px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.action-button {
    background: none;
    border: none;
    position: relative;
    padding: 8px;
    color: #506690;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-button:hover {
    background: #f0f2f5;
    color: #0047AB;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff4757;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid white;
}

.user-dropdown {
    position: relative;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-button:hover {
    background: #f0f2f5;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    color: #2d3748;
    font-weight: 500;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    margin-top: 10px;
    min-width: 200px;
    display: none;
    z-index: 1000;
}

.user-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #506690;
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-menu a:hover {
    background: #f0f2f5;
    color: #0047AB;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 8px 0;
}

.logout-link {
    color: #ff4757 !important;
}

.logout-link:hover {
    background: #fff3f3 !important;
}

/* Fix Nav Logo */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #2d3748;
}

.nav-logo .logo-img {
    height: 35px;
    width: auto;
}

/* Fix Notification Dropdown */
.notification-dropdown {
    position: relative;
}

.notification-dropdown .dropdown-menu {
    min-width: 300px;
    padding: 0;
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 20px;
    border-bottom: 1px solid #edf2f7;
    transition: background-color 0.3s;
}

.notification-item:hover {
    background-color: #f8fafc;
}

/* Fix User Dropdown positioning */
.user-dropdown .dropdown-menu {
    right: 0;
    min-width: 200px;
}

/* Search Bar Styles */
.nav-search {
    margin-left: 20px;
}

.search-form {
    position: relative;
    width: 300px;
}

.search-input {
    width: 100%;
    padding: 8px 15px;
    padding-right: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #f8fafc;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #0047AB;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 71, 171, 0.1);
}

.search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #506690;
    cursor: pointer;
}

/* Messages and Notifications Dropdowns */
.message-dropdown,
.notification-dropdown,
.quick-actions-dropdown {
    position: relative;
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.dropdown-header h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.message-list,
.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

.message-badge,
.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff4757;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid white;
}

/* Quick Actions Dropdown */
.quick-action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #506690;
    text-decoration: none;
    transition: all 0.3s ease;
}

.quick-action-item:hover {
    background: #f8fafc;
    color: #0047AB;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .search-form {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .nav-search {
        display: none;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-content {
        padding: 80px 20px 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .dashboard-sidebar.active {
        transform: translateX(0);
    }

    .dashboard-main {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .welcome-section {
        padding: 20px;
    }

    .user-name, .breadcrumb {
        display: none;
    }
    
    .nav-actions {
        gap: 10px;
    }
    
    .dashboard-nav {
        left: 0;
        width: 100%; /* Full width on mobile */
        padding: 0 15px;
    }

    .nav-left {
        width: auto;
        gap: 10px;
    }

    .sidebar-toggle {
        padding: 8px;
        margin-right: 5px;
    }

    .nav-logo {
        max-width: 120px; /* Limit logo width on mobile */
    }

    .nav-logo .logo-img {
        height: 30px; /* Slightly smaller logo on mobile */
    }

    .nav-actions {
        margin-left: auto; /* Push to right */
    }
    
    .dropdown-menu {
        right: -70px;
    }
}

/* Profile Page Styles */
.profile-container {
    max-width: 1000px;
    margin: 0 auto;
}

.profile-header {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.profile-cover {
    height: 200px;
    background: linear-gradient(135deg, #0047AB, #003380);
}

.profile-info {
    padding: 20px;
    margin-top: -75px;
    display: flex;
    align-items: flex-end;
    gap: 30px;
}

.profile-avatar {
    position: relative;
    width: 150px;
    height: 150px;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.change-avatar {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: #0047AB;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.change-avatar:hover {
    background: #003380;
    transform: scale(1.1);
}

.profile-details {
    flex: 1;
}

.profile-details h1 {
    font-size: 24px;
    margin: 0;
    color: #2d3748;
}

.profile-details .role {
    color: #0047AB;
    font-weight: 500;
    margin: 5px 0;
}

.profile-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.profile-section {
    margin-bottom: 30px;
}

.profile-section h2 {
    color: #2d3748;
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf2f7;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #0047AB;
    box-shadow: 0 0 0 3px rgba(0, 71, 171, 0.1);
}

.form-group input:disabled {
    background: #f8fafc;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

/* Language Switcher Overrides for Dashboard */
.dashboard-nav .language-switcher {
    position: relative;
    display: inline-block;
    margin-left: 15px;
    min-width: 100px;
    z-index: 1001;
}

.dashboard-nav .flag-icon {
    width: 20px !important; /* Force specific size */
    height: auto !important;
    border-radius: 2px;
    object-fit: cover;
}

.dashboard-nav .dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 71, 171, 0.1);
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #506690;
}

.dashboard-nav .dropdown-content {
    min-width: 150px;
    right: 0;
    top: 100%;
    margin-top: 5px;
}

.dashboard-nav .dropdown-content a {
    padding: 8px 15px;
    font-size: 14px;
}

/* Settings Page Styles */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.settings-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.settings-card h2 {
    color: #2d3748;
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf2f7;
}

.settings-form {
    max-width: 500px;
}

.paper-list {
    margin-top: 1rem;
}

.paper-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.paper-item:last-child {
    border-bottom: none;
}

.paper-info h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.paper-meta {
    display: flex;
    gap: 1rem;
    color: #64748b;
    font-size: 0.875rem;
}

.paper-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Course Grid Layout */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin: 20px 0;
}

.course-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.course-header h3 {
    font-size: 1.1rem;
    color: #1e293b;
    margin: 0;
}

.course-code {
    background: #0047AB;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.course-info {
    margin-bottom: 20px;
}

.course-info p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    color: #64748b;
    font-size: 0.9rem;
}

.course-info i {
    color: #0047AB;
    width: 16px;
}

.course-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: auto;
}

/* Course Form Styles */
.course-form {
    max-width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.form-section {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.form-section.full-width {
    grid-column: 1 / -1;
}

.form-section h3 {
    color: #0047AB;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #475569;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #0047AB;
    box-shadow: 0 0 0 3px rgba(0, 71, 171, 0.1);
}

.form-control:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    .courses-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button,
    .form-actions a {
        width: 100%;
    }
}

/* Course Hero Section */
.course-hero {
    background: linear-gradient(135deg, rgba(0, 71, 171, 0.9), rgba(0, 42, 92, 0.9));
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 40px;
}

/* Course Cards */
.courses-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.courses-filters {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.course-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.header-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.faculty-badge {
    background: rgba(0, 71, 171, 0.1);
    color: #0047AB;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.semester-badge {
    background: rgba(244, 161, 0, 0.1);
    color: #F4A100;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.code-badge {
    background: #0047AB;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}
