/* assets/css/style.css */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-body: #f8fafc;
    --bg-sidebar: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;

    --accent-primary: #4f46e5;
    /* Indigo */
    --accent-hover: #4338ca;
    --accent-glow: rgba(79, 70, 229, 0.3);

    --border-color: #e2e8f0;

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --sidebar-width: 260px;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    border-radius: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

/* Sidebar */
.glass-sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    min-height: 100vh;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
    z-index: 100;
}

@media (min-width: 768px) {
    .glass-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        overflow-y: auto;
    }

    /* Adjust Main Content to account for fixed sidebar */
    main {
        margin-left: 16.666667%;
        /* 2/12 columns for LG */
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    main {
        margin-left: 25%;
        /* 3/12 columns for MD */
    }
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--accent-primary);
    background-color: #f1f5f9;
}

.nav-link.active {
    background-color: var(--accent-primary);
    color: white !important;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.nav-link.active i {
    color: white !important;
}

.nav-link i {
    color: var(--text-secondary);
    transition: color 0.2s;
}

/* Typography & Elements */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.025em;
}

.text-muted {
    color: var(--text-secondary) !important;
}

.btn-primary {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px var(--accent-glow);
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

.form-control,
.form-select {
    background-color: white;
    border: 1px solid var(--border-color);
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Login Page Specific */
.login-body {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: centered;
}

/* Tables */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-primary);
}

.table-hover tbody tr:hover td {
    background-color: #f8fafc;
}

/* Status Badges & Colors */
.text-danger {
    color: #ef4444 !important;
}

.text-warning {
    color: #f59e0b !important;
}

.text-success {
    color: #10b981 !important;
}

.text-secondary {
    color: #94a3b8 !important;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
}

/* Mobile App Optimizations */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 0.5rem 0;
    z-index: 1050;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
    text-align: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    display: block;
    margin-bottom: 0.1rem;
}

.bottom-nav-item.active {
    color: var(--accent-primary);
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

/* Mobile-specific adjustments */
@media (max-width: 767.98px) {
    body {
        padding-bottom: 80px;
        /* Space for bottom nav */
    }

    /* Hide Sidebar completely on mobile */
    .glass-sidebar {
        display: none !important;
    }

    /* Show Bottom Nav */
    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }

    /* Mobile Header */
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border-color);
        z-index: 1040;
        display: flex;
        align-items: center;
        padding: 0 1rem;
    }

    /* Adjust Main Content */
    main {
        margin-left: 0 !important;
        padding-top: 150px !important;
        /* Space for Mobile Header */
        margin-top: 20px !important;
    }

    /* Mobile Cards for Tables */
    .mobile-card-view thead {
        display: none;
    }

    .mobile-card-view tbody tr {
        display: block;
        background: white;
        border-radius: 1rem;
        margin-bottom: 1rem;
        box-shadow: var(--card-shadow);
        border: 1px solid var(--border-color);
        padding: 1.25rem;
        position: relative;
    }

    .mobile-card-view tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px dashed var(--border-color);
        text-align: right;
    }

    .mobile-card-view tbody td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .mobile-card-view tbody td:first-child {
        padding-top: 0;
    }

    .mobile-card-view tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.85rem;
        margin-right: 1rem;
        text-align: left;
    }

    /* Specific adjustments for log details on mobile */
    .mobile-card-view tbody td[data-label="Details"] {
        display: block;
        text-align: left;
    }

    .mobile-card-view tbody td[data-label="Details"]::before {
        display: block;
        margin-bottom: 0.25rem;
    }

    /* Make charts responsive container */
    canvas {
        max-height: 250px !important;
    }
}