/* assets/css/style.css */

:root {
    /* Base Colors - Futuristic Dark (Default) */
    --bg-body: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-sidebar: rgba(15, 23, 42, 0.8);
    --bg-topbar: rgba(15, 23, 42, 0.5);
    --bg-input: rgba(15, 23, 42, 0.6);
    --bg-surface: rgba(255, 255, 255, 0.05);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-inv: #ffffff;
    --border-color: rgba(255, 255, 255, 0.05);
    --border-input: rgba(255, 255, 255, 0.1);
    
    /* Dynamic primary color comes from inline CSS in header: --primary-color */
    --transition: all 0.3s ease;
}

[data-theme="light"] {
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-topbar: rgba(255, 255, 255, 0.8);
    --bg-input: #f1f5f9;
    --bg-surface: rgba(0, 0, 0, 0.05);
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-inv: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-input: rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, var(--primary-dim), transparent 25%),
        radial-gradient(circle at 85% 30%, var(--primary-dim), transparent 25%);
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 14px; /* Normalized base font size */
}

/* Sidebar */
.sidebar {
    width: 240px; /* Slightly narrower */
    background: var(--bg-sidebar);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar-header {
    padding: 25px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.logo-box {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 0 15px var(--primary-dim);
}

.sidebar-header h2 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover, .sidebar-nav li a.active {
    color: var(--primary-color);
    background: var(--primary-dim);
    border-left-color: var(--primary-color);
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--border-color);
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.topbar {
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    background: var(--bg-topbar);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--primary-color);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 14px;
}

.content-container {
    padding: 25px;
    flex: 1;
    overflow-y: auto;
    width: 100%;
    max-width: 1400px; /* Normalize content size */
    margin: 0 auto; /* Center content */
}

/* Cards & Forms */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    padding: 15px; /* Reduced from 20px */
    margin-bottom: 15px; /* Reduced from 20px */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.card-header {
    margin-bottom: 12px; /* Reduced from 15px */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    color: var(--text-main);
    font-size: 15px;
    transition: var(--transition);
}

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

select.form-control option {
    background: var(--bg-body);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 15px var(--primary-dim);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--primary-dim);
}

/* Login Page specific */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card .logo-box {
    margin: 0 auto 20px auto;
    width: 60px;
    height: 60px;
    font-size: 30px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    margin-bottom: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px; /* Slightly smaller for density */
    white-space: nowrap; /* Prevent wrapping in cells unless necessary */
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

/* Allow certain columns to wrap */
td.wrap {
    white-space: normal;
}

th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--primary-dim);
}

.badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-active {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge-died {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Grid System - Tighter Spacing */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -8px;
}
.col-md-12 {
    width: 100%;
    padding: 8px;
}
.col-md-10 {
    width: 83.333%;
    padding: 8px;
}
.col-md-8 {
    width: 66.666%;
    padding: 8px;
}
.col-md-7 {
    width: 58.333%;
    padding: 8px;
}
.col-md-6 {
    width: 50%;
    padding: 8px;
}
.col-md-5 {
    width: 41.666%;
    padding: 8px;
}
.col-md-4 {
    width: 33.333%;
    padding: 8px;
}
.col-md-3 {
    width: 25%;
    padding: 8px;
}
@media (max-width: 1024px) {
    .col-md-8, .col-md-7, .col-md-6, .col-md-5, .col-md-4, .col-md-3 {
        width: 50%;
    }
}
@media (max-width: 768px) {
    .col-md-12, .col-md-10, .col-md-8, .col-md-7, .col-md-6, .col-md-5, .col-md-4, .col-md-3 {
        width: 100%;
    }
    .login-wrapper {
        padding: 20px;
        height: auto;
        min-height: 100vh;
    }
    .landing-main-card {
        padding: 40px 20px !important;
    }
}
/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}
input:checked + .slider {
  background-color: var(--primary-color);
}
input:focus + .slider {
  box-shadow: 0 0 1px var(--primary-color);
}
input:checked + .slider:before {
  transform: translateX(22px);
}
.slider.round {
  border-radius: 24px;
}
.slider.round:before {
  border-radius: 50%;
}
