/* Main Styles */
:root {
    --primary: #2E5A87;
    --primary-dark: #1a3a5f;
    --primary-light: #4e73df;
    --secondary: #1CC88A;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    --dark: #343a40;
    --light: #f8f9fa;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --border-radius: 12px;
    --box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f7fb;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Layout */
.container-fluid {
    padding: 20px;
}

@media (min-width: 1200px) {
    .container-fluid {
        max-width: 1400px;
        margin: 0 auto;
    }
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    margin-bottom: 1.5rem;
    overflow: hidden;
    background-color: white;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid var(--gray-light);
    padding: 1.2rem 1.5rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background-color: var(--light);
    border-top: 1px solid var(--gray-light);
    padding: 1rem 1.5rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 10px 25px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-sm {
    padding: 6px 15px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1.05rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 90, 135, 0.4);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-info {
    background-color: var(--info);
    color: white;
}

.btn-warning {
    background-color: var(--warning);
    color: var(--dark);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1rem;
}

.table thead th {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 15px;
    font-weight: 600;
    text-align: left;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(46, 90, 135, 0.05);
}

.table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--gray-light);
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(46, 90, 135, 0.05);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--dark);
}

.form-control {
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid var(--gray-light);
    transition: var(--transition);
    width: 100%;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 90, 135, 0.1);
    outline: none;
}

.form-control-lg {
    padding: 12px 20px;
    font-size: 1.05rem;
}

.form-control-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.form-select {
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid var(--gray-light);
    transition: var(--transition);
    width: 100%;
    background-color: white;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 90, 135, 0.1);
    outline: none;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group-text {
    background-color: var(--gray-light);
    border: 1px solid var(--gray-light);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group .form-control {
    flex: 1;
}

/* Form Validation */
.is-valid {
    border-color: var(--success);
}

.is-invalid {
    border-color: var(--danger);
}

.valid-feedback {
    color: var(--success);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.invalid-feedback {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Alerts */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 15px 20px;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #155724;
    border-left: 4px solid var(--success);
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: #0c5460;
    border-left: 4px solid var(--info);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
    border-left: 4px solid var(--warning);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border-left: 4px solid var(--danger);
}

.alert-dismissible {
    padding-right: 50px;
    position: relative;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
}

.alert-dismissible .btn-close:hover {
    opacity: 0.75;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-pill {
    border-radius: 50rem;
}

.badge-primary {
    background-color: var(--primary);
    color: white;
}

.badge-secondary {
    background-color: var(--secondary);
    color: white;
}

.badge-success {
    background-color: var(--success);
    color: white;
}

.badge-info {
    background-color: var(--info);
    color: white;
}

.badge-warning {
    background-color: var(--warning);
    color: var(--dark);
}

.badge-danger {
    background-color: var(--danger);
    color: white;
}

/* Progress Bars */
.progress {
    border-radius: 10px;
    height: 10px;
    background-color: var(--gray-light);
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    border-radius: 10px;
    background-color: var(--primary);
    height: 100%;
    transition: width 0.3s ease;
}

.progress-sm {
    height: 6px;
}

.progress-lg {
    height: 15px;
}

/* Navigation */
.navbar {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 15px 0;
    background-color: white !important;
}

.navbar-brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary) !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link {
    font-weight: 500;
    padding: 8px 15px !important;
    border-radius: 5px;
    transition: var(--transition);
    color: var(--dark) !important;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(46, 90, 135, 0.1);
    color: var(--primary) !important;
}

/* Dropdowns */
.dropdown-menu {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 10px 0;
    margin-top: 10px;
}

.dropdown-item {
    padding: 10px 20px;
    transition: var(--transition);
    color: var(--dark);
}

.dropdown-item:hover {
    background-color: rgba(46, 90, 135, 0.1);
    color: var(--primary);
}

/* Login/Signup Forms */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 500px;
}

.login-header {
    background: var(--primary);
    color: white;
    padding: 30px;
    text-align: center;
}

.login-body {
    padding: 40px;
    background: white;
}

/* Dashboard Cards */
.stat-card {
    border-left: 4px solid var(--primary);
    padding: 20px;
    height: 100%;
    background-color: white;
    border-radius: var(--border-radius);
}

.stat-card.success {
    border-left-color: var(--success);
}

.stat-card.info {
    border-left-color: var(--info);
}

.stat-card.warning {
    border-left-color: var(--warning);
}

.stat-card.danger {
    border-left-color: var(--danger);
}

/* Footer */
.footer {
    background-color: var(--primary);
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: white;
    text-decoration: underline;
}

/* Utility Classes */
.rounded-lg {
    border-radius: var(--border-radius);
}

.shadow-sm {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.shadow-md {
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.shadow-lg {
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.text-primary {
    color: var(--primary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-info {
    color: var(--info) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.bg-light {
    background-color: var(--light) !important;
}

/* Avatar */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--gray-light);
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-md {
    width: 48px;
    height: 48px;
}

.avatar-lg {
    width: 64px;
    height: 64px;
}

.avatar-xl {
    width: 96px;
    height: 96px;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Responsive Design */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 8px 16px;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .login-body, .card-body {
        padding: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
    
    .btn {
        display: none !important;
    }
    
    .navbar, .footer {
        display: none !important;
    }
    
    body {
        background-color: white !important;
    }
}

/* Custom Utilities */
.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.gap-4 {
    gap: 1.5rem;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-start {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.flex-column {
    flex-direction: column;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mt-0 {
    margin-top: 0 !important;
}

.w-100 {
    width: 100% !important;
}

.h-100 {
    height: 100% !important;
}

.cursor-pointer {
    cursor: pointer;
}

/* Dashboard Specific */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Form Sections */
.form-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
}

.form-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-light);
}

/* Tab Navigation */
.nav-tabs {
    border-bottom: 2px solid var(--gray-light);
    margin-bottom: 1.5rem;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--gray);
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 8px 8px 0 0;
}

.nav-tabs .nav-link:hover {
    border: none;
    color: var(--primary);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    background-color: rgba(46, 90, 135, 0.1);
    border-bottom: 2px solid var(--primary);
}

/* Modal Styles */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid var(--gray-light);
    padding: 1.5rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--gray-light);
    padding: 1rem 1.5rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Custom Components */
.upload-area {
    border: 2px dashed var(--gray-light);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition);
    background-color: white;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary);
    background-color: rgba(46, 90, 135, 0.05);
}

.upload-area.dragover {
    border-color: var(--primary);
    background-color: rgba(46, 90, 135, 0.1);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--gray-light);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -23px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--primary);
}

/* Tooltips */
.custom-tooltip {
    position: relative;
    display: inline-block;
}

.custom-tooltip .tooltip-text {
    visibility: hidden;
    background-color: var(--dark);
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    white-space: nowrap;
}

.custom-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.empty-state-description {
    color: var(--gray);
    max-width: 400px;
    margin: 0 auto;
}