/* =============================================
   Tundr Dashboard - Custom Styles
   Bootstrap 5.3 Theme Override
   ============================================= */

:root {
    /* Primary Colors */
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;

    /* Status Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --secondary: #6B7280;

    /* Background */
    --bg-primary: #F3F4F6;
    --bg-sidebar: #1F2937;
    --bg-sidebar-hover: #374151;
    --bg-card: #FFFFFF;

    /* Text */
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-light: #F9FAFB;

    /* Sidebar */
    --sidebar-width: 260px;
}

/* Global */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Wrapper */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    color: var(--text-light);
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.sidebar-brand:hover {
    color: var(--primary-light);
}

.sidebar-nav {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav .nav-header {
    padding: 0.75rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
}

.sidebar-nav .nav-item {
    margin: 0.125rem 0.75rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-link i {
    font-size: 1.125rem;
    margin-right: 0.75rem;
    width: 1.5rem;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--bg-sidebar-hover);
    color: var(--text-light);
}

.sidebar-nav .nav-link.active {
    background-color: var(--primary);
    color: var(--text-light);
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background-color: var(--bg-card);
    border-bottom: 1px solid #E5E7EB;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.page-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-dropdown {
    color: var(--text-secondary);
    text-decoration: none;
}

.user-dropdown:hover {
    color: var(--text-primary);
}

/* Content Wrapper */
.content-wrapper {
    flex: 1;
    padding: 0;
}

/* Cards */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background-color: var(--bg-card);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid #E5E7EB;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* Stat Cards */
.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card .card-body {
    padding: 1.25rem;
}

.stat-card h6 {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.stat-card h2 {
    font-size: 2rem;
    font-weight: 700;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid #E5E7EB;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #F3F4F6;
}

.table tbody tr:hover {
    background-color: #F9FAFB;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    font-size: 0.75rem;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15);
}

/* Filter Card */
.filter-card {
    background-color: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-card .form-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Alerts */
.alert-card {
    border-left: 4px solid;
    border-radius: 0.5rem;
}

.alert-card.alert-danger {
    border-left-color: var(--danger);
    background-color: #FEF2F2;
}

.alert-card.alert-warning {
    border-left-color: var(--warning);
    background-color: #FFFBEB;
}

.alert-card.alert-info {
    border-left-color: var(--info);
    background-color: #EFF6FF;
}

/* Animations */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Code/JSON display */
.code-block {
    background-color: #1F2937;
    color: #F9FAFB;
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    background-color: var(--bg-card);
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 3rem;
    color: var(--primary);
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
    color: var(--text-primary);
}

/* Details page sections */
.detail-section {
    background-color: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.detail-section h6 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #E5E7EB;
}

.detail-row {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid #F3F4F6;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 40%;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.detail-value {
    width: 60%;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block !important;
    }
}

/* Utility Classes */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
