/* ============================================
   MAIN STYLES FOR COURSE REGISTRATION SYSTEM
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f4f7f5;
    color: #212529;
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.55;
}

a { color: #157347; }
a:hover { color: #0d5c31; }
::selection { background: #bdeaca; color: #123524; }

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #198754;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #157347;
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, #198754, #0d6e3e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #198754, #157347);
}

.bg-gradient-light {
    background: linear-gradient(135deg, #d1f7dc, #f8f9fa);
}

.shadow-hover {
    transition: all 0.3s ease;
}

.shadow-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(25, 135, 84, 0.15);
}

/* Glassmorphism Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

/* Buttons */
.btn {
    border-radius: 50px;
    padding: 10px 28px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-success {
    background: #198754;
    border-color: #198754;
}

.btn-success:hover {
    background: #157347;
    border-color: #157347;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(25, 135, 84, 0.3);
}

.btn-outline-success {
    color: #198754;
    border-color: #198754;
}

.btn-outline-success:hover {
    background: #198754;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(25, 135, 84, 0.2);
}

/* Forms */
.form-control, .form-select {
    border-radius: 12px;
    border: 2px solid #e9ecef;
    padding: 12px 16px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.15);
}

.form-control-lg {
    padding: 14px 20px;
    font-size: 1rem;
}

.form-label {
    font-weight: 500;
    color: #212529;
}

/* Cards */
.card {
    border-radius: 20px;
    border: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-radius: 20px 20px 0 0 !important;
}

/* Tables */
.table {
    font-size: 0.95rem;
}

.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #198754;
    color: #212529;
    font-weight: 600;
    padding: 12px 16px;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: rgba(25, 135, 84, 0.05);
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(25, 135, 84, 0.03);
}

/* Badges */
.badge {
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.8rem;
}

.badge-success {
    background: #d1f7dc;
    color: #198754;
}

.badge-danger {
    background: #f8d7da;
    color: #dc3545;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Alerts */
.alert {
    border-radius: 15px;
    border: none;
    padding: 16px 20px;
}

.alert-success {
    background: #d1f7dc;
    color: #0d6e3e;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Modal */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-radius: 20px 20px 0 0;
    padding: 20px 25px;
    background: linear-gradient(135deg, #198754, #157347);
    color: white;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Loading Spinner */
.spinner-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-border {
    width: 60px;
    height: 60px;
    border-width: 5px;
    color: #198754;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-slide-left {
    animation: slideInLeft 0.6s ease forwards;
}

.animate-slide-right {
    animation: slideInRight 0.6s ease forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Responsive Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #173f2b 0%, #102b1e 100%);
    color: white;
    padding: 20px 0;
    transition: all 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar .sidebar-brand {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar .sidebar-brand h5 {
    color: white;
    font-weight: 700;
}

.sidebar .sidebar-brand small {
    color: rgba(255, 255, 255, 0.65);
}

.sidebar .nav-item {
    padding: 5px 20px;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background: #198754;
    color: white;
    box-shadow: 0 5px 15px rgba(25, 135, 84, 0.3);
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

.main-content {
    margin-left: 260px;
    padding: 20px;
    min-height: 100vh;
    transition: all 0.3s ease;
}

.main-content > .navbar {
    min-height: 64px;
    border: 1px solid rgba(25, 135, 84, 0.08);
}

.breadcrumb { margin-bottom: 0; }
.table-responsive { border-radius: 14px; }

.dropdown-menu {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(18, 53, 36, 0.12);
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .main-content.shifted {
        margin-left: 0;
    }
    .main-content { padding: 14px; }
    .main-content > .navbar { margin-bottom: 1rem !important; }
    .main-content .container-fluid.px-4 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Dashboard Cards */
.dashboard-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.dashboard-card .card-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 15px;
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
    cursor: pointer;
}

.profile-dropdown .dropdown-menu {
    border-radius: 16px;
    padding: 10px 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: none;
    min-width: 220px;
}

.profile-dropdown .dropdown-item {
    padding: 10px 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.profile-dropdown .dropdown-item:hover {
    background: #d1f7dc;
    color: #198754;
}

.profile-dropdown .dropdown-item i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
}

/* Responsive Utilities */
@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    .card-body {
        padding: 20px;
    }
    .table-responsive {
        font-size: 0.85rem;
    }
    .btn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
    .dashboard-card {
        padding: 16px;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.toast-success {
    background: linear-gradient(135deg, #198754, #157347);
    color: white;
}

.toast-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.toast-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}

.toast-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #198754;
    border-radius: 10px;
}

/* Dark Mode Support */
.dark-mode {
    background: #1a1a1a;
    color: #f8f9fa;
}

.dark-mode .card {
    background: #2d2d2d;
    color: #f8f9fa;
}

.dark-mode .table {
    color: #f8f9fa;
}

.dark-mode .table thead th {
    background: #333;
    color: #f8f9fa;
}

.dark-mode .form-control,
.dark-mode .form-select {
    background: #333;
    border-color: #444;
    color: #f8f9fa;
}

.dark-mode .form-control:focus,
.dark-mode .form-select:focus {
    border-color: #198754;
}

.dark-mode .modal-content {
    background: #2d2d2d;
    color: #f8f9fa;
}

.dark-mode .sidebar {
    background: #1a1a1a;
}

.dark-mode .dashboard-card {
    background: #2d2d2d;
    border-color: #333;
}

/* Print Styles */
@media print {
    .sidebar,
    .no-print {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 20px !important;
    }
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
