/*
 * Thinder Frontend - Main Stylesheet
 * Design inspired by Ready2Code with h_da colors
 * 
 * Primary Colors (h_da):
 * - Blue: #004A8D (primary)
 * - Orange: #E87722 (accent)
 * - Light Gray: #F5F5F5 (background)
 */

:root {
    /* h_da Color Palette */
    --hda-blue: #004A8D;
    --hda-blue-light: #0066B3;
    --hda-blue-dark: #003366;
    --hda-orange: #E87722;
    --hda-orange-light: #FF9933;
    --hda-gray-light: #F5F5F5;
    --hda-gray: #6C757D;
    --hda-gray-dark: #343A40;

    /* Bootstrap Override */
    --bs-primary: var(--hda-blue);
    --bs-primary-rgb: 0, 74, 141;
    --bs-link-color: var(--hda-blue);
    --bs-link-hover-color: var(--hda-blue-light);
}

/* Global Styles */
html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--hda-gray-light);
    min-height: 100vh;
}

/* Override Bootstrap Primary */
.bg-primary {
    background-color: var(--hda-blue) !important;
}

.btn-primary {
    background-color: var(--hda-blue);
    border-color: var(--hda-blue);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--hda-blue-light);
    border-color: var(--hda-blue-light);
}

.btn-outline-primary {
    color: var(--hda-blue);
    border-color: var(--hda-blue);
}

.btn-outline-primary:hover {
    background-color: var(--hda-blue);
    border-color: var(--hda-blue);
    color: white;
}

.text-primary {
    color: var(--hda-blue) !important;
}

.border-primary {
    border-color: var(--hda-blue) !important;
}

/* Links */
a {
    color: var(--hda-blue);
}

a:hover {
    color: var(--hda-blue-light);
}

/* Navbar */
.navbar {
    background-color: var(--hda-blue) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.navbar-brand img {
    filter: brightness(0) invert(1);
}

.nav-link {
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover {
    transform: translateY(-1px);
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

.dropdown-item {
    padding: 0.6rem 1rem;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(0, 74, 141, 0.1);
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--hda-blue);
    color: white;
}

/* Cards */
.card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.thesis-card:hover {
    transform: translateY(-4px);
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
    border-radius: 6px;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 8px 0 0 8px;
}

.btn-group .btn:last-child {
    border-radius: 0 8px 8px 0;
}

/* Forms */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #DEE2E6;
    padding: 0.6rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--hda-blue);
    box-shadow: 0 0 0 0.2rem rgba(0, 74, 141, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--hda-gray-dark);
}

/* Tables */
.table {
    border-radius: 12px;
    overflow: hidden;
}

.table thead th {
    font-weight: 600;
    border-bottom: 2px solid var(--hda-blue);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 74, 141, 0.05);
}

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

/* Footer - Sticky at bottom */
.footer {
    background-color: #1a4a7a !important; /* h_da blue tone */
    flex-shrink: 0;
}

.footer a {
    transition: opacity 0.2s ease;
}

.footer a:hover {
    opacity: 0.8;
}

/* Page layout for sticky footer */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page > main {
    flex: 1 0 auto;
}

/* Modal */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #DEE2E6;
}

.modal-footer {
    border-top: 1px solid #DEE2E6;
}

/* Breadcrumb */
.breadcrumb {
    background-color: white;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--hda-gray);
}

/* Loading Spinner */
.spinner-border {
    color: var(--hda-blue);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F1F1F1;
}

::-webkit-scrollbar-thumb {
    background: var(--hda-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hda-gray-dark);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }

    .card-body {
        padding: 1rem;
    }

    .display-5 {
        font-size: 1.75rem;
    }
}

@media (max-width: 576px) {
    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        border-radius: 8px !important;
        margin-bottom: 0.25rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .alert, .table {
    animation: fadeIn 0.3s ease;
}

/* Print Styles */
@media print {
    .navbar, .footer, .btn {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #DEE2E6;
    }
}

/* ========================================
   UserProfileCard Popover Styles
   Ensures the user profile card overlays
   other content properly (z-index, position)
   ======================================== */
.user-profile-dropdown {
    position: relative;
}

.user-profile-popover {
    min-width: 300px;
    /*z-index: 1050;*/ /* Above most content but below modals */
    position: absolute !important;
    transform: none !important;
}

/* Ensure dropdown doesn't get clipped by parent overflow */
.user-profile-dropdown .dropdown-menu.show {
    position: static !important;
    /*z-index: 1055;*/
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.25) !important;
}

/* Table cells should not clip the dropdown */
td .user-profile-dropdown,
.table .user-profile-dropdown {
    position: static;
}

td .dropdown-menu.show,
.table .dropdown-menu.show {
    position: static !important;
}

