/* ========================================
   BUKU TAMU DIGITAL - MODERN DESIGN
   Style terinspirasi dari Byrra Web
   ======================================== */

/* ========================================
   VARIABLES & COLORS
   ======================================== */
:root {
    /* Primary Colors - Sesuai Logo Kementrian */
    --primary-start: #00BCD4;
    --primary-end: #0097A7;
    --primary-gradient: linear-gradient(135deg, #00BCD4 0%, #0097A7 100%);
    
    /* Secondary Colors - Aksen Kuning dari Logo */
    --blue-400: #00BCD4;
    --blue-500: #00ACC1;
    --blue-600: #0097A7;
    --blue-700: #00838F;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
    
    /* Spacing - Mobile Optimized */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.875rem;
    --spacing-lg: 1.25rem;
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.4);
    
    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--gray-50);
    overflow-x: clip; /* CHANGED: Ganti hidden dengan clip untuk allow scroll */
    overflow-y: auto; /* ADDED: Explicitly allow vertical scroll */
    -webkit-tap-highlight-color: transparent;
    -webkit-overflow-scrolling: touch; /* ADDED: Smooth scroll di iOS */
    touch-action: pan-y pinch-zoom; /* CHANGED: Allow vertical scroll & pinch zoom */
    zoom: 88%; /* ADDED: Sesuai permintaan */
    min-height: 100vh;
    position: relative;
}

/* ========================================
   BACKGROUND GRADIENTS
   ======================================== */
.bg-gradient-primary {
    background: linear-gradient(135deg, 
        var(--primary-start) 0%, 
        var(--primary-end) 100%
    );
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.bg-gradient-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle at top right,
        rgba(96, 165, 250, 0.1) 0%,
        transparent 50%
    ),
    radial-gradient(
        circle at bottom left,
        rgba(139, 92, 246, 0.1) 0%,
        transparent 50%
    );
    pointer-events: none;
}

/* ========================================
   CARD STYLES - MODERN & PROFESSIONAL
   ======================================== */
.card {
    background: white;
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    position: relative;
    box-shadow: var(--shadow-md);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    background: var(--primary-gradient);
    color: white;
    padding: var(--spacing-xl);
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

.card-header::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 70%
    );
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.card-header h3,
.card-header h5 {
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-body {
    padding: var(--spacing-xl);
}

@media (max-width: 768px) {
    .card-body {
        padding: var(--spacing-lg);
    }
    
    .card-header {
        padding: 1.25rem 1rem;
    }
    
    .card-header h3 {
        font-size: 1.3rem;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 1rem 0.875rem;
    }
    
    .card-header h3 {
        font-size: 1.2rem;
    }
    
    .card-header img {
        height: 60px !important;
    }
}

/* ========================================
   FORM STYLES - ELEGANT & MODERN
   ======================================== */

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-700);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

@media (max-width: 768px) {
    .form-label {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .form-label {
        font-size: 1rem;
        margin-bottom: 10px;
    }
}

.form-label i {
    color: var(--primary-start);
    font-size: 1.1rem;
}

.form-control,
.form-select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--gray-900);
    background: white;
    transition: all var(--transition-normal);
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* MOBILE OPTIMIZED - Input lebih besar */
@media (max-width: 768px) {
    .form-control,
    .form-select {
        padding: 16px 18px;
        font-size: 16px;
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    .form-control,
    .form-select {
        padding: 18px 16px;
        font-size: 16px;
        min-height: 52px;
    }
}

.form-control:hover,
.form-select:hover {
    border-color: var(--gray-300);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-start);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1),
                0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.form-control-lg {
    padding: 16px 20px;
    font-size: 1.05rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

@media (max-width: 768px) {
    textarea.form-control {
        min-height: 140px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    textarea.form-control {
        min-height: 160px;
        padding: 16px;
    }
}

/* Floating label effect */
.form-floating {
    position: relative;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: translateY(-1.5rem) scale(0.85);
    color: var(--primary-start);
}

/* ========================================
   BUTTON STYLES - INTERACTIVE & SMOOTH
   ======================================== */
   
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    min-height: 48px;
}

/* MOBILE OPTIMIZED - Button lebih besar & full width */
@media (max-width: 768px) {
    .btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 1rem;
        min-height: 52px;
    }
}

@media (max-width: 480px) {
    .btn {
        width: 100%;
        padding: 18px 20px;
        font-size: 1.05rem;
        min-height: 56px;
    }
}

/* Ripple Effect */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Primary Button */
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4),
                0 0 30px rgba(102, 126, 234, 0.2);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
}

/* Success Button */
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

/* Info Button */
.btn-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn-info:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

/* Warning Button */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

/* Outline Buttons */
.btn-outline-primary {
    background: transparent;
    color: var(--primary-start);
    border: 2px solid var(--primary-start);
    box-shadow: none;
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.btn-outline-secondary {
    background: transparent;
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
    box-shadow: none;
}

.btn-outline-secondary:hover {
    background: var(--gray-700);
    color: white;
    border-color: var(--gray-700);
}

/* Button Sizes */
.btn-sm {
    padding: 10px 20px;
    font-size: 0.9rem;
    min-height: 40px;
}

.btn-lg {
    padding: 18px 40px;
    font-size: 1.1rem;
    min-height: 52px;
}

.btn-xl {
    padding: 20px 48px;
    font-size: 1.2rem;
    min-height: 56px;
}

@media (max-width: 768px) {
    .btn-sm {
        padding: 12px 20px;
        font-size: 0.95rem;
        min-height: 44px;
    }
    
    .btn-lg {
        padding: 18px 32px;
        font-size: 1.05rem;
        min-height: 56px;
    }
    
    .btn-xl {
        padding: 20px 32px;
        font-size: 1.1rem;
        min-height: 60px;
    }
}

/* Disabled State */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ========================================
   ALERT STYLES - MODERN & CLEAN
   ======================================== */
  
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: none;
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    animation: slideInDown 0.4s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .alert {
        padding: 14px 16px;
        font-size: 0.95rem;
        gap: 12px;
    }
    
    .alert i {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .alert {
        padding: 12px 14px;
        font-size: 0.9rem;
        border-radius: var(--radius-sm);
    }
}

.alert i {
    font-size: 1.3rem;
    margin-top: 2px;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-warning {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

/* ========================================
   BADGE STYLES
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
}

.badge.bg-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.badge.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.badge.bg-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
}

/* ========================================
   TABLE STYLES - ELEGANT & RESPONSIVE
   ======================================== */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: var(--spacing-lg);
}

.table thead th {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    padding: 16px;
    text-align: left;
    border: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.table thead th:first-child {
    border-top-left-radius: var(--radius-md);
}

.table thead th:last-child {
    border-top-right-radius: var(--radius-md);
}

.table tbody tr {
    background: white;
    transition: all var(--transition-fast);
}

.table tbody tr:nth-child(even) {
    background: var(--gray-50);
}

.table tbody tr:hover {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.05) 0%, 
        rgba(118, 75, 162, 0.05) 100%
    );
    transform: translateX(4px);
    box-shadow: -4px 0 0 var(--primary-start);
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-md);
}

.table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-md);
}

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

/* ========================================
   SHADOW UTILITIES - DEPTH & ELEVATION
   ======================================== */
.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow {
    box-shadow: var(--shadow-md) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.shadow-xl {
    box-shadow: var(--shadow-xl) !important;
}

.shadow-glow {
    box-shadow: var(--shadow-glow) !important;
}

/* ========================================
   ANIMATIONS - SMOOTH & PROFESSIONAL
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.fade-in-down {
    animation: fadeInDown 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.6s ease-out;
}

.scale-in {
    animation: scaleIn 0.4s ease-out;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ========================================
   LOADING SPINNER - MODERN
   ======================================== */
.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

.spinner-border-lg {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

/* ========================================
   CUSTOM SCROLLBAR - MODERN DESIGN
   ======================================== */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 10px;
    border: 2px solid var(--gray-100);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-start) var(--gray-100);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-muted {
    color: var(--gray-400) !important;
}

.text-primary {
    color: var(--primary-start) !important;
}

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fw-light {
    font-weight: 300 !important;
}

.fw-normal {
    font-weight: 400 !important;
}

.fw-medium {
    font-weight: 500 !important;
}

.fw-semibold {
    font-weight: 600 !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.rounded-sm {
    border-radius: var(--radius-sm) !important;
}

.rounded-md {
    border-radius: var(--radius-md) !important;
}

.rounded-lg {
    border-radius: var(--radius-lg) !important;
}

.rounded-xl {
    border-radius: var(--radius-xl) !important;
}

.min-vh-100 {
    min-height: 100vh !important;
}

/* ========================================
   RESPONSIVE - MOBILE FIRST OPTIMIZED
   ======================================== */

/* TABLET & SMALL DESKTOP (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
}

/* TABLET PORTRAIT (768px) */
@media (max-width: 768px) {
    :root {
        --spacing-xl: 1.25rem;
        --spacing-2xl: 1.75rem;
    }
    
    body {
        font-size: 15px;
    }
    
    .card {
        border-radius: var(--radius-md);
        margin-bottom: 1rem;
    }
    
    .card:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 12px 10px;
        font-size: 0.85rem;
    }
    
    .badge {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
}

/* MOBILE LANDSCAPE (576px - 767px) */
@media (max-width: 576px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
}

/* MOBILE PORTRAIT (480px) - ANDROID & iOS */
@media (max-width: 480px) {
    :root {
        --spacing-md: 0.75rem;
        --spacing-lg: 1rem;
        --spacing-xl: 1.25rem;
        --spacing-2xl: 1.5rem;
    }
    
    body {
        font-size: 16px;
    }
    
    /* Container & Spacing */
    .container {
        padding: 0 0.875rem;
    }
    
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    /* Card Optimization */
    .card {
        border-radius: var(--radius-sm);
        box-shadow: var(--shadow-sm);
    }
    
    .card:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }
    
    /* Typography */
    h1 { 
        font-size: 1.5rem;
        line-height: 1.3;
    }
    h2 { 
        font-size: 1.35rem;
        line-height: 1.3;
    }
    h3 { 
        font-size: 1.2rem;
        line-height: 1.4;
    }
    
    /* Table Mobile */
    .table-responsive {
        border-radius: var(--radius-sm);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px;
    }
    
    .table thead th {
        font-size: 0.8rem;
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    .table tbody td {
        font-size: 0.85rem;
        padding: 10px 8px;
    }
    
    /* Spacing Utilities */
    .mb-4 { margin-bottom: 1rem !important; }
    .mb-3 { margin-bottom: 0.75rem !important; }
    .mt-4 { margin-top: 1rem !important; }
    .mt-3 { margin-top: 0.75rem !important; }
    .p-4 { padding: 1rem !important; }
    .p-5 { padding: 1.25rem !important; }
}

/* SMALL MOBILE (360px - 400px) - Android Small */
@media (max-width: 400px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .card-body {
        padding: 0.875rem;
    }
    
    .btn {
        font-size: 0.95rem;
        padding: 16px 16px;
    }
    
    .form-control,
    .form-select {
        font-size: 16px;
        padding: 16px 14px;
    }
}

/* EXTRA SMALL MOBILE (< 360px) - Small Android */
@media (max-width: 360px) {
    body {
        font-size: 14px;
    }
    
    .card-header {
        padding: 0.875rem;
    }
    
    .card-header h3 {
        font-size: 1.1rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 14px 14px;
        min-height: 50px;
    }
    
    .form-control,
    .form-select {
        padding: 14px 12px;
        min-height: 48px;
    }
}

/* iOS SPECIFIC - Safari Fix */
@supports (-webkit-touch-callout: none) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* LANDSCAPE ORIENTATION - Mobile Horizontal */
@media (max-height: 500px) and (orientation: landscape) {
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .form-control,
    .form-select {
        padding: 10px 14px;
    }
    
    .btn {
        padding: 10px 24px;
        min-height: 44px;
    }
}

/* ========================================
   PRINT STYLES - OPTIMIZED
   ======================================== */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
    
    .btn {
        display: none;
    }
}

/* ========================================
   MOBILE TOUCH OPTIMIZATION
   ======================================== */

/* Touch-friendly clickable area */
a, button, input, select, textarea {
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
}

/* Prevent text selection on buttons */
.btn,
.badge,
.alert .btn-close {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Fix iOS input shadow */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Remove iOS input inner shadow */
input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Fix iOS select dropdown arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* Better focus visible for accessibility */
*:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

/* Optimize images for mobile */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Safe area for notched devices (iPhone X, etc) */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* ========================================
   iOS SCROLL FIX - CRITICAL
   ======================================== */

/* Ensure all scrollable containers work on iOS */
.container,
.card,
.card-body,
.table-responsive,
.alert {
    -webkit-overflow-scrolling: touch;
}

/* Fix iOS Safari scroll issue */
body, html {
    -webkit-overflow-scrolling: touch !important;
    overflow: auto !important;
}

/* Remove any height restrictions that might prevent scroll */
.min-vh-100,
.bg-gradient-primary {
    min-height: 100vh;
    height: auto;
}

/* Ensure viewport is not locked */
.row,
.col,
.col-md-6,
.col-lg-6,
.col-md-8 {
    -webkit-overflow-scrolling: touch;
}