/**
 * Jharkhand Directory - Main Stylesheet
 * Version: 1.0.0
 * Developer: SolutionJunction.in
 * 
 * Comprehensive responsive styling for public and admin interfaces
 * Includes Bootstrap 5 overrides, custom components, animations
 */

:root {
    /* Brand Colors */
    --primary-color: #0B6B57;
    --primary-dark: #074a3d;
    --primary-light: #0d8659;
    --accent-color: #D4941F;
    --accent-dark: #b8790a;
    --accent-light: #e6b84d;

    /* Neutral Colors */
    --text-primary: #18352E;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --bg-lighter: #ffffff;
    --border-color: #dee2e6;

    /* Dark Theme (Admin) */
    --dark-bg: #1a1a1a;
    --dark-bg-secondary: #222222;
    --dark-bg-tertiary: #2a2a2a;
    --dark-text: #ffffff;
    --dark-text-muted: #b0b0b0;
    --dark-border: #404040;

    /* Status Colors */
    --status-success: #28a745;
    --status-danger: #dc3545;
    --status-warning: #ffc107;
    --status-info: #17a2b8;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-secondary: 'Poppins', sans-serif;

    /* Border Radius */
    --border-radius-sm: 0.25rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 1rem;

    /* Shadows */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 2rem rgba(0, 0, 0, 0.2);
}

/* ============================================
   1. GLOBAL STYLES
   ============================================ */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ============================================
   2. TYPOGRAPHY
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-secondary);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.1rem;
}

h6 {
    font-size: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

code,
pre {
    font-family: 'Monaco', 'Courier New', monospace;
    background-color: var(--bg-light);
    border-radius: var(--border-radius-md);
    padding: 0.25rem 0.5rem;
}

pre {
    padding: 1rem;
    overflow-x: auto;
}

/* ============================================
   3. NAVIGATION & HEADER
   ============================================ */

.navbar {
    background-color: var(--bg-lighter);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color) !important;
    font-family: var(--font-secondary);
    letter-spacing: -0.5px;
}

.navbar-nav .nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    position: relative;
    transition: color 0.2s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after {
    width: 100%;
}

.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link.active::after {
    width: 100%;
}

/* ============================================
   4. BUTTONS
   ============================================ */

.btn {
    font-weight: 600;
    border-radius: var(--border-radius-md);
    padding: 0.5rem 1.5rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn:hover,
.btn:focus {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    color: white;
}

.btn-secondary {
    background-color: var(--accent-color);
    color: white;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--accent-dark);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* ============================================
   5. CARDS
   ============================================ */

.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    background-color: var(--bg-lighter);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.card-header {
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
}

.card-title {
    font-family: var(--font-secondary);
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================
   6. FORMS
   ============================================ */

.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: var(--bg-lighter);
    color: var(--text-primary);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(11, 107, 87, 0.25);
    color: var(--text-primary);
    background-color: var(--bg-lighter);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.invalid-feedback {
    color: var(--status-danger);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.is-invalid {
    border-color: var(--status-danger);
}

.is-invalid:focus {
    border-color: var(--status-danger);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* ============================================
   7. ALERTS & BADGES
   ============================================ */

.alert {
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 1rem 1.25rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-left-color: var(--status-success);
    color: var(--status-success);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-left-color: var(--status-danger);
    color: var(--status-danger);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-left-color: var(--status-warning);
    color: #856404;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    border-left-color: var(--status-info);
    color: var(--status-info);
}

.badge {
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: var(--border-radius-md);
    font-size: 0.8rem;
    font-family: var(--font-primary);
}

.badge-primary {
    background-color: var(--primary-color);
}

.badge-secondary {
    background-color: var(--accent-color);
}

.badge-success {
    background-color: var(--status-success);
}

.badge-danger {
    background-color: var(--status-danger);
}

/* ============================================
   8. TABLES
   ============================================ */

.table {
    border-collapse: collapse;
}

.table th {
    background-color: var(--bg-light);
    color: var(--text-primary);
    font-weight: 700;
    border-bottom: 2px solid var(--border-color);
    padding: 1rem;
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: rgba(11, 107, 87, 0.05);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--bg-light);
}

/* ============================================
   9. PAGINATION
   ============================================ */

.pagination {
    gap: 0.25rem;
}

.page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.page-item.disabled .page-link {
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ============================================
   10. MODALS
   ============================================ */

.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.modal-title {
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.btn-close {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.btn-close:hover {
    opacity: 1;
}

/* ============================================
   11. FOOTER
   ============================================ */

footer {
    background-color: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: auto;
    border-top: 3px solid var(--accent-color);
}

footer h6 {
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

footer a {
    color: rgba(255, 255, 255, 0.8);
}

footer a:hover {
    color: var(--accent-color);
}

footer .footer-credit {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   12. HERO & SECTIONS
   ============================================ */

.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0;
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
}

.hero h1 {
    color: white;
    font-size: 2.5rem;
}

.hero p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.1rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

/* ============================================
   13. BREADCRUMB
   ============================================ */

.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item {
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: var(--primary-color);
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
}

.breadcrumb-item.active {
    color: var(--accent-color);
}

/* ============================================
   14. LISTS
   ============================================ */

.list-group-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    border-color: var(--primary-color);
    background-color: rgba(11, 107, 87, 0.05);
    transform: translateX(4px);
}

.list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ============================================
   15. SPINNERS & LOADERS
   ============================================ */

.spinner-border {
    color: var(--primary-color);
}

.spinner-grow {
    background-color: var(--primary-color);
}

/* ============================================
   16. UTILITY CLASSES
   ============================================ */

.text-primary {
    color: var(--primary-color) !important;
}

.text-accent {
    color: var(--accent-color) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-light {
    background-color: var(--bg-light) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.rounded {
    border-radius: var(--border-radius-md) !important;
}

.rounded-lg {
    border-radius: var(--border-radius-lg) !important;
}

/* ============================================
   17. GRADIENTS
   ============================================ */

.gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.gradient-accent {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
}

/* ============================================
   18. RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero h1 {
        font-size: 1.75rem;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .table {
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* ============================================
   19. ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-in-left {
    animation: slideInLeft 0.3s ease;
}

.slide-in-right {
    animation: slideInRight 0.3s ease;
}

.pulse {
    animation: pulse 2s infinite;
}

/* ============================================
   20. ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    :root {
        --primary-color: #054a37;
        --primary-dark: #032e24;
        --text-primary: #000000;
        --text-muted: #404040;
        --border-color: #000000;
    }
}

/* Print styles */
@media print {
    body {
        background-color: white;
        color: black;
    }

    a {
        text-decoration: underline;
    }

    .navbar,
    footer,
    .btn,
    .no-print {
        display: none;
    }
}