:root {
    /* Base colors */
    --bg-dark: #1a2035;
    --bg-light: #242b42;
    --bg-lighter: #2e3446;
    --text-primary: #ffffff;
    --text-secondary: #b4b6bb;
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    
    /* Card colors */
    --card-blue: #1f4b8d;
    --card-green: #1e884a;
    --card-yellow: #946c00;
    --card-info: #216b82;
    --card-purple: #563d7c;
    --card-teal: #00796b;
    
    /* Status colors */
    --error-color: #e74c3c;
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
    --info-color: #2196F3;
}

/* Base Styles */
html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-dark) !important;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Page Titles */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--text-primary) !important;
}

.page-title {
    color: var(--text-primary) !important;
    margin-bottom: 1.5rem;
}

/* Top Bar and Logo */
.top-bar {
    background: var(--bg-light);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    padding: 1rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo a {
    transition: opacity 0.2s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo a:hover {
    opacity: 0.9;
    text-decoration: none;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 14px;
    font-weight: 500;
    margin-top: 2px;
    color: var(--text-primary);
}

/* User Menu */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-menu-button {
    color: var(--text-primary);
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-menu-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-light);
    min-width: 160px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border-radius: 4px;
    padding: 0.5rem 0;
    z-index: 1001;
    margin-top: 0.5rem;
}

.user-menu-content.show {
    display: block;
}

.user-menu-content hr {
    margin: 0.5rem 0 !important;
    border: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    opacity: 0.8 !important;
}

.user-menu-content a {
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
}

.user-menu-content a:hover {
    background: var(--bg-lighter);
    color: var(--text-primary);
    text-decoration: none;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-primary);
}

/* Dashboard Container */
.dashboard-container {
    margin-top: 80px;
    padding: 2rem;
    background: var(--bg-dark);
}

/* Alternating colors for user review cards */
#userReviewContainer .card:nth-child(odd) {
    background-color: var(--bg-light) !important;
}

#userReviewContainer .card:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* Cards */
.card {
    background: var(--bg-light) !important;
    border: none !important;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
    transition: all 0.3s ease !important;
}

.stats-card {
    transition: transform 0.2s;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background: rgba(255, 255, 255, 0.05) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary);
    padding: 1rem;
}

.card-body {
    color: var(--text-secondary);
    padding: 1.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 500px;
}

.modal-content {
    position: relative;
    background-color: var(--bg-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.3rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1rem;
    color: var(--text-secondary);
}

/* Notes styling moved to responsive-demo-table.css */

/* ========== DEMOS TABLE STYLING ========== */
/* Table styling moved to responsive-demo-table.css */

/* Header styling moved to responsive-demo-table.css */

/* Cell styling moved to responsive-demo-table.css */

/* ========== DEMOS TABLE CONTAINER STYLING ========== */
/* Table container and scrollbar styling moved to responsive-demo-table.css */

.card-footer {
    background: rgba(255, 255, 255, 0.05) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 1rem;
}

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

.card-footer a:hover {
    text-decoration: underline;
}

.card .stretched-link {
    color: var(--text-primary) !important;
    text-decoration: none;
}

.card .stretched-link:hover {
    text-decoration: underline;
}

/* Card Colors */
.bg-primary, .card.bg-primary {
    background-color: var(--card-blue) !important;
}

.bg-success, .card.bg-success {
    background-color: var(--card-green) !important;
}

.bg-warning, .card.bg-warning {
    background-color: var(--card-yellow) !important;
}

.bg-info, .card.bg-info {
    background-color: var(--card-info) !important;
}

.bg-purple, .card.bg-purple {
    background-color: var(--card-purple) !important;
}

.bg-teal, .card.bg-teal {
    background-color: var(--card-teal) !important;
}

/* Card Text Colors */
.card.bg-primary,
.card.bg-success,
.card.bg-warning,
.card.bg-info,
.card.bg-purple,
.card.bg-teal,
.card.text-white {
    color: var(--text-primary) !important;
}

.card.bg-primary .text-white,
.card.bg-success .text-white,
.card.bg-warning .text-white,
.card.bg-info .text-white,
.card.bg-purple .text-white,
.card.bg-teal .text-white,
.card .text-white {
    color: var(--text-primary) !important;
}

.card.bg-primary .small,
.card.bg-success .small,
.card.bg-warning .small,
.card.bg-info .small,
.card.bg-purple .small,
.card.bg-teal .small {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Tables */
.table {
    color: var(--text-primary) !important;
    margin: 0 !important;
    background-color: var(--bg-light) !important;
    border-spacing: 0 !important;
    border-collapse: collapse !important;
}

/* Table Headers */
.table thead th,
.table > thead > tr > th,
table.dataTable thead th,
.dataTables_wrapper table thead th {
    background-color: var(--bg-lighter) !important;
    color: var(--text-primary) !important;
    border: none !important;
    padding: 1rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-size: 1rem !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    vertical-align: middle !important;
}

/* Table Body */
.table tbody tr,
table.dataTable tbody tr {
    color: var(--text-primary) !important;
}

/* Alternating Row Colors */
.table tbody tr:nth-child(odd),
table.dataTable tbody tr:nth-child(odd) {
    background-color: var(--bg-light) !important;
}

.table tbody tr:nth-child(even),
table.dataTable tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* Table Cells */
.table td,
table.dataTable td {
    border: none !important;
    padding: 1rem !important;
    color: var(--text-primary) !important;
    vertical-align: middle !important;
}

/* DataTables Specific */
.dataTables_wrapper {
    color: var(--text-primary) !important;
    background-color: var(--bg-light) !important;
}

/* Remove sorting icons */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    background-image: none !important;
    padding-right: 1rem !important;
}

/* DataTables controls */
.dataTables_length,
.dataTables_filter,
.dataTables_info,
.dataTables_paginate {
    padding: 1rem !important;
    color: var(--text-primary) !important;
}

/* DataTables form controls */
.dataTables_length select,
.dataTables_filter input {
    background: var(--bg-lighter) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    padding: 0.375rem 0.75rem !important;
}

.page-link {
    background: var(--bg-lighter) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
}

/* Pagination active state */
.page-item.active .page-link {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Buttons */
.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--text-primary);
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background-color: #bb2d3b;
    border-color: #b02a37;
}

/* Alerts */
.alert {
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: var(--card-green);
    border-color: var(--card-green);
    color: white;
}

.alert-info {
    background-color: var(--card-info);
    border-color: var(--card-info);
    color: white;
}

/* Device Management Specific */
.device-card {
    background: var(--bg-lighter);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: transform 0.2s;
}

.device-card:hover {
    transform: translateY(-2px);
}

.device-card.current {
    border: 1px solid var(--primary-color);
}

.device-info {
    padding: 1rem;
}

.device-name {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.device-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.current-device-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* Modal Styling */
.modal .modal-content {
    background-color: var(--bg-dark) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.modal .modal-header {
    background-color: var(--bg-light) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.modal .modal-footer {
    background-color: var(--bg-light) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.modal .modal-title {
    color: var(--text-primary) !important;
}

.modal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
}

.modal .modal-body {
    background-color: var(--bg-dark) !important;
    color: var(--text-primary) !important;
}

/* Form controls within modals */
.modal .form-control,
.modal .form-select {
    background-color: var(--bg-light) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
}

.modal .form-control:focus,
.modal .form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25) !important;
}

.modal .form-control::placeholder {
    color: var(--text-secondary) !important;
}

.modal .form-label {
    color: var(--text-primary) !important;
}

/* Form error messages */
.email-error-message,
.phone-error-message,
.website-error-message,
.error-message {
    color: #ff4444;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Modal table styling */
.modal .table {
    color: var(--text-primary) !important;
}

.modal .table thead th {
    background-color: var(--bg-light) !important;
    color: var(--text-primary) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.modal .table tbody tr:nth-child(odd) {
    background-color: var(--bg-dark) !important;
}

.modal .table tbody tr:nth-child(even) {
    background-color: var(--bg-light) !important;
}

.modal .table td {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Toggle switch in modals */
.modal .toggle-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal .toggle-label {
    color: var(--text-primary) !important;
}

/* Small text and muted text in modals */
.modal .text-muted,
.modal small {
    color: var(--text-secondary) !important;
}

/* Toggle Switch Styles */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 32px;
    font-size: 0.875rem;
    white-space: nowrap;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    min-width: 50px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--success-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-label {
    color: var(--text-primary);
    user-select: none;
    font-size: 0.875rem;
}

/* Utility Classes */
.text-white {
    color: var(--text-primary) !important;
}

.border-top {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Performance Page Styles */
.performance-card {
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: transform 0.2s;
}

.performance-card:hover {
    transform: translateY(-2px);
}

.performance-card .card-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.performance-card .card-text {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.performance-card .progress {
    background-color: rgba(255, 255, 255, 0.1);
    height: 8px;
    border-radius: 4px;
}

.performance-card .progress-bar {
    background-color: var(--primary-color);
    border-radius: 4px;
}

.performance-table th {
    background-color: var(--bg-lighter);
    color: var(--text-primary);
    font-weight: 600;
}

.performance-table td {
    color: var(--text-secondary);
}

.performance-chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 1.5rem;
}

.import-section {
    background: var(--bg-lighter);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.import-section .form-label {
    color: var(--text-primary);
    font-weight: 500;
}

.import-section .form-control {
    background-color: var(--bg-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.import-section .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.import-section .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.import-section .btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Global Toast Notification Styles */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 200px;
    padding: 15px;
    border-radius: 5px;
    z-index: 9999;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    display: none;
}

.toast.show {
    display: block;
    animation: fadeIn 0.5s;
}

.toast.error {
    background-color: #dc3545;
    color: white;
}

.toast.success {
    background-color: #198754;
    color: white;
}

/* Bootstrap Toast Container - Global z-index fix */
.toast-container {
    z-index: 1060 !important;
}

/* Copy notification toast styles */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.copy-notification {
    background-color: #198754;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

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

.copy-notification.bg-danger {
    background-color: #dc3545 !important;
}

.copy-notification.bg-success {
    background-color: #198754 !important;
}
