/* ==========================================
   GLOBAL STYLES (base.html)
   ========================================== */
body {
    font-family: 'Poppins', sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   NAVBAR
   ========================================== */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 10px 0;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%) !important;
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.navbar-brand i {
    font-size: 1.5rem;
}

.navbar .nav-link {
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navbar .nav-link:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

.navbar .nav-link i {
    margin-right: 5px;
}

/* User dropdown */
.user-dropdown .dropdown-toggle::after {
    display: none;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.dropdown-menu {
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border: none;
    padding: 8px 0;
    min-width: 200px;
    animation: fadeInDown 0.3s ease;
}

.dropdown-item {
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: #f0f4ff;
    color: #0d6efd;
}

.dropdown-item i {
    width: 20px;
    margin-right: 10px;
    color: #718096;
}

.dropdown-item:hover i {
    color: #0d6efd;
}

.dropdown-divider {
    margin: 8px 0;
}

.dropdown-header {
    padding: 8px 20px;
    font-weight: 600;
    color: #2d3748;
}

.dropdown-header small {
    display: block;
    font-weight: 400;
    color: #718096;
    font-size: 12px;
}

/* ==========================================
   MESSAGES
   ========================================== */
.messages-container {
    margin-bottom: 20px;
}

.alert {
    border-radius: 12px;
    border: none;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    animation: slideInRight 0.5s ease;
}

.alert i {
    font-size: 1.5rem;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */
main {
    flex: 1;
}

/* ==========================================
   BACK TO TOP BUTTON
   ========================================== */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: none;
    z-index: 99;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: white;
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

#backToTop.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

#backToTop:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 25px rgba(13, 110, 253, 0.4);
}

#backToTop:active {
    transform: scale(0.95);
}

/* ==========================================
   LOADING OVERLAY
   ========================================== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.loading-spinner {
    text-align: center;
    background: white;
    padding: 40px 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease;
}

.loading-spinner .spinner-border {
    width: 4rem;
    height: 4rem;
}

.loading-spinner p {
    margin-top: 15px;
    font-weight: 500;
    color: #2d3748;
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
    margin-top: auto;
    background: white !important;
    border-top: 1px solid #e9ecef;
}

.footer p {
    font-size: 14px;
}

/* ==========================================
   DASHBOARD / STAT CARDS
   ========================================== */
.stat-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 15px;
    overflow: hidden;
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    opacity: 0.9;
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(-5deg);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.bg-gradient-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}
.bg-gradient-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
.bg-gradient-warning {
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
}
.bg-gradient-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}
.bg-gradient-purple {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   RECENT DOCUMENTS
   ========================================== */
.recent-doc-item {
    border-radius: 10px !important;
    margin-bottom: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
    cursor: pointer;
}

.recent-doc-item:hover {
    background: #f8f9fa;
    border-color: #0d6efd;
    transform: translateX(5px);
}

.recent-doc-item .doc-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f4ff;
    color: #0d6efd;
}

/* ==========================================
   QUICK ACTION BUTTONS
   ========================================== */
.quick-action-btn {
    border-radius: 12px;
    padding: 15px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: white;
    border: 1px solid #e9ecef;
    text-decoration: none;
    color: #2d3748;
    display: block;
}

.quick-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border-color: #0d6efd;
    text-decoration: none;
    color: #0d6efd;
}

.quick-action-btn i {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.quick-action-btn .action-label {
    font-weight: 500;
    font-size: 0.9rem;
}

.quick-action-btn .action-desc {
    font-size: 0.75rem;
    color: #718096;
}

/* ==========================================
   STATUS BADGE
   ========================================== */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.status-badge.bg-secondary {
    background: #e9ecef !important;
    color: #495057;
}

.status-badge.bg-success {
    background: #d4edda !important;
    color: #155724;
}

.status-badge.bg-warning {
    background: #fff3cd !important;
    color: #856404;
}

.status-badge.bg-danger {
    background: #f8d7da !important;
    color: #721c24;
}

.status-badge.bg-info {
    background: #cce5ff !important;
    color: #004085;
}

/* ==========================================
   WELCOME SECTION
   ========================================== */
.welcome-section {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border-radius: 15px;
    padding: 25px 30px;
    color: white;
    margin-bottom: 25px;
}

.welcome-section h1 {
    font-weight: 600;
    font-size: 1.8rem;
}

.welcome-section .welcome-sub {
    opacity: 0.9;
    font-size: 1rem;
}

/* ==========================================
   EMPTY STATE
   ========================================== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 4rem;
    color: #cbd5e0;
    margin-bottom: 15px;
}

.empty-state h5 {
    color: #4a5568;
    margin-bottom: 10px;
}

.empty-state p {
    color: #718096;
    max-width: 400px;
    margin: 0 auto;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 992px) {
    .stat-card .stat-number {
        font-size: 2rem;
    }
    .welcome-section h1 {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    .navbar .nav-link {
        padding: 10px 15px;
    }
    .navbar-nav {
        margin-top: 10px;
    }
    .alert {
        padding: 12px 15px;
    }
    .alert i {
        font-size: 1.2rem;
    }
    .stat-card .stat-number {
        font-size: 1.8rem;
    }
    .welcome-section {
        padding: 20px;
    }
    .welcome-section h1 {
        font-size: 1.4rem;
    }
    .quick-action-btn {
        padding: 12px 15px;
    }
    .quick-action-btn i {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .stat-card .stat-number {
        font-size: 1.5rem;
    }
    .loading-spinner {
        padding: 25px 30px;
    }
    #backToTop {
        width: 40px;
        height: 40px;
        font-size: 16px;
        bottom: 20px;
        right: 20px;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.text-gradient {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-hover {
    transition: all 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
}

.cursor-pointer {
    cursor: pointer;
}

.transition-all {
    transition: all 0.3s ease;
}