/* Custom CSS for Student Management System */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

/* Cards */
.card {
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Buttons */
.btn {
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Forms */
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
}

/* Tables */
.table {
    border-radius: 10px;
    overflow: visible !important;
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
}

/* Dashboard Cards */
.dashboard-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Sidebar */
.sidebar {
    background: linear-gradient(180deg, var(--primary-color) 0%, #6610f2 100%);
    min-height: 100vh;
    border-radius: 0 15px 15px 0;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    margin: 0.25rem 0;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

/* Sidebar Section Titles */
.sidebar .nav-section-title {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.sidebar .nav-section-title small {
    letter-spacing: 0.5px;
    font-size: 0.7rem;
}

/* Dropdown Menu Fixes */
.dropdown-menu {
    z-index: 1050 !important;
    min-width: 180px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: none;
    border-radius: 10px;
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.75rem 1.25rem;
    transition: all 0.3s ease;
    border-radius: 0;
}

.dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
    transform: translateX(5px);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: rgba(0,0,0,0.1);
}

/* Ensure dropdown is visible above other elements */
.dropdown {
    position: relative;
}

.dropdown-menu.show {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
        visibility: hidden;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
    }
}

/* Fix for action button dropdowns in cards */
.card .dropdown-menu {
    position: absolute;
    right: 0;
    left: auto;
    top: 100%;
    margin-top: 0.25rem;
}

/* Ensure proper stacking context */
.card {
    position: relative;
    z-index: 1;
}

.card .dropdown {
    position: static;
}

.card .dropdown-menu {
    position: absolute;
    z-index: 1051;
}

/* Table Dropdown Menu Fixes */
.table-responsive {
    overflow: visible !important;
}

.table td {
    overflow: visible !important;
}

.table .dropdown {
    position: static !important;
}

.table .dropdown-menu {
    position: absolute !important;
    z-index: 1060 !important;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 0;
    margin-top: 0.25rem;
}

.table .dropdown-menu.show {
    display: block !important;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    animation: dropdownSlideIn 0.3s ease-out;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
        visibility: hidden;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
    }
}

/* Ensure table cells don't clip dropdowns */
.table td:last-child {
    position: relative;
    overflow: visible;
}

/* Fix for action buttons in table */
.table .btn-group,
.table .dropdown {
    position: relative;
}

.table .dropdown-toggle {
    position: relative;
    z-index: 1;
}

/* Enhanced dropdown item styling for tables */
.table .dropdown-item {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-radius: 0;
}

.table .dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
    transform: translateX(5px);
    padding-left: 2rem;
}

.table .dropdown-item i {
    width: 18px;
    text-align: center;
    margin-right: 0.75rem;
}

.table .dropdown-divider {
    margin: 0.5rem 0;
    border-color: rgba(0,0,0,0.1);
}

/* Danger items styling */
.table .dropdown-item.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color) !important;
}