/* assets/css/style.css */
:root {
    --primary-color: #8B0000; /* Blood Red */
    --primary-hover: #a00000;
    --secondary-color: #ffffff;
    --bg-light: #f4f6f9;
    --text-dark: #333;
    --text-muted: #6c757d;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--primary-color);
    color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 2000; /* High z-index for mobile overlay */
}

.sidebar.collapsed {
    transform: translateX(-100%);
    margin-left: 0; /* Use transform for performance */
}

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.sidebar-menu li a {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: 0.2s;
    font-size: 15px;
}

.sidebar-menu li a:hover, .sidebar-menu li a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left: 4px solid #fff;
}

.sidebar-menu li a i {
    width: 25px;
    margin-right: 10px;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    overflow-x: hidden;
    margin-left: 260px;
    transition: all 0.3s ease;
}

.main-content.full-width {
    margin-left: 0;
}

.top-navbar {
    background: #fff;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.container-fluid {
    padding: 30px;
}

/* Common Components */
.card, .form-card, .table-container {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.card h4, .form-card h4, .table-container h4 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.card h4 i, .form-card h4 i, .table-container h4 i {
    margin-right: 12px;
}

/* Form Styling */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #444;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.2);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

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

.table th {
    text-align: left;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 2px solid var(--border-color);
    font-weight: 700;
    font-size: 14px;
    color: #555;
}

/* Layout Helpers */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.col-left { flex: 1; min-width: 300px; }
.col-right { flex: 2; min-width: 300px; }

@media (max-width: 768px) {
    .row { gap: 15px; }
    .col-left, .col-right { flex: 1 1 100%; min-width: 100%; }
}

/* Main Content */
.main-content {
    flex-grow: 1;
    overflow-x: hidden;
    margin-left: 260px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.full-width {
    margin-left: 0;
}

/* Table Responsive Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

/* Elegant Cards */
.card-stats {
    background: white;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.card-stats:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-stats .icon {
    width: 60px;
    height: 60px;
    background: #f8f9fa;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.card-stats .info h5 { margin: 0; font-size: 14px; color: var(--text-muted); font-weight: 600; }
.card-stats .info h2 { margin: 5px 0 0; font-size: 28px; font-weight: 700; color: var(--text-dark); }

@media (min-width: 769px) {
    .d-md-none { display: none !important; }
}

@media (max-width: 992px) {
    .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .sidebar { 
        width: 100% !important; 
        height: 100vh;
        z-index: 3000;
    }
    .sidebar.collapsed {
        transform: translateX(-100%) !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 5px !important; /* Minimal padding for full screen */
    }
    .container-fluid {
        padding: 10px !important; /* Edge-to-edge content */
    }
    .main-footer {
        margin-left: 0 !important;
        padding: 15px !important;
    }
    .nav-right span {
        display: none;
    }
    .top-navbar {
        padding: 10px !important;
        margin-bottom: 10px;
    }
    .table-container, .form-card, .card {
        padding: 15px !important;
        margin-bottom: 15px !important;
        border-radius: 8px !important;
    }
    .card-stats {
        padding: 12px;
        gap: 12px;
    }
    .card-stats .icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    .card-stats .info h2 {
        font-size: 20px;
    }
    .dashboard-hero {
        padding: 15px !important;
        margin-bottom: 15px !important;
        border-radius: 8px !important;
    }
    .dashboard-stats-row {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    .grid-2, .grid-3, .grid-4 { 
        grid-template-columns: 1fr; 
        gap: 15px !important;
    }
}

/* Special styling for Large Data/Code areas */
.code-editor {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
    background: #0d1117;
    color: #e6edf3;
    border-radius: 8px;
    padding: 20px;
    min-height: 400px;
}

/* Status Badges */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background: #e6fffa; color: #047481; border: 1px solid #b2f5ea; }
.badge-danger { background: #fff5f5; color: #c53030; border: 1px solid #feb2b2; }
.badge-info { background: #ebf8ff; color: #2b6cb0; border: 1px solid #bee3f8; }
.badge-warning { background: #fffaf0; color: #9c4221; border: 1px solid #feebc8; }

/* Elegant Footer & Red Line Effect */
.main-footer {
    padding: 20px 30px;
    background: #fff;
    margin-left: 260px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.main-footer.full-width {
    margin-left: 0;
}

.main-footer p {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

.footer-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    background-size: 200% 100%;
    animation: moveLine 3s linear infinite;
}

@keyframes moveLine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}
