/* Dashboard Styles */
:root {
    /* Light theme variables */
    --bg-primary: #f8fafc;
    --bg-secondary: rgba(255, 255, 255, 0.9);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: rgba(226, 232, 240, 0.8);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --grid-color: #e2e8f0;
    --hover-bg: rgba(59, 130, 246, 0.1);
    --card-bg: #ffffff;
    --text-muted: #6b7280;
    --primary-color: #3b82f6;
    --accent-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --danger-color: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
}

/* Dark theme variables */
[data-theme="dark"] {
    --bg-primary: #0f0f0f;
    --bg-secondary: rgba(20, 20, 30, 0.9);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --border-color: rgba(168, 49, 147, 0.3);
    --shadow-color: rgba(168, 49, 147, 0.1);
    --grid-color: rgba(168, 49, 147, 0.15);
    --hover-bg: rgba(168, 49, 147, 0.2);
    --card-bg: rgba(20, 20, 30, 0.9);
    --text-muted: #a0a0b0;
    --primary-color: #a831e6;
    --accent-color: #a831e6;
    --secondary-color: #6366f1;
    --danger-color: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.1);
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme Toggle Styles - From Uiverse.io by JkHuger */
.theme-toggle-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.l {
    display: block;
    margin-bottom: 1.5em;
    font-size: 1em;
    cursor: pointer;
}

.l {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 0.75em;
    box-shadow: 0.125em 0.125em 0 0.125em rgba(0, 0, 0, 0.3) inset;
    color: #fdea7b;
    display: inline-flex;
    align-items: center;
    margin: auto;
    padding: 0.15em;
    width: 3em;
    height: 1.5em;
    transition:
        background-color 0.1s 0.3s ease-out,
        box-shadow 0.1s 0.3s ease-out;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.l:before,
.l:after {
    content: "";
    display: block;
}

.l:before {
    background-color: #d7d7d7;
    border-radius: 50%;
    width: 1.2em;
    height: 1.2em;
    transition:
        background-color 0.1s 0.3s ease-out,
        transform 0.3s ease-out;
    z-index: 1;
}

.l:after {
    background:
        linear-gradient(transparent 50%, rgba(0, 0, 0, 0.15) 0) 0 50% / 50% 100%,
        repeating-linear-gradient(90deg, #bbb 0, #bbb, #bbb 20%, #999 20%, #999 40%)
        0 50% / 50% 100%,
        radial-gradient(circle at 50% 50%, #888 25%, transparent 26%);
    background-repeat: no-repeat;
    border: 0.25em solid transparent;
    border-left: 0.4em solid #d8d8d8;
    border-right: 0 solid transparent;
    transition:
        border-left-color 0.1s 0.3s ease-out,
        transform 0.3s ease-out;
    transform: translateX(-22.5%);
    transform-origin: 25% 50%;
    width: 1.2em;
    height: 1em;
    box-sizing: border-box;
}

/* Checked */
.l:checked {
    background-color: rgba(0, 0, 0, 0.45);
    box-shadow: 0.125em 0.125em 0 0.125em rgba(0, 0, 0, 0.1) inset;
}

.l:checked:before {
    background-color: currentColor;
    transform: translateX(125%);
}

.l:checked:after {
    border-left-color: currentColor;
    transform: translateX(-2.5%) rotateY(180deg);
}

/* Other States */
.l:focus {
    outline: 0;
}

/* Header Styles */
.header-section {
    padding: 1.5rem 0 1rem 0;
    margin-bottom: 2rem;
}

.welcome-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.5rem 0;
}

.welcome-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, #a83193, #d946ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(168, 49, 147, 0.2);
    letter-spacing: -0.02em;
}

.welcome-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.logo-user-avatar-container {
    display: flex;
    filter: drop-shadow(0 4px 8px rgba(168, 49, 147, 0.3));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.hub-logo {
    max-width: 150px;
    height: auto;
}

.hub-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 12px rgba(168, 49, 147, 0.4));
}

/* Text section styles */
.text-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .welcome-section {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .welcome-title {
        font-size: 2.2rem;
    }
    
    .hub-logo {
        max-width: 140px;
    }
}

@media (max-width: 480px) {
    .welcome-title {
        font-size: 1.8rem;
    }
    
    .welcome-subtitle {
        font-size: 0.9rem;
    }
    
    .hub-logo {
        max-width: 120px;
    }
}

/* Background Styles */
.dark-circuit-wrapper {
    min-height: 100vh;
    width: 100%;
    position: relative;
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease;
}

.dark-circuit-background {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    transition: opacity 0.3s ease;
}

/* Light theme grid */
.dark-circuit-background {
    background-image: linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: 20px 30px;
    -webkit-mask-image: radial-gradient(
        ellipse 70% 60% at 50% 0%,
        #000 60%,
        transparent 100%
    );
    mask-image: radial-gradient(
        ellipse 70% 60% at 50% 0%,
        #000 60%,
        transparent 100%
    );
}

/* Dark theme circuit pattern */
[data-theme="dark"] .dark-circuit-background {
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 19px,
        var(--grid-color) 19px,
        var(--grid-color) 20px,
        transparent 20px,
        transparent 39px,
        var(--grid-color) 39px,
        var(--grid-color) 40px
    ),
    repeating-linear-gradient(
        90deg,
        transparent,
        transparent 19px,
        var(--grid-color) 19px,
        var(--grid-color) 20px,
        transparent 20px,
        transparent 39px,
        var(--grid-color) 39px,
        var(--grid-color) 40px
    ),
    radial-gradient(
        circle at 20px 20px,
        var(--grid-color) 2px,
        transparent 2px
    ),
    radial-gradient(
        circle at 40px 40px,
        var(--grid-color) 2px,
        transparent 2px
    );
    background-size: 40px 40px, 40px 40px, 40px 40px, 40px 40px;
    -webkit-mask-image: none;
    mask-image: none;
}

.content-wrapper {
    position: relative;
    z-index: 2;
    background: transparent;
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, #a83193 0%, #a83193 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(168, 49, 147, 0.3);
}

.controls-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px var(--shadow-color);
    margin-bottom: 2rem;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px var(--shadow-color);
    margin-bottom: 2rem;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.user-username {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.metric-cell {
    font-weight: 500;
    text-align: center;
}

.engagement-bar {
    background: linear-gradient(90deg, #a83193, #a83193);
    height: 4px;
    border-radius: 2px;
    margin-top: 0.25rem;
}

/* Engagement number styling for better visibility */
.metric-cell strong {
    color: var(--text-primary);
    font-weight: 600;
}

[data-theme="dark"] .metric-cell strong {
    color: #ffffff;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.3);
}

.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: all 0.3s ease;
}

.sortable:hover {
    background-color: rgba(168, 49, 147, 0.1);
    color: #a83193;
}

.sort-icon {
    margin-left: 0.5rem;
    opacity: 0.5;
}

.sort-icon.active {
    opacity: 1;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: #a0a0b0;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Pagination styles */
.pagination {
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination .page-item {
    list-style: none;
}

.pagination .page-link {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagination .page-link:hover {
    background: var(--bg-primary);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 49, 147, 0.3);
}

.pagination .page-item.active .page-link {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(168, 49, 147, 0.4);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* Community badge button styles */
a.btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 49, 147, 0.3);
    border-color: var(--accent-color) !important;
}

/* Powered by badge hover */
[href*="lumincrypto"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 49, 147, 0.3);
    border-color: var(--accent-color) !important;
}

.search-box {
    position: relative;
}

.search-box .fa-search {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0a0b0;
}

.search-box input {
    padding-left: 2.5rem;
    background: rgba(30, 30, 40, 0.8);
    border: 1px solid rgba(168, 49, 147, 0.3);
    color: #ffffff;
}

.search-box input:focus {
    background: rgba(30, 30, 40, 1);
    border-color: #a83193;
    box-shadow: 0 0 0 0.2rem rgba(168, 49, 147, 0.25);
    color: #ffffff;
}

.form-select {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-select:focus {
    background: var(--card-bg);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
    color: var(--text-primary);
    outline: none;
}

[data-theme="dark"] .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(168, 49, 147, 0.25);
}

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

.stats-summary {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #a83193;
}

.stat-label {
    color: #a0a0b0;
    font-size: 0.9rem;
}

.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(168, 49, 147, 0.2);
}

.table {
    background: transparent;
    color: var(--text-primary);
    margin-bottom: 0;
}

.table th {
    background: rgba(168, 49, 147, 0.1);
    border-top: none;
    border-bottom: 1px solid rgba(168, 49, 147, 0.3);
    font-weight: 600;
    color: var(--text-primary);
    padding: 1rem 0.75rem;
}

.table td {
    border-bottom: 1px solid rgba(168, 49, 147, 0.1);
    padding: 1rem 0.75rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: rgba(168, 49, 147, 0.05);
}

.badge-metric {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px var(--shadow-color);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px var(--shadow-color);
    border-color: #a83193;
}

.stat-sublabel {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.user-avatar-container {
    display: flex;
    justify-content: center;
}

/* Button group styles */
.btn-group {
    display: inline-flex;
    gap: 0.5rem;
}

.btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: var(--hover-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
}

.btn.active,
.btn-group .btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .btn.active,
[data-theme="dark"] .btn-group .btn.active {
    box-shadow: 0 4px 12px rgba(168, 49, 147, 0.4);
}

/* ========================================
   RESPONSIVE STYLES - Mobile & Tablet
   ======================================== */

/* Large tablets and small desktops (1024px and below) */
@media (max-width: 1024px) {
    .container {
        padding: 1rem;
    }
    
    .stats-summary {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .stat-card {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 200px;
    }
}

/* Tablets (768px and below) */
@media (max-width: 768px) {
    /* Header adjustments */
    .welcome-title {
        font-size: 2rem;
    }
    
    .hub-logo {
        max-width: 120px;
    }
    
    /* Table responsive - horizontal scroll */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
        font-size: 0.85rem;
    }
    
    table th,
    table td {
        padding: 0.5rem;
        white-space: nowrap;
    }
    
    /* User avatar smaller */
    .user-avatar {
        width: 40px;
        height: 40px;
    }
    
    /* Stats cards - full width */
    .stat-card {
        flex: 1 1 100%;
    }
    
    .stats-summary {
        flex-direction: column;
    }
    
    /* Pagination smaller */
    .pagination .page-link {
        padding: 0.4rem 0.6rem;
        min-width: 35px;
        font-size: 0.85rem;
    }
    
    /* Button group wrap */
    .btn-group {
        flex-wrap: wrap;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    /* Filters section */
    .row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .col-md-4,
    .col-md-6,
    .col-md-12 {
        width: 100%;
    }
}

/* Mobile phones (480px and below) */
@media (max-width: 480px) {
    /* Typography */
    .welcome-title {
        font-size: 1.5rem;
    }
    
    .welcome-subtitle {
        font-size: 0.85rem;
    }
    
    /* Logo */
    .hub-logo {
        max-width: 100px;
    }
    
    /* Cards and containers */
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    /* Table - more compact */
    table {
        font-size: 0.75rem;
    }
    
    table th,
    table td {
        padding: 0.4rem;
    }
    
    /* Hide less important columns on mobile */
    .hide-mobile {
        display: none;
    }
    
    /* User avatar even smaller */
    .user-avatar {
        width: 32px;
        height: 32px;
    }
    
    /* Pagination - compact */
    .pagination {
        gap: 0.25rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination .page-link {
        padding: 0.3rem 0.5rem;
        min-width: 30px;
        font-size: 0.75rem;
    }
    
    /* Hide page numbers, show only prev/next/current */
    .pagination .page-item:not(.active):not(:first-child):not(:last-child):not(:nth-child(2)):not(:nth-last-child(2)) {
        display: none;
    }
    
    /* Buttons full width on mobile */
    .btn-group {
        width: 100%;
    }
    
    .btn-group .btn {
        flex: 1;
        font-size: 0.75rem;
        padding: 0.5rem 0.5rem;
    }
    
    /* Theme toggle */
    .theme-toggle-container {
        top: 10px;
        right: 10px;
    }
    
    /* Filters - vertical layout */
    .form-select {
        width: 100%;
        font-size: 0.85rem;
    }
    
    .form-label {
        font-size: 0.85rem;
    }
    
    /* Tweet embeds */
    .tweet-container {
        max-width: 100%;
    }
    
    /* Pagination info */
    .pagination-info {
        font-size: 0.75rem;
        text-align: center;
        margin: 0.5rem 0;
    }
}

/* Very small phones (360px and below) */
@media (max-width: 360px) {
    .welcome-title {
        font-size: 1.3rem;
    }
    
    .container {
        padding: 0.5rem;
    }
    
    table {
        font-size: 0.7rem;
    }
    
    .btn-group .btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.4rem;
    }
}

/* Landscape mode for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .welcome-section {
        padding: 1rem 0;
    }
    
    .hub-logo {
        max-width: 80px;
    }
    
    .welcome-title {
        font-size: 1.5rem;
    }
}
