/* ============================================================
   THEME VARIABLES
   ============================================================ */

/* Default Light Theme */
:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --card-bg: #f8f9fa;
    --border-color: #e0e0e0;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #eaeaea;
    --primary-color: #0d6efd;
    --secondary-color: #999;
    --card-bg: #1e1e1e;
    --border-color: #333;
}

/* ============================================================
   GLOBAL STYLES
   ============================================================ */

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
}

h1, h2, h3, h4, h5 {
    color: var(--text-color);
    font-weight: 600;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================================
   NAVBAR
   ============================================================ */

.navbar {
    background: var(--card-bg) !important;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s, color 0.3s;
}

.navbar .btn {
    margin-left: 5px;
}

/* Logo */
.navbar-brand img {
    height: 80px; /* clean header logo */
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
}
/* Sticky footer layout */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1 0 auto; /* expands to push footer down */
}

footer {
  flex-shrink: 0; /* footer stays pinned */
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: background 0.3s, color 0.3s;
}

/* ============================================================
   TABLES
   ============================================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

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

table th {
    background: var(--primary-color);
    color: #fff;
}

table tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] table tr:nth-child(even) {
    background: #2a2a2a;
}

[data-theme="dark"] table,
[data-theme="dark"] table td,
[data-theme="dark"] table th {
    background: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

/* ============================================================
   BADGES
   ============================================================ */

.badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: bold;
}

.badge.active {
    background: #28a745;
    color: #fff;
}

.badge.inactive {
    background: #dc3545;
    color: #fff;
}

/* ============================================================
   ACTION BUTTONS
   ============================================================ */

.action-btn {
    padding: 5px 10px;
    margin: 2px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.action-btn.reset {
    background: #ffc107;
    color: #000;
}

.action-btn.delete {
    background: #dc3545;
    color: #fff;
}

.action-btn:hover {
    opacity: 0.9;
}

/* ============================================================
   NOTIFICATIONS (Toast style)
   ============================================================ */

#notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.notification {
    margin-bottom: 10px;
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    min-width: 220px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success { background: #28a745; }
.notification.error   { background: #dc3545; }
.notification.warning { background: #ffc107; color: #000; }

/* ============================================================
   FORMS
   ============================================================ */

form input, form select, form textarea {
    width: 100%;
    padding: 10px;
    margin: 6px 0;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    transition: border 0.3s, background 0.3s;
}

form input:focus, form select:focus, form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0,123,255,0.2);
}

form h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* ============================================================
   LIST GROUP (Tools, Menus)
   ============================================================ */

.list-group {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.list-group-item {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    transition: background 0.3s, color 0.3s;
}

.list-group-item a {
    color: var(--text-color);
    text-decoration: none;
}

.list-group-item a:hover {
    text-decoration: underline;
    color: var(--primary-color);
}

[data-theme="dark"] .list-group-item {
    background: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}


/* ============================================================
   DARK MODE SPECIFIC FIXES
   ============================================================ */

[data-theme="dark"] .card,
[data-theme="dark"] .navbar,
[data-theme="dark"] footer {
    background: var(--card-bg) !important;
    color: var(--text-color) !important;
}

[data-theme="dark"] .btn-outline-secondary {
    color: var(--text-color);
    border-color: var(--border-color);
}

/* ============================================================
   LAYOUT FIXES (Sticky Footer)
   ============================================================ */

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1; /* Push footer to bottom */
}

/* dashboard stretch layout */
.site-main > .container-fluid {
  min-height: calc(100vh - 84px); /* adjust header height if different */
}
.dashboard-row {
  min-height: calc(100vh - 140px); /* safe fallback */
}
.dashboard-left, .dashboard-center, .dashboard-right {
  display: flex;
  flex-direction: column;
}
.dashboard-center .card, .dashboard-left .card, .dashboard-right .card {
  flex: 0 0 auto;
}
.dashboard-center { /* allow feed column to expand */
  min-height: 100%;
}
