/**
 * DomainTigr Base Theme (Themable via CSS Variables)
 */

:root {
    /* Colors */
    --primary-bg: #f4f6f9;
    --sidebar-bg: #272b30;
    --card-bg: #ffffff;
    --accent: #007bff;
    --text-main: #333333;
    --text-muted: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    
    /* Spacing */
    --spacer: 15px;
    --radius: 8px;
    
    /* Fonts */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-main);
    font-family: var(--font-family);
    margin: 0;
    overflow-y: scroll; /* Persistent scrollbar for layout stability */
}

/* Custom Scrollbar Styling for a seamless look */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

::-webkit-scrollbar-thumb {
    background: #ccc; /* Subtle light grey */
    border-radius: 5px;
    border: 2px solid var(--primary-bg); /* Padding effect */
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Dark Mode Scrollbar Overrides */
body.theme-dark ::-webkit-scrollbar-track {
    background: var(--primary-bg);
}
body.theme-dark ::-webkit-scrollbar-thumb {
    background: #444;
    border: 2px solid var(--primary-bg);
}

/* Base Component Styles */
.tigr-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: var(--spacer);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: var(--spacer);
}

.tigr-btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

.tigr-btn-primary { background: var(--accent); color: white; }
.tigr-btn-danger { background: var(--danger); color: white; }
.tigr-btn-warning { background: #e67e22; color: white; }

.tigr-btn.btn-sm { font-size: 0.75rem; padding: 4px 10px; }

.tigr-table {
    width: 100%;
    border-collapse: collapse;
}

.tigr-table th, .tigr-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

/* Layout Engine */
.tigr-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.tigr-sidebar {
    flex: 0 0 250px;
    background: var(--sidebar-bg);
    color: white;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.tigr-main {
    flex: 1;
    padding: 30px;
    background: var(--primary-bg);
    min-width: 0;
    overflow-x: auto;
}

.tigr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

/* Navigation */
.tigr-nav-item {
    padding: 12px;
    cursor: pointer;
    color: #adb5bd;
    text-decoration: none;
    display: block;
    transition: all 0.2s;
    font-weight: 500;
}

.tigr-nav-item:hover, .tigr-nav-item.active {
    color: white;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.tigr-nav-item.accent {
    color: var(--accent);
    font-weight: 600;
}

/* Dashboard Grid */
.tigr-widget-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.tigr-widget {
    flex: 0 0 calc(50% - 10px);
    min-width: 0;
}

.tigr-widget.full {
    flex: 0 0 100%;
}

/* Helper Classes for Themeing */
.tigr-flex-between { display: flex; justify-content: space-between; align-items: center; }
.tigr-flex-row { display: flex; gap: 20px; align-items: flex-start; }
.tigr-grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.tigr-stat-box {
    background: var(--primary-bg);
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid rgba(0,0,0,0.05);
}

.tigr-stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; margin-bottom: 5px; }
.tigr-stat-value { font-size: 1.25rem; font-weight: 700; color: var(--text-main); }
.tigr-stat-value.success { color: var(--success); }
.tigr-stat-value.danger { color: var(--danger); }

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

.tigr-section {
    margin-top: 16px;
}

.tigr-form-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.tigr-link-bold { text-decoration: none; font-weight: 700; color: var(--accent); }
.tigr-link-bold:hover { text-decoration: underline; }

.tigr-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}
.tigr-badge.warning, .tigr-badge.badge-warning { background: #fff3cd; color: #856404; }
.tigr-badge.success, .tigr-badge.badge-success { background: #e6f4ea; color: #28a745; }
.tigr-badge.danger,  .tigr-badge.badge-danger  { background: #fde8e8; color: #dc3545; }
.tigr-badge.info,    .tigr-badge.badge-info    { background: #e7f3ff; color: #007bff; }

.tigr-alert {
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: var(--spacer);
    border-left: 5px solid transparent;
}
.tigr-alert.success { background: #d4edda; color: #155724; border-color: var(--success); }
.tigr-alert.danger { background: #f8d7da; color: #721c24; border-color: var(--danger); }
.tigr-alert.warning { background: #fff3cd; color: #856404; border-color: var(--warning); }

/* Form Utilities */
.tigr-input,
.tigr-select,
.tigr-textarea {
    width: 100%;
    margin-bottom: 8px;
}

.tigr-textarea {
    min-height: 80px;
}

/* Splash */
.tigr-splash {
    margin: 0;
    background: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.tigr-splash-title {
    font-family: system-ui, sans-serif;
    font-size: clamp(2.2rem, 7vw, 4rem);
    letter-spacing: 0.06em;
    margin: 0;
}

/* Utilities */
.m-0 { margin: 0 !important; }
.mt-20 { margin-top: 20px !important; }
.mb-20 { margin-bottom: 20px !important; }

/* RESPONSIVE: Mobile Adjustments */
@media (max-width: 768px) {
    .tigr-widget {
        flex: 0 0 100%;
    }
}

@media (max-width: 768px) {
    .tigr-layout {
        flex-direction: column;
    }

    .tigr-sidebar {
        flex: 0 0 auto;
        width: 100%;
        padding: 10px;
    }

    .sidebar-title {
        text-align: center;
        margin: 10px 0;
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        gap: 5px;
    }

    .tigr-nav-item {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .tigr-main {
        padding: 15px;
    }

    .tigr-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .tigr-header h1 {
        font-size: 1.5em;
        margin: 0;
    }
}

/* THEME: Dark Mode Overrides (Example) */
body.theme-dark {
    --primary-bg: #1a1d20;
    --card-bg: #2b3035;
    --text-main: #f8f9fa;
    --text-muted: #adb5bd;
}
