/* ========== Common Styles (Mobile-First Base) ========== */

:root {
    --neon-cyan: #00f2ff;
    --neon-purple: #7b2fff;
    --neon-pink: #ff00ff;
    --neon-green: #00ff88;
    --dark-bg: #0a0e27;
    --card-glass: rgba(26, 31, 58, 0.7);
    --border-glow: rgba(255, 255, 255, 0.1);
    --mobile-padding: 1rem;
    --tablet-padding: 1.5rem;
    --desktop-padding: 2rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.theme-dark {
    background: linear-gradient(135deg, #0a0e27 0%, #1a237e 50%, #0f0c29 100%);
    background-attachment: fixed;
    color: #f8f9fa;
    position: relative;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ========== Responsive Images ========== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ========== Typography Base (Mobile First) ========== */
body {
    font-size: 14px;
    line-height: 1.5;
}

h1 {
    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
}

h2 {
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
}

h3 {
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
}

h4 {
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
}

h5 {
    font-size: 15px;
    line-height: 1.4;
    font-weight: 600;
}

h6 {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
}

p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.lead {
    font-size: 16px;
    line-height: 1.7;
}

/* ========== Touch-Friendly Buttons (Mobile) ========== */
button,
.btn,
a.btn,
input[type="button"],
input[type="submit"],
.nav-link,
.dropdown-item {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 242, 255, 0.2);
}

.btn {
    padding: 0.625rem 1.25rem;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 16px;
    min-height: 48px;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 13px;
    min-height: 40px;
}

/* ========== Forms (Mobile First) ========== */
.form-control,
.form-select,
textarea.form-control {
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glow);
    color: #f8f9fa;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    font-size: 16px; /* Maintain size on focus to prevent zoom */
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 14px;
    color: #f8f9fa;
}

.input-group {
    margin-bottom: 1rem;
}

.form-check-input {
    min-width: 20px;
    min-height: 20px;
    margin-top: 0.25rem;
}

.form-check-label {
    padding-left: 0.5rem;
    font-size: 14px;
}

/* ========== Cards (Mobile First) ========== */
.card {
    background: var(--card-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    margin-bottom: 1rem;
    padding: 1rem;
}

.glass {
    background: var(--card-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glow);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.card-body {
    padding: 1rem;
}

.card-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-glow);
}

.card-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-glow);
}

.input-field {
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glow);
    color: #f8f9fa;
}

.input-field:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(0, 242, 255, 0.15);
    border-color: rgba(0, 242, 255, 0.35);
}

/* ========== Tables (Mobile: Horizontal Scroll) ========== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table {
    width: 100%;
    min-width: 600px; /* Minimum width for horizontal scroll on mobile */
    margin-bottom: 0;
}

.table thead th {
    position: sticky;
    top: 0;
    background: var(--card-glass);
    z-index: 10;
    padding: 0.75rem;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem;
    font-size: 14px;
}

/* ========== Navigation Base ========== */
.navbar {
    background: rgba(13, 26, 63, 0.7) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1000;
    transition: all 0.3s ease;
    padding: 0.75rem 0;
}

.navbar-brand {
    font-size: 1.125rem;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-toggler-icon {
    width: 24px;
    height: 24px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    margin: 0.25rem 0;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    display: block;
    text-align: left;
}

.nav-link:active {
    background: rgba(103, 126, 234, 0.3);
    transform: scale(0.98);
}

/* ========== Container Padding (Mobile) ========== */
.container {
    padding-left: var(--mobile-padding);
    padding-right: var(--mobile-padding);
}

/* ========== Utility Classes ========== */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.spacing-mobile > * + * {
    margin-top: 1rem;
}

/* ========== Animations ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ========== Loading States ========== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ========== Scrollbar Styling ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 14, 39, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-cyan), var(--neon-purple));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--neon-purple), var(--neon-pink));
}

/* ========== Print Styles ========== */
@media print {
    .navbar,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}

