/**
 * Code212 Official Design System
 * IT & Developer Theme for Libki Application
 * Version: 1.0.0
 */

/* ============================================
   CODE212 COLOR PALETTE & VARIABLES
   ============================================ */
:root {
    /* Code212 Official Brand Colors */
    --code212-black: #000000;
    --code212-dark-bg: #0a1f44;
    --code212-dark-card: #1a2332;
    --code212-magenta: #c5027f;
    --code212-green: #2cd3a3;
    --code212-purple: #6366f1;
    --code212-orange: #ff8500;
}

/* ============================================
   DARK MODE BACKGROUND
   ============================================ */
html {
    background: linear-gradient(135deg, #0a1f44 0%, #0f172a 50%, #000000 100%);
    background-attachment: fixed;
    scroll-behavior: smooth;
    min-height: 100vh;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: transparent;
    color: #e4e4e4;
    min-height: 100vh;
}

/* Subtle animated background effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(44, 211, 163, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#content {
    position: relative;
    z-index: 1;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Orbitron', 'Montserrat', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
}

/* ============================================
   GLASS MORPHISM CARDS
   ============================================ */
.glass-card {
    background: rgba(26, 35, 50, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-radius: 1.5rem;
}

.glass-card-light {
    background: rgba(26, 35, 50, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 1rem;
}

/* ============================================
   TEXT GRADIENTS
   ============================================ */
.text-gradient-code212 {
    background: linear-gradient(135deg, #2cd3a3 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-purple {
    background: linear-gradient(135deg, #6366f1 0%, #c5027f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-glow-purple {
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
}

.text-glow-green {
    text-shadow: 0 0 20px rgba(44, 211, 163, 0.6);
}

/* ============================================
   GRADIENT BACKGROUNDS
   ============================================ */
.bg-gradient-purple-magenta {
    background: linear-gradient(135deg, #6366f1 0%, #c5027f 100%);
}

.bg-gradient-green-purple {
    background: linear-gradient(135deg, #2cd3a3 0%, #6366f1 100%);
}

.bg-gradient-dark {
    background: linear-gradient(135deg, #0a1f44 0%, #000000 100%);
}

/* ============================================
   HOVER EFFECTS
   ============================================ */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(99, 102, 241, 0.3);
}

.border-glow-purple {
    border-color: rgba(99, 102, 241, 0.3);
    transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.border-glow-purple:hover {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* ============================================
   BUTTONS - CODE212 STYLE
   ============================================ */
.btn-code212 {
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.btn-code212-primary {
    background: linear-gradient(135deg, #6366f1 0%, #c5027f 100%);
    color: white;
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
}

.btn-code212-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.6);
    color: white;
}

.btn-code212-success {
    background: linear-gradient(135deg, #2cd3a3 0%, #22c55e 100%);
    color: white;
    box-shadow: 0 6px 25px rgba(44, 211, 163, 0.4);
}

.btn-code212-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(44, 211, 163, 0.6);
    color: white;
}

.btn-code212-outline {
    background: transparent;
    border-color: #6366f1;
    color: #6366f1;
}

.btn-code212-outline:hover {
    background: linear-gradient(135deg, #6366f1 0%, #c5027f 100%);
    color: white;
}

/* ============================================
   BOOTSTRAP BUTTONS OVERRIDE
   ============================================ */
.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #c5027f 100%);
    border: none;
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(135deg, #c5027f 0%, #6366f1 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.6);
}

.btn-success {
    background: linear-gradient(135deg, #2cd3a3 0%, #22c55e 100%);
    border: none;
    box-shadow: 0 6px 25px rgba(44, 211, 163, 0.4);
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    background: linear-gradient(135deg, #22c55e 0%, #2cd3a3 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(44, 211, 163, 0.6);
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border-radius: 0.75rem;
    padding: 1.5rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: start;
    gap: 1rem;
    border: 2px solid;
    font-size: 15px;
    line-height: 1.6;
}

.alert-info {
    background: linear-gradient(135deg, rgba(44, 211, 163, 0.2) 0%, rgba(99, 102, 241, 0.15) 100%);
    border-color: rgba(44, 211, 163, 0.3);
    color: #e4e4e4;
    box-shadow: 0 4px 15px rgba(44, 211, 163, 0.1);
}

.alert-success {
    background: linear-gradient(135deg, rgba(44, 211, 163, 0.2) 0%, rgba(34, 197, 94, 0.15) 100%);
    border-color: rgba(44, 211, 163, 0.3);
    color: #86efac;
    box-shadow: 0 4px 15px rgba(44, 211, 163, 0.1);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2) 0%, rgba(185, 28, 28, 0.15) 100%);
    border-color: rgba(220, 38, 38, 0.3);
    color: #fecaca;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.1);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 133, 0, 0.2) 0%, rgba(234, 88, 12, 0.15) 100%);
    border-color: rgba(255, 133, 0, 0.3);
    color: #fed7aa;
    box-shadow: 0 4px 15px rgba(255, 133, 0, 0.1);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(44, 211, 163, 0.2);
    color: #2cd3a3;
    border: 1px solid rgba(44, 211, 163, 0.4);
}

.badge-danger {
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.4);
}

.badge-warning {
    background: rgba(255, 133, 0, 0.2);
    color: #ff8500;
    border: 1px solid rgba(255, 133, 0, 0.4);
}

.badge-info {
    background: rgba(99, 102, 241, 0.2);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.4);
}

/* ============================================
   CARD COMPONENTS
   ============================================ */
.card {
    background: rgba(26, 35, 50, 0.95);
    border-radius: 1.5rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 12px 48px rgba(99, 102, 241, 0.2);
}

.card-header {
    background: linear-gradient(135deg, #6366f1 0%, #c5027f 100%);
    color: white;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
    font-weight: 600;
}

.card-body {
    padding: 2rem;
    color: white;
}

/* ============================================
   FORMS
   ============================================ */
.form-control {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(26, 35, 50, 0.6);
    border: 2px solid rgba(99, 102, 241, 0.2);
    color: #e4e4e4;
    font-size: 16px;
}

.form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(26, 35, 50, 0.8);
}

.form-control::placeholder {
    color: #8e8e8e;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
    color: #e4e4e4;
}

.input-group-addon {
    background: linear-gradient(135deg, #6366f1 0%, #c5027f 100%);
    border: 2px solid rgba(99, 102, 241, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem 0 0 0.75rem;
}

.input-group .form-control {
    border-radius: 0 0.75rem 0.75rem 0;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    background: rgba(26, 35, 50, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0.75rem;
    overflow: hidden;
    color: #e4e4e4;
}

.table thead {
    background: linear-gradient(135deg, #6366f1 0%, #c5027f 100%);
    color: white;
}

.table thead th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    border: none;
}

.table tbody td {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
}

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background: rgba(99, 102, 241, 0.1);
}

/* ============================================
   TABS
   ============================================ */
.nav-tabs {
    border-bottom: 2px solid rgba(99, 102, 241, 0.3);
}

.nav-tabs .nav-link {
    color: #e4e4e4;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 1rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.nav-tabs .nav-link.active {
    background: transparent;
    color: #6366f1;
    border-color: transparent transparent #6366f1;
}

.tab-content {
    padding: 2rem 1rem;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    background: rgba(10, 31, 68, 0.98) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    font-family: 'Orbitron', 'Montserrat', sans-serif;
    font-weight: 700;
    color: white !important;
}

.navbar-light .navbar-brand {
    color: white !important;
}

.navbar-light .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.3s ease;
    font-weight: 500;
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link:focus {
    color: #2cd3a3 !important;
    text-shadow: 0 0 10px rgba(44, 211, 163, 0.5);
}

.navbar-light .navbar-nav .nav-link i {
    color: rgba(255, 255, 255, 0.9);
}

.navbar-light .navbar-nav .nav-link:hover i {
    color: #2cd3a3;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #2cd3a3 !important;
    text-shadow: 0 0 10px rgba(44, 211, 163, 0.5);
}

/* ============================================
   CONTAINER
   ============================================ */
.container,
.container-fluid {
    color: #e4e4e4;
    position: relative;
    z-index: 1;
}

/* Fix for select dropdowns */
select.form-control {
    background-image: linear-gradient(45deg, transparent 50%, #6366f1 50%), 
                      linear-gradient(135deg, #6366f1 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(1em + 2px), 
                         calc(100% - 15px) calc(1em + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

/* DataTables wrapper styling */
.dataTables_wrapper {
    color: #e4e4e4;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: #e4e4e4;
}

.dataTables_wrapper .dataTables_filter input {
    background: rgba(26, 35, 50, 0.6);
    border: 2px solid rgba(99, 102, 241, 0.2);
    color: #e4e4e4;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #6366f1;
    outline: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #e4e4e4 !important;
    background: rgba(26, 35, 50, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: white !important;
    background: rgba(99, 102, 241, 0.4) !important;
    border: 1px solid rgba(99, 102, 241, 0.4);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    color: white !important;
    background: linear-gradient(135deg, #6366f1 0%, #c5027f 100%) !important;
    border: 1px solid #6366f1;
}

/* ============================================
   LOGIN PAGE SPECIFIC
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    max-width: 500px;
    width: 100%;
}

.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-container img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(99, 102, 241, 0.8);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

.animate-shimmer {
    animation: shimmer 3s infinite;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #000000;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #6366f1, #c5027f);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #c5027f, #6366f1);
}

/* ============================================
   MODAL Z-INDEX FIX - CRITICAL
   ============================================ */
/* Hide the Bootstrap backdrop completely and create our own */
.modal-backdrop {
    display: none !important;
}

/* Modal container - fixed positioning */
.modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 100000 !important;
    display: none !important;
    overflow: hidden !important;
    outline: 0 !important;
    background: rgba(0, 0, 0, 0.75) !important;
    padding: 0 !important;
}

.modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal.fade {
    transition: opacity 0.15s linear !important;
}

.modal.fade:not(.show) {
    opacity: 0 !important;
}

/* Modal dialog - centered and fixed */
.modal-dialog {
    position: relative !important;
    z-index: 100001 !important;
    margin: 0 auto !important;
    max-width: 500px !important;
    width: calc(100% - 2rem) !important;
    pointer-events: none !important;
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
}

.modal.show .modal-dialog {
    pointer-events: auto !important;
}

/* Modal content styling */
.modal-content {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-height: 90vh !important;
    pointer-events: auto !important;
    background: rgba(26, 35, 50, 0.98) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 2px solid rgba(99, 102, 241, 0.3) !important;
    border-radius: 1rem !important;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5) !important;
    z-index: 100002 !important;
    overflow: hidden !important;
}

.modal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 1.5rem !important;
    background: linear-gradient(135deg, #6366f1 0%, #c5027f 100%) !important;
    color: white !important;
    border-bottom: 1px solid rgba(99, 102, 241, 0.3) !important;
    border-radius: 1rem 1rem 0 0 !important;
    flex-shrink: 0 !important;
}

.modal-title {
    color: white !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

.modal-title i {
    color: white !important;
    margin-right: 0.5rem !important;
}

.modal-body {
    position: relative !important;
    flex: 1 1 auto !important;
    padding: 2rem !important;
    color: #e4e4e4 !important;
    background: rgba(26, 35, 50, 0.95) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.modal-footer {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    padding: 1rem 1.5rem !important;
    border-top: 1px solid rgba(99, 102, 241, 0.3) !important;
    background: rgba(10, 31, 68, 0.5) !important;
    border-radius: 0 0 1rem 1rem !important;
    gap: 0.5rem !important;
    flex-shrink: 0 !important;
}

.modal .close {
    padding: 0 !important;
    background-color: transparent !important;
    border: 0 !important;
    color: white !important;
    opacity: 0.9 !important;
    text-shadow: none !important;
    font-size: 2rem !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    cursor: pointer !important;
}

.modal .close:hover {
    color: white !important;
    opacity: 1 !important;
}

/* Ensure modal inputs are visible */
.modal input,
.modal select,
.modal textarea {
    position: relative !important;
    z-index: 1 !important;
}

.modal label {
    color: #e4e4e4 !important;
    font-weight: 600;
}

.modal .form-control {
    background: rgba(26, 35, 50, 0.8) !important;
    border: 2px solid rgba(99, 102, 241, 0.3) !important;
    color: #e4e4e4 !important;
}

.modal .form-control:focus {
    background: rgba(26, 35, 50, 0.95) !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

.modal .invalid-feedback {
    color: #fecaca !important;
    display: block;
}

.modal .form-control.is-invalid {
    border-color: #dc2626 !important;
}

/* Fix for buttons in modal */
.modal button {
    position: relative !important;
    z-index: 1 !important;
}

.modal .btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
}

.modal .btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #c5027f 100%) !important;
    border: none !important;
}

.modal .btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    border: none !important;
}

.modal .btn:not(.btn-primary):not(.btn-danger) {
    background: rgba(26, 35, 50, 0.6) !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    color: #e4e4e4 !important;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-white {
    color: white !important;
}

.text-muted {
    color: #8e8e8e !important;
}

.bg-light {
    background: rgba(10, 31, 68, 0.98) !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .btn-code212 {
        padding: 0.75rem 1.5rem;
    }
    
    .glass-card {
        margin: 1rem;
    }
    
    .modal-dialog {
        margin: 0.5rem !important;
        width: calc(100% - 1rem) !important;
        max-width: none !important;
    }
    
    .modal-body {
        padding: 1.5rem !important;
    }
    
    .modal-header,
    .modal-footer {
        padding: 1rem !important;
    }
}
