/* ================================================
   GLOBAL BOOTSTRAP CUSTOM STYLES
   Mobile-First Design | Primary Theme | Enhanced
   ================================================ */

/* Import Inter Font - Optimized */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
    /* Primary Color Palette */
    --primary-color: #0d6efd;
    --primary-dark: #0a58ca;
    --primary-light: #6ea8fe;
    --primary-rgb: 13, 110, 253;
    /* Neutral Colors */
    --white: #ffffff;
    --black: #000000;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #868e96;
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-light: #e9ecef;
    /* Border & Shadow */
    --border-color: #dee2e6;
    --border-radius-sm: 0.375rem;
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    /* Typography */
    --font-size-base: 0.95rem;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.125rem;
    --line-height-base: 1.5;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ================================================
   DARK MODE SUPPORT
   ================================================ */

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark Mode Colors */
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --bg-light: #3a3a3a;
        --text-primary: #e9ecef;
        --text-secondary: #adb5bd;
        --text-muted: #6c757d;
        --border-color: #495057;
        --white: #ffffff;
        --black: #000000;
    }

    body {
        background-color: var(--bg-secondary);
        color: var(--text-primary);
    }

    .card,
    .navbar,
    .accordion-button,
    .accordion-body {
        background-color: var(--bg-primary);
        color: var(--text-primary);
    }

    .form-control,
    .form-select {
        background-color: var(--bg-primary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

        .form-control::placeholder {
            color: var(--text-muted);
        }

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

    .input-group-text {
        background-color: var(--bg-light);
        border-color: var(--border-color);
        color: var(--text-primary);
    }

    .autocomplete-dropdown {
        background-color: var(--bg-primary);
        border-color: var(--primary-color);
    }

    .autocomplete-item {
        border-color: var(--border-color);
    }

    .footer {
        background-color: #0f0f0f;
    }
}

/* Dark Mode Toggle (Manual Override) */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-light: #3a3a3a;
    --text-primary: #e9ecef;
    --text-secondary: #adb5bd;
    --text-muted: #6c757d;
    --border-color: #495057;
}

    [data-theme="dark"] body {
        background-color: var(--bg-secondary);
        color: var(--text-primary);
    }

/* ================================================
   BASE TYPOGRAPHY
   ================================================ */

* {
    font-family: var(--font-family);
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-family);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

a {
    text-decoration: none;
    transition: color 0.2s ease;
}

    a:hover {
        text-decoration: none;
    }

/* ================================================
   BUTTONS
   ================================================ */

.btn {
    font-weight: 600;
    border-radius: var(--border-radius);
    padding: 0.625rem 1.25rem;
    font-size: var(--font-size-base);
    transition: all 0.2s ease-in-out;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

    .btn:focus,
    .btn:active {
        outline: none;
        box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
    }

        /* Keyboard focus only (not mouse clicks) */
        .btn:focus:not(:focus-visible) {
            box-shadow: none;
        }

    .btn:focus-visible {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }

/* Primary Button */
.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: 2px solid var(--primary-color);
}

    .btn-primary:hover {
        background-color: var(--primary-dark);
        border-color: var(--primary-dark);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
    }

    .btn-primary:active {
        background-color: var(--primary-dark);
        transform: translateY(0);
    }

    .btn-primary:disabled {
        background-color: var(--text-muted);
        border-color: var(--text-muted);
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

/* Loading State */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

    .btn-loading::after {
        content: "";
        position: absolute;
        width: 16px;
        height: 16px;
        top: 50%;
        left: 50%;
        margin-left: -8px;
        margin-top: -8px;
        border: 2px solid transparent;
        border-top-color: currentColor;
        border-radius: 50%;
        animation: btn-spin 0.6s linear infinite;
    }

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Outline Button */
.btn-outline-primary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

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

    .btn-outline-primary:disabled {
        color: var(--text-muted);
        border-color: var(--text-muted);
        opacity: 0.6;
        cursor: not-allowed;
    }

/* Light Button */
.btn-light {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

    .btn-light:hover {
        background-color: var(--bg-light);
        border-color: var(--text-secondary);
    }

    .btn-light:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* Success Button */
.btn-success {
    background-color: #198754;
    color: var(--white);
    border: 2px solid #198754;
}

    .btn-success:hover {
        background-color: #146c43;
        border-color: #146c43;
        transform: translateY(-1px);
    }

    .btn-success:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* Button Sizes */
.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: var(--font-size-sm);
    min-height: 36px;
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: var(--font-size-lg);
    border-radius: var(--border-radius-lg);
    min-height: 52px;
}

/* Button Group */
.btn-group-vertical .btn {
    border-radius: 0;
    margin-bottom: -2px;
}

    .btn-group-vertical .btn:first-child {
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }

    .btn-group-vertical .btn:last-child {
        border-radius: 0 0 var(--border-radius) var(--border-radius);
    }

/* Rounded Circle Buttons */
.btn.rounded-circle {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================================================
   FORM CONTROLS
   ================================================ */

.form-control,
.form-select {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.625rem 0.875rem;
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background-color: var(--white);
    transition: all 0.2s ease;
    min-height: 44px;
}

    .form-control:focus,
    .form-select:focus,
    .form-control:focus-within,
    .form-select:focus-within {
        border-color: #0d6efd;
        box-shadow: 0 4px 20px rgba(13, 110, 253, 0.15);
        outline: none;
    }

        /* Keyboard focus only */
        .form-control:focus:not(:focus-visible),
        .form-select:focus:not(:focus-visible) {
            box-shadow: 0 4px 20px rgba(13, 110, 253, 0.15);
        }

    .form-control:focus-visible,
    .form-select:focus-visible {
        outline: none;
        border-color: #0d6efd;
        box-shadow: 0 4px 20px rgba(13, 110, 253, 0.15);
    }

    .form-control::placeholder {
        color: var(--text-muted);
        opacity: 1;
    }

    /* Disabled State */
    .form-control:disabled,
    .form-select:disabled {
        background-color: var(--bg-light);
        cursor: not-allowed;
        opacity: 0.6;
        color: var(--text-muted);
    }

    /* Read-only State */
    .form-control:read-only {
        background-color: var(--bg-secondary);
        cursor: default;
    }

/* Large Form Controls */
.form-control-lg,
.form-select-lg {
    padding: 0.875rem 1rem;
    font-size: var(--font-size-lg);
    border-radius: var(--border-radius-lg);
    min-height: 52px;
}

/* Form Control with Background */
.form-control.bg-light {
    background-color: var(--bg-secondary);
    border-color: var(--bg-light);
}

/* Input Groups */
.input-group {
    position: relative;
    display: flex;
}

.input-group-text {
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.625rem 0.875rem;
    font-size: var(--font-size-base);
    font-weight: 500;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.input-group-lg .input-group-text {
    padding: 0.875rem 1rem;
    font-size: var(--font-size-lg);
    min-height: 52px;
}

/*.input-group .form-control,
.input-group .form-select {
    border-left: none;
}*/

    .input-group .form-control:focus {
        z-index: 3;
    }

/* Success Input Group Text */
.input-group-text.bg-success {
    background-color: #198754;
    color: var(--white);
    border-color: #198754;
}

/* Form Labels */
.form-label {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

    .form-label.text-muted {
        color: var(--text-secondary) !important;
        font-weight: 500;
    }

/* Form Floating Labels */
.form-floating {
    position: relative;
}

    .form-floating > .form-control {
        min-height: 52px;
        padding: 1rem 0.75rem;
    }

    .form-floating > label {
        position: absolute;
        top: 0;
        left: 0;
        padding: 1rem 0.75rem;
        pointer-events: none;
        transform-origin: 0 0;
        transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
        color: var(--text-muted);
        font-size: var(--font-size-sm);
    }

/* Textarea */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Validation States */
.form-control:invalid:not(:placeholder-shown),
.form-select:invalid {
    border-color: var(--border-color);
}

.form-control:valid:not(:placeholder-shown),
.form-select:valid {
    border-color: var(--border-color);
}

    .form-control:invalid:not(:placeholder-shown):focus,
    .form-select:invalid:focus,
    .form-control:valid:not(:placeholder-shown):focus,
    .form-select:valid:focus {
        border-color: #0d6efd;
        box-shadow: 0 4px 20px rgba(13, 110, 253, 0.15);
    }

.text-danger {
    color: #dc3545 !important;
    font-size: var(--font-size-sm);
    display: block;
    margin-top: 0.25rem;
}

label .text-danger {
    display: inline !important;
    margin-top: 0 !important;
}

.text-success {
    color: #198754 !important;
    font-size: var(--font-size-sm);
    display: block;
    margin-top: 0.25rem;
}

/* ================================================
   CHECKBOXES & RADIO BUTTONS
   ================================================ */

/* Custom Checkboxes */
.form-check {
    padding-left: 1.75rem;
    min-height: 1.5rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    margin-left: -1.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    cursor: pointer;
}

    .form-check-input:checked {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
    }

    .form-check-input:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.15);
    }

    .form-check-input:focus-visible {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }

    .form-check-input:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.form-check-label {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.form-check-input:disabled ~ .form-check-label {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Radio Buttons */
.form-check-input[type="radio"] {
    border-radius: 50%;
}

/* Button-style Checkboxes */
.btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

    .btn-check:checked + label {
        background-color: var(--primary-color);
        color: var(--white);
        border-color: var(--primary-color);
    }

    .btn-check + label {
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .btn-check:checked + label .fa-regular {
        display: none;
    }

    .btn-check:checked + label .fa-solid {
        display: inline-block !important;
    }

    .btn-check + label .fa-solid {
        display: none;
    }

    .btn-check:disabled + label {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* Toggle Switches */
.form-switch {
    padding-left: 3rem;
}

    .form-switch .form-check-input {
        width: 3rem;
        height: 1.5rem;
        margin-left: -3rem;
        border-radius: 3rem;
        background-color: #ced4da;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28255, 255, 255, 1%29'/%3e%3c/svg%3e");
        background-position: left center;
        border: 2px solid #ced4da;
        cursor: pointer;
        transition: background-color 0.2s ease, border-color 0.2s ease;
    }

        .form-switch .form-check-input:checked {
            background-color: var(--primary-color);
            background-position: right center;
            border-color: var(--primary-color);
        }

        .form-switch .form-check-input:focus {
            background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28255, 255, 255, 1%29'/%3e%3c/svg%3e");
            box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.15);
        }

        .form-switch .form-check-input:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

            .form-switch .form-check-input:disabled:checked {
                background-color: var(--text-muted);
                border-color: var(--text-muted);
            }

/* ================================================
   DROPDOWNS & SELECT
   ================================================ */

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

    .form-select:focus {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%230d6efd' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    }

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    background-color: var(--white);
    border: 2px solid var(--primary-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: -2px;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-light);
    transition: background-color 0.15s ease;
}

    .autocomplete-item:hover,
    .autocomplete-item:focus {
        background-color: var(--bg-secondary);
    }

    .autocomplete-item:last-child {
        border-bottom: none;
    }

    .autocomplete-item.active {
        background-color: rgba(var(--primary-rgb), 0.1);
        color: var(--primary-color);
        font-weight: 600;
    }

/* ================================================
   LOADING STATES & SKELETONS
   ================================================ */

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-light) 25%, var(--bg-secondary) 50%, var(--bg-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--border-radius);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--border-radius-sm);
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
    border-radius: var(--border-radius-sm);
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card {
    height: 200px;
    border-radius: var(--border-radius-lg);
}

.skeleton-button {
    height: 44px;
    width: 120px;
    border-radius: var(--border-radius);
}

/* Spinner Loading */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ================================================
   CARDS & CONTAINERS
   ================================================ */

.card {
    border: none;
    border-radius: var(--border-radius-lg);
    background-color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: var(--spacing-md);
}

.card-body {
    padding: var(--spacing-lg);
}

/* Shadow variations */
.shadow-sm {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

.shadow {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.shadow-lg {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}

/* Rounded corners */
.rounded-3 {
    border-radius: var(--border-radius-lg) !important;
}

/* ================================================
   ACCORDION
   ================================================ */

.accordion-item {
    border: none;
    margin-bottom: var(--spacing-md);
    background-color: var(--white);
}

.accordion-button {
    background-color: var(--white);
    color: var(--text-primary);
    font-weight: 600;
    font-size: var(--font-size-base);
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--border-radius-lg);
    transition: all 0.2s ease;
}

    .accordion-button:not(.collapsed) {
        background-color: rgba(var(--primary-rgb), 0.05);
        color: var(--primary-color);
        box-shadow: none;
    }

    .accordion-button:focus {
        box-shadow: none;
        border-color: transparent;
    }

    .accordion-button:focus-visible {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }

    .accordion-button::after {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    }

    .accordion-button:not(.collapsed)::after {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230d6efd'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    }

.accordion-body {
    padding: var(--spacing-lg);
    background-color: var(--white);
}

/* ================================================
   ALERTS
   ================================================ */

.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: #146c43;
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: #055160;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #842029;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #664d03;
}

/* ================================================
   BADGES & TAGS
   ================================================ */

.badge {
    padding: 0.375rem 0.625rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
}

.badge-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

/* ================================================
   UTILITY CLASSES
   ================================================ */

/* Cursor Utilities */
.cursor-pointer {
    cursor: pointer !important;
}

.cursor-not-allowed {
    cursor: not-allowed !important;
}

.cursor-default {
    cursor: default !important;
}

/* Text Truncation */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Border Utilities */
.border-2 {
    border-width: 2px !important;
}

.border-3 {
    border-width: 3px !important;
}

/* Background Opacity */
.bg-opacity-10 {
    --bs-bg-opacity: 0.1;
}

/* Text Utilities */
.fw-semibold {
    font-weight: 600 !important;
}

.fw-bold {
    font-weight: 700 !important;
}

/* Spacing Utilities */
.gap-2 {
    gap: 0.5rem !important;
}

.gap-3 {
    gap: 1rem !important;
}

/* Positioning */
.position-relative {
    position: relative !important;
}

/* Visibility */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* User Select */
.user-select-none {
    user-select: none !important;
}

.user-select-all {
    user-select: all !important;
}

/* Pointer Events */
.pointer-events-none {
    pointer-events: none !important;
}

.pointer-events-auto {
    pointer-events: auto !important;
}

/* ================================================
   MOBILE OPTIMIZATION
   ================================================ */

@media (max-width: 768px) {
    /* Increase touch targets */
    .btn {
        min-height: 48px;
        padding: 0.75rem 1rem;
        font-size: 16px;
    }

    .form-control,
    .form-select {
        min-height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .form-control-lg,
    .form-select-lg {
        font-size: 16px;
        min-height: 56px;
    }

    /* Larger tap targets for checkboxes/radio */
    .form-check-input {
        width: 1.5rem;
        height: 1.5rem;
    }

    /* Sticky bottom buttons */
    .position-sticky.bottom-0 {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1030;
        background-color: var(--white);
        padding: 1rem;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    }

    /* Full width buttons on mobile */
    .btn-lg {
        width: 100%;
    }

    /* Optimize spacing */
    .card-body {
        padding: var(--spacing-md);
    }

    .accordion-button,
    .accordion-body {
        padding: var(--spacing-md);
    }

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

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    /* Better mobile typography */
    h1, .h1 {
        font-size: 1.75rem;
    }

    h2, .h2 {
        font-size: 1.5rem;
    }

    /* Mobile-friendly tables */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 576px) {
    :root {
        --spacing-lg: 1rem;
        --spacing-xl: 1.5rem;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Stack button groups on small screens */
    .btn-group {
        flex-direction: column;
    }

        .btn-group .btn {
            width: 100%;
        }
}

/* Landscape mobile optimization */
@media (max-width: 896px) and (orientation: landscape) {
    .navbar {
        padding: 0.5rem 0;
    }

    .btn {
        padding: 0.5rem 1rem;
        min-height: 40px;
    }
}

/* ================================================
   ACCESSIBILITY
   ================================================ */

/* Enhanced focus states for keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Remove focus for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: var(--white);
    padding: 8px;
    text-decoration: none;
    z-index: 9999;
}

    .skip-to-content:focus {
        top: 0;
    }

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn,
    .form-control,
    .form-select {
        border-width: 3px;
    }

    .form-check-input {
        border-width: 3px;
    }

    *:focus-visible {
        outline-width: 4px;
    }
}

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

    .skeleton {
        animation: none;
        background: var(--bg-light);
    }

    .spinner {
        animation: none;
    }
}

/* ================================================
   NAVBAR / HEADER
   ================================================ */

.navbar {
    background-color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 0.875rem 0;
    position: sticky;
    top: 0;
    z-index: 1020;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .navbar-brand:hover {
        color: var(--primary-dark);
    }

    .navbar-brand i {
        font-size: 1.75rem;
    }

.navbar-toggler {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
    min-width: 48px;
    min-height: 48px;
}

    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
        border-color: var(--primary-color);
    }

    .navbar-toggler:focus-visible {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 1.5rem;
    height: 1.5rem;
}

.navbar-nav {
    gap: 0.5rem;
}

.nav-link {
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.625rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
}

    .nav-link:hover,
    .nav-link:focus {
        color: var(--primary-color);
        background-color: rgba(var(--primary-rgb), 0.1);
    }

    .nav-link.active {
        color: var(--primary-color);
        font-weight: 600;
        background-color: rgba(var(--primary-rgb), 0.15);
    }

    .nav-link i {
        font-size: 1.1rem;
    }

/* Dropdown in Navbar */
.navbar .dropdown-menu {
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-radius: var(--border-radius-lg);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.navbar .dropdown-item {
    border-radius: var(--border-radius);
    padding: 0.625rem 1rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    min-height: 44px;
}

    .navbar .dropdown-item:hover {
        background-color: rgba(var(--primary-rgb), 0.1);
        color: var(--primary-color);
    }

    .navbar .dropdown-item i {
        width: 1.25rem;
        text-align: center;
    }

.navbar .dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--border-color);
}

/* User Profile in Navbar */
.navbar .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-fit: cover;
}

/* Scrolled Navbar State */
.navbar.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    padding: 0.5rem 0;
}

/* Mobile Navbar */
@media (max-width: 991px) {
    .navbar-collapse {
        background-color: var(--white);
        border-radius: var(--border-radius-lg);
        margin-top: 1rem;
        padding: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .navbar-nav {
        gap: 0.25rem;
    }

    .nav-link {
        padding: 0.875rem 1rem;
        font-size: 16px;
    }
}

/* ================================================
   FOOTER
   ================================================ */

.footer {
    background-color: var(--text-primary);
    color: var(--white);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

    .footer a {
        color: rgba(255, 255, 255, 0.9);
        transition: color 0.2s ease;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

        .footer a:hover {
            color: var(--white);
        }

.footer-title {
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 1.25rem;
    color: var(--white);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .footer-links li {
        margin-bottom: 0.75rem;
    }

    .footer-links a {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: var(--font-size-base);
        font-weight: 500;
    }

        .footer-links a:hover {
            padding-left: 0.5rem;
            transition: padding-left 0.2s ease;
        }

    .footer-links i {
        font-size: 0.9rem;
        width: 1.25rem;
    }

/* Footer Divider */
.footer-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin: 2rem 0 1.5rem;
}

/* Footer Bottom */
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.8);
}

.footer-copyright {
    margin: 0;
}

.footer-legal {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

    .footer-legal a {
        color: rgba(255, 255, 255, 0.8);
        font-size: var(--font-size-sm);
    }

        .footer-legal a:hover {
            color: var(--white);
            text-decoration: underline;
        }

/* Footer Logo/Brand */
.footer-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

    .footer-brand i {
        font-size: 1.75rem;
    }

.footer-description {
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--font-size-base);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Mobile Footer */
@media (max-width: 768px) {
    .footer {
        padding: 2rem 0 1rem;
        text-align: center;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-legal {
        justify-content: center;
    }

    .footer-links a {
        font-size: 16px;
        padding: 0.5rem 0;
    }
}

/* ================================================
   SOCIAL MEDIA LINKS
   ================================================ */

.social-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-size: 1.25rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

    .social-link:hover {
        transform: translateY(-3px);
        border-color: var(--white);
        background-color: rgba(255, 255, 255, 0.2);
        color: var(--white);
    }

    .social-link:focus-visible {
        outline: 3px solid var(--white);
        outline-offset: 2px;
    }

    /* Individual Social Media Colors */
    .social-link.facebook:hover {
        background-color: #1877F2;
        border-color: #1877F2;
    }

    .social-link.twitter:hover {
        background-color: #1DA1F2;
        border-color: #1DA1F2;
    }

    .social-link.instagram:hover {
        background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
        border-color: #bc1888;
    }

    .social-link.linkedin:hover {
        background-color: #0077B5;
        border-color: #0077B5;
    }

    .social-link.youtube:hover {
        background-color: #FF0000;
        border-color: #FF0000;
    }

    .social-link.whatsapp:hover {
        background-color: #25D366;
        border-color: #25D366;
    }

    .social-link.telegram:hover {
        background-color: #0088cc;
        border-color: #0088cc;
    }

    .social-link.github:hover {
        background-color: #333;
        border-color: #333;
    }

/* Social Links Light Version (for white backgrounds) */
.social-links-light .social-link {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

    .social-links-light .social-link:hover {
        color: var(--white);
    }

/* Social Links with Text */
.social-link-text {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius-lg);
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-weight: 600;
    font-size: var(--font-size-base);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-height: 48px;
}

    .social-link-text:hover {
        transform: translateY(-2px);
        background-color: rgba(255, 255, 255, 0.2);
        border-color: var(--white);
    }

    .social-link-text i {
        font-size: 1.25rem;
    }

/* ================================================
   FONT AWESOME ICON ENHANCEMENTS
   ================================================ */

/* Icon Containers */
.icon-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-lg);
    background-color: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
}

.icon-container-sm {
    width: 36px;
    height: 36px;
}

.icon-container-lg {
    width: 60px;
    height: 60px;
}

/* Icon with Circle Background */
.icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
}

/* Icon Variants */
.icon-primary {
    background-color: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
}

.icon-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.icon-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.icon-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.icon-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: #0dcaf0;
}

/* Icon Sizes */
.icon-xs {
    font-size: 0.875rem;
}

.icon-sm {
    font-size: 1rem;
}

.icon-md {
    font-size: 1.25rem;
}

.icon-lg {
    font-size: 1.5rem;
}

.icon-xl {
    font-size: 2rem;
}

.icon-2xl {
    font-size: 2.5rem;
}

/* Icon with Badge */
.icon-badge-container {
    position: relative;
    display: inline-block;
}

.icon-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #dc3545;
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.4rem;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
}

/* Icon Animations */
.icon-spin {
    animation: icon-spin 1s linear infinite;
}

@keyframes icon-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.icon-pulse {
    animation: icon-pulse 2s ease-in-out infinite;
}

@keyframes icon-pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.icon-bounce {
    animation: icon-bounce 1s ease infinite;
}

@keyframes icon-bounce {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Icon List */
.icon-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .icon-list li {
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

        .icon-list li i {
            color: var(--primary-color);
            font-size: 1.1rem;
            margin-top: 0.25rem;
            flex-shrink: 0;
        }

/* Icon Button (icon only, no text) */
.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
}

.btn-icon-sm {
    width: 40px;
    height: 40px;
}

.btn-icon-lg {
    width: 56px;
    height: 56px;
}

/* Status Icons */
.status-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.status-icon-success {
    color: #198754;
}

.status-icon-warning {
    color: #ffc107;
}

.status-icon-danger {
    color: #dc3545;
}

.status-icon i {
    font-size: 1rem;
}

/* Mobile Icon Adjustments */
@media (max-width: 768px) {
    .social-links {
        justify-content: center;
    }

    .social-link {
        width: 52px;
        height: 52px;
        font-size: 1.4rem;
    }

    .icon-container,
    .icon-circle {
        width: 52px;
        height: 52px;
    }
}

/* ================================================
   TOAST NOTIFICATIONS (Bonus for mobile)
   ================================================ */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    max-width: 350px;
}

.toast {
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    margin-bottom: 1rem;
    animation: toast-slide-in 0.3s ease;
}

@keyframes toast-slide-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 4px solid #198754;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast-info {
    border-left: 4px solid #0dcaf0;
}

@media (max-width: 768px) {
    .toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}
/* Back to Top Button */
#btn-back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    padding: 0 !important;
    line-height: 45px !important;
    background-color: var(--primary-color);
    border: none;
    text-align: center;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
    z-index: 1000;
    transition: 0.2s ease-in-out;
}

    #btn-back-to-top:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
    }

    #btn-back-to-top i {
        font-size: 1.3rem;
        vertical-align: middle;
        line-height: 1 !important;
    }
