/* LibSchoolPay Custom Styles - Liberian Flag Theme */
:root {
    --color-bg: #FFFFFF;
    --color-fg: #002868;
    --color-accent: #BF0A30;
    --color-light: #f8f9fa;
    --color-border: #dee2e6;
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-danger: #dc3545;
    --color-info: #17a2b8;
}

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-fg);
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-fg);
    font-weight: 600;
}

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

.text-accent {
    color: var(--color-accent) !important;
}

/* Button Styles */
.btn-primary {
    background-color: rgba(0, 40, 104, 0.9);
    border-color: rgba(0, 40, 104, 0.9);
    font-weight: 500;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: rgba(0, 26, 74, 0.9);
    border-color: rgba(0, 26, 74, 0.9);
    box-shadow: 0 0 0 0.2rem rgba(0, 40, 104, 0.25);
}

.btn-accent {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
    font-weight: 500;
}

.btn-accent:hover,
.btn-accent:focus {
    background-color: #a00825;
    border-color: #a00825;
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(191, 10, 48, 0.25);
}

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

.btn-outline-primary:hover {
    background-color: rgba(0, 40, 104, 0.9);
    border-color: rgba(0, 40, 104, 0.9);
}

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

.nav-link {
    font-weight: 500;
    color: var(--color-fg) !important;
}

.nav-link:hover {
    color: var(--color-accent) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(0, 40, 104, 0.85) 0%, rgba(0, 58, 140, 0.85) 100%);
    position: relative;
    overflow: hidden;
}

.hero-icon {
    font-size: 8rem;
    opacity: 0.2;
}

.flag-pattern {
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, 
        transparent 40%, 
        rgba(191, 10, 48, 0.1) 40%, 
        rgba(191, 10, 48, 0.1) 60%, 
        transparent 60%
    );
    transform: rotate(45deg);
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-light);
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

/* Step Icons */
.step-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(0, 40, 104, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Feather Icons */
.feather-sm {
    width: 16px;
    height: 16px;
}

.feather-lg {
    width: 48px;
    height: 48px;
}

.feather-xl {
    width: 64px;
    height: 64px;
}

.feather-xs {
    width: 14px;
    height: 14px;
}

/* Success Page Styles */
.success-icon {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.checkmark-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: var(--color-success);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: checkmark-bounce 0.6s ease-in-out;
}

.checkmark {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: white;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px var(--color-success);
    animation: fill 0.4s ease-in-out 0.4s forwards, scale 0.3s ease-in-out 0.9s both;
    position: relative;
}

.checkmark::after {
    content: '✓';
    color: white;
    font-size: 3rem;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes checkmark-bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -10px, 0);
    }
    70% {
        transform: translate3d(0, -5px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* Forms */
.form-control:focus {
    border-color: rgba(0, 40, 104, 0.8);
    box-shadow: 0 0 0 0.2rem rgba(0, 40, 104, 0.25);
}

.form-check-input:checked {
    background-color: rgba(0, 40, 104, 0.9);
    border-color: rgba(0, 40, 104, 0.9);
}

.is-invalid {
    border-color: var(--color-danger);
}

/* Status Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

.bg-primary {
    background-color: rgba(0, 40, 104, 0.9) !important;
}

/* Admin Layout */
.admin-layout {
    background-color: #f8f9fa;
}

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background: linear-gradient(180deg, rgba(0, 40, 104, 0.95) 0%, rgba(0, 26, 74, 0.95) 100%);
    color: white;
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.admin-content {
    margin-left: 260px;
    min-height: 100vh;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
}

.sidebar-nav .nav-item {
    margin-bottom: 0.25rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--color-accent);
}

.sidebar-nav .nav-link i {
    margin-right: 0.75rem;
    width: 18px;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-header {
    background: white;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.admin-main {
    padding: 2rem;
}

/* Stats Cards */
.stats-card {
    border-left: 4px solid var(--color-fg);
    transition: all 0.3s ease;
}

.stats-card:hover {
    border-left-color: var(--color-accent);
}

.stats-today {
    border-left-color: var(--color-info);
}

.stats-week {
    border-left-color: var(--color-success);
}

.stats-month {
    border-left-color: var(--color-fg);
}

.stats-schools {
    border-left-color: var(--color-accent);
}

.stats-icon {
    opacity: 0.3;
}

/* Status Indicators */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

/* Tables */
.table th {
    border-top: none;
    font-weight: 600;
    color: var(--color-fg);
    background-color: var(--color-light);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 40, 104, 0.02);
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, var(--color-fg) 0%, #003a8c 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

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

.alert-info {
    background-color: rgba(0, 40, 104, 0.1);
    color: var(--color-fg);
    border-left: 4px solid var(--color-fg);
}

/* Pagination */
.page-link {
    color: var(--color-fg);
}

.page-link:hover {
    color: var(--color-fg);
    background-color: rgba(0, 40, 104, 0.1);
    border-color: var(--color-fg);
}

.page-item.active .page-link {
    background-color: var(--color-fg);
    border-color: var(--color-fg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    .hero-icon {
        font-size: 4rem;
    }
    
    .stats-card .card-body {
        text-align: center;
    }
}

/* Custom Utilities */
.min-vh-50 {
    min-height: 50vh;
}

.border-accent {
    border-color: var(--color-accent) !important;
}

.bg-accent {
    background-color: var(--color-accent) !important;
}

/* Focus Styles for Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Stripe Elements Styling */
.StripeElement {
    background-color: white;
    transition: box-shadow 150ms ease;
}

.StripeElement--focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 40, 104, 0.25);
}

.StripeElement--invalid {
    border-color: var(--color-danger);
}

/* Animation for loading states */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Print Styles */
@media print {
    .admin-sidebar,
    .admin-header,
    .btn,
    .alert {
        display: none !important;
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--color-fg);
    }
    
    .btn-outline-primary {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
