/* Responsive Design Improvements */

/* User Avatar */
.user-avatar { 
    width: 32px; 
    height: 32px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background-color: #3b82f6; 
    color: white; 
    border-radius: 50%; 
    transition: all 0.2s ease; 
}

.user-avatar:hover { 
    transform: scale(1.05); 
}

/* Mobile menu styles */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: #1e4db8;
        padding: 1rem;
        border-radius: 0.5rem;
        margin-top: 0.5rem;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    }
    
    .navbar-nav {
        width: 100%;
    }
    
    .navbar-nav .nav-item {
        margin: 0.25rem 0;
        width: 100%;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 0.375rem;
        display: flex;
        align-items: center;
        width: 100%;
    }
    
    .navbar-nav .nav-link i {
        margin-right: 0.5rem;
        width: 20px;
        text-align: center;
    }
    
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        border: none;
        background-color: transparent;
        padding: 0;
        margin: 0.5rem 0 0 1.5rem;
    }
    
    .dropdown-item {
        color: rgba(255, 255, 255, 0.8);
        padding: 0.5rem 1rem;
    }
    
    .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: white;
    }
    
    .dropdown-divider {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin: 0.5rem 0;
    }
    
    .user-avatar {
        margin-right: 0.5rem;
    }
}

/* Base Styles */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.2s ease-in-out;
}
html {
    font-size: 16px;
}

body {
    overflow-x: hidden;
}

/* Navigation */
.navbar {
    padding: 0.75rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    padding: 0.5rem 0;
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
    font-weight: 500;
}

/* Mobile Menu */
.navbar-toggler {
    padding: 0.5rem 0.75rem;
    border: none;
    box-shadow: none !important;
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

/* Form Elements */
.form-control, 
.form-select,
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 1rem;
}

/* Responsive Tables */
.table-responsive {
    margin-bottom: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Cards */
.card {
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* Buttons */
.btn {
    white-space: nowrap;
}

/* Spacing Utilities */
.py-section {
    padding: 3rem 0;
}

/* Responsive Images */
.img-fluid {
    max-width: 100%;
    height: auto;
}

/* Responsive Typography */
h1, .h1 { 
    font-size: 2rem; 
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

h2, .h2 { 
    font-size: 1.75rem; 
    line-height: 1.25;
    margin-bottom: 1.25rem;
}

h3, .h3 { 
    font-size: 1.5rem; 
    line-height: 1.3;
    margin-bottom: 1rem;
}

h4, .h4 { 
    font-size: 1.25rem; 
    line-height: 1.35;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Custom Container */
.custom-container {
    width: 100%;
    padding-right: 1rem;
    padding-left: 1rem;
    margin-right: auto;
    margin-left: auto;
}

/* Media Queries */
/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .custom-container {
        max-width: 540px;
    }
    
    .py-section {
        padding: 3.5rem 0;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .custom-container {
        max-width: 720px;
    }
    
    .py-section {
        padding: 4rem 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .custom-container {
        max-width: 960px;
    }
    
    .py-section {
        padding: 5rem 0;
    }
    
    .navbar-expand-lg .navbar-nav .nav-link {
        padding-right: 1rem;
        padding-left: 1rem;
    }
}

/* X-Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .custom-container {
        max-width: 1140px;
    }
}

/* XX-Large devices (larger desktops, 1400px and up) */
@media (min-width: 1400px) {
    .custom-container {
        max-width: 1320px;
    }
}

/* Back to top button */
#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    border: none;
    background-color: var(--primary-color);
    color: white;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* Responsive tables */
.table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead th {
    background-color: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Form elements */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.15);
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn i {
    margin-right: 0.5rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
}

.alert-dismissible .btn-close {
    padding: 1rem;
}

/* Navigation */
.nav-pills .nav-link {
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: var(--transition);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--primary-color);
    color: white;
}

/* Footer */
footer {
    background-color: #f8f9fa;
    border-top: 1px solid var(--border-color);
}

footer h5 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 1.25rem;
}

footer .nav-link {
    padding: 0.25rem 0;
    color: var(--text-muted);
    transition: var(--transition);
}

footer .nav-link:hover {
    color: var(--primary-color);
    padding-left: 0.25rem;
}

/* Responsive adjustments for mobile */
@media (max-width: 767.98px) {
    .py-section {
        padding: 2rem 0;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-group .btn {
        width: auto;
    }
    
    #backToTop {
        width: 2.5rem;
        height: 2.5rem;
        bottom: 1rem;
        right: 1rem;
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Print styles */
@media print {
    .no-print, 
    .navbar,
    .footer {
        display: none !important;
    }
    
    body {
        padding: 0;
        background: white;
    }
    
    .container {
        width: auto;
        max-width: 100%;
        padding: 0;
    }
}
