/* TraxWizard Cosmic UI - styles.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
    /* Cosmic Palette */
    --bg-deep: #050507;
    --bg-surface: #0e121b;
    --bg-card: rgba(20, 25, 38, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);

    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #ec4899;
    --accent: #06b6d4;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
}

/* Base Setup */
body {
    background-color: var(--bg-deep);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15), transparent 25%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: var(--font-heading);
    color: #fff;
    letter-spacing: -0.02em;
}

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

/* Glassmorphism Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.card-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Modern Buttons */
.btn {
    border-radius: var(--radius-md);
    font-weight: 600;
    padding: 10px 24px;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
    filter: brightness(1.1);
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-outline-info {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-outline-info:hover {
    background: var(--accent);
    color: white;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #f87171);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* Icon-only buttons for bot actions */
.btn-sm i.fas {
    font-size: 1rem;
}

/* Navbar Redesign */
.navbar {
    background: rgba(5, 5, 7, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand i {
    -webkit-text-fill-color: var(--primary);
    font-size: 1.2em;
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover, .nav-link.active {
    color: #fff !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* Form Inputs */
.form-control, .form-select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    transition: all 0.3s;
}

.form-control:focus, .form-select:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    color: #fff;
}

/* Alerts */
.alert {
    background: rgba(20, 25, 38, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid;
    border-radius: var(--radius-md);
    color: #fff;
}
.alert-success { border-color: var(--success); border-left: 4px solid var(--success); }
.alert-danger { border-color: var(--danger); border-left: 4px solid var(--danger); }
.alert-info { border-color: var(--accent); border-left: 4px solid var(--accent); }

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.bg-success { background: rgba(16, 185, 129, 0.2) !important; color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.bg-danger { background: rgba(239, 68, 68, 0.2) !important; color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.bg-warning { background: rgba(245, 158, 11, 0.2) !important; color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

/* Custom Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.hero-icon {
    animation: float 6s ease-in-out infinite;
}

/* File Manager & Code Editor Overrides */
.file-manager {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
}
.file-item:hover, .folder-item:hover {
    background: rgba(255, 255, 255, 0.05);
}
.CodeMirror {
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

/* Utility */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 20px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ========================================
   RESPONSIVE DESIGN - MOBILE & TABLET
   ======================================== */

/* Large Tablets and Below (1024px and down) */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .display-3 {
        font-size: 2.5rem;
    }
}

/* Tablets (768px and down) */
@media (max-width: 768px) {
    /* Typography adjustments */
    h1, .display-3 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    h2, .display-6 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    h4 {
        font-size: 1.1rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    /* Navbar adjustments */
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-nav {
        padding: 1rem 0;
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.75rem 1rem !important;
    }
    
    /* Card adjustments */
    .card {
        margin-bottom: 1.5rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .card-header {
        padding: 1.25rem;
    }
    
    /* Button adjustments */
    .btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .btn-lg {
        padding: 14px 24px;
        font-size: 1rem;
    }
    
    .btn-sm {
        padding: 8px 16px;
        font-size: 0.875rem;
    }
    
    /* Grid adjustments */
    .row.g-4 {
        gap: 1rem !important;
    }
    
    /* Dashboard stats cards */
    .glass-panel {
        padding: 15px;
        margin-bottom: 1rem;
    }
    
    /* Hero section adjustments */
    .min-vh-75 {
        min-height: auto;
        padding: 2rem 0;
    }
    
    /* Footer adjustments */
    .footer {
        padding: 2rem 0;
        text-align: center;
    }
    
    .footer .d-flex {
        justify-content: center !important;
    }
    
    /* Table responsiveness */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Form controls */
    .form-control, .form-select {
        font-size: 16px;
    }
}

/* Mobile Phones (576px and down) */
@media (max-width: 576px) {
    /* Container adjustments */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Typography */
    h1, .display-3 {
        font-size: 1.75rem;
    }
    
    h2, .display-6 {
        font-size: 1.35rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    /* Navbar */
    .navbar {
        padding: 0.75rem 0;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-toggler {
        padding: 0.5rem;
        font-size: 1rem;
    }
    
    /* Cards */
    .card {
        border-radius: var(--radius-md);
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    /* Disable hover effects on mobile for better performance */
    .card:hover {
        transform: none;
    }
    
    /* Buttons - larger touch targets */
    .btn {
        padding: 14px 20px;
        font-size: 0.95rem;
        min-height: 44px;
    }
    
    .btn-sm {
        padding: 10px 16px;
        min-height: 40px;
    }
    
    .btn-lg {
        padding: 16px 28px;
        font-size: 1rem;
    }
    
    /* Dashboard header */
    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .d-flex.gap-3 {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem !important;
    }
    
    .d-flex.gap-3 .btn {
        width: 100%;
    }
    
    /* Bot cards - full width buttons */
    .d-grid.gap-2 {
        gap: 0.5rem !important;
    }
    
    .d-grid.gap-2.d-flex {
        flex-direction: column;
    }
    
    .d-grid.gap-2.d-flex form {
        width: 100% !important;
    }
    
    .d-grid.gap-2.d-flex .flex-grow-1 {
        width: 100%;
    }
    
    /* Alert spacing */
    .alert {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    /* Glass panel */
    .glass-panel {
        padding: 12px;
    }
    
    /* Hero section */
    .hero-icon {
        animation: none;
    }
    
    /* Modal adjustments */
    .modal-dialog {
        margin: 1rem;
    }
    
    .modal-content {
        border-radius: var(--radius-md);
    }
    
    /* Dropdown menu */
    .dropdown-menu {
        min-width: 200px;
    }
    
    /* Footer */
    .footer {
        padding: 1.5rem 0;
    }
    
    .footer .fs-4 {
        font-size: 1.2rem !important;
    }
    
    /* Stats cards - stack vertically */
    .col-md-4 {
        margin-bottom: 1rem;
    }
    
    /* Improve touch targets */
    .nav-link, .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Badge sizing */
    .badge {
        font-size: 0.75rem;
        padding: 4px 10px;
    }
    
    /* Code preview on homepage */
    pre {
        font-size: 0.75rem;
        padding: 1rem !important;
    }
}

/* Extra Small Devices (375px and down) */
@media (max-width: 375px) {
    h1, .display-3 {
        font-size: 1.5rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 12px 16px;
    }
    
    .glass-panel h3 {
        font-size: 1.1rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
}

/* Landscape orientation on phones */
@media (max-height: 500px) and (orientation: landscape) {
    .min-vh-75 {
        min-height: auto;
        padding: 1rem 0;
    }
    
    .navbar {
        padding: 0.5rem 0;
    }
    
    .hero-icon {
        display: none;
    }
}

/* Print styles */
@media print {
    .navbar, .footer, .btn, .dropdown {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}