/* Apple Liquid Design - Dark and Light Theme with Glass Effects */

/* CSS Variables */
:root {
    /* Dark theme colors (default) */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-elevated: #1c1c1e;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    
    /* Text colors */
    --text-primary: rgba(255, 255, 255, 0.87);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-tertiary: rgba(255, 255, 255, 0.38);
    
    /* System grays */
    --gray-1: #8e8e93;
    --gray-2: #636366;
    --gray-3: #48484a;
    --gray-4: #3a3a3c;
    --gray-5: #2c2c2e;
    --gray-6: #1c1c1e;
    
    /* Accent colors for data */
    --accent-blue: #007aff;
    --accent-green: #34c759;
    --accent-red: #ff3b30;
    --accent-orange: #ff9500;
    --accent-purple: #af52de;
    --accent-teal: #5ac8fa;
    
    /* Glass effects */
    --glass-blur: 20px;
    --glass-saturation: 180%;
    --glass-opacity: 0.8;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    
    /* Border radius */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
}

/* Light theme */
[data-theme="light"] {
    /* Light theme colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f2f2f7;
    --bg-elevated: #ffffff;
    --bg-overlay: rgba(0, 0, 0, 0.3);
    
    /* Text colors */
    --text-primary: rgba(0, 0, 0, 0.87);
    --text-secondary: rgba(0, 0, 0, 0.6);
    --text-tertiary: rgba(0, 0, 0, 0.38);
    
    /* System grays */
    --gray-1: #8e8e93;
    --gray-2: #aeaeb2;
    --gray-3: #c7c7cc;
    --gray-4: #d1d1d6;
    --gray-5: #e5e5ea;
    --gray-6: #f2f2f7;
    
    /* Shadows for light mode */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100%;
    overflow-x: hidden;
    margin: 0;
}

/* Dynamic Background */
.dynamic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at top left, rgba(0, 122, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(175, 82, 222, 0.1) 0%, transparent 50%),
        var(--bg-primary);
    z-index: -1;
    transition: background 0.3s ease;
}

[data-theme="light"] .dynamic-background {
    background: 
        radial-gradient(ellipse at top left, rgba(0, 122, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(175, 82, 222, 0.05) 0%, transparent 50%),
        var(--bg-primary);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glass Panel Base */
.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}

[data-theme="light"] .glass-panel {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0.2) 80%,
        transparent
    );
}

[data-theme="light"] .glass-panel::before {
    background: linear-gradient(90deg, 
        transparent,
        rgba(0, 0, 0, 0.1) 20%,
        rgba(0, 0, 0, 0.1) 80%,
        transparent
    );
}

/* Header */
.header-panel {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-lg) var(--spacing-xl);
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.logo-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.app-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.app-subtitle {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-secondary);
}

/* Auth Navigation */
.auth-nav {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

/* Theme Toggle Button */
.theme-toggle {
    opacity: 0.7;
    transition: opacity 0.2s ease;
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    opacity: 1;
}

.theme-icon-moon,
.theme-icon-sun {
    display: block;
    width: 20px;
    height: 20px;
}

/* Ensure only one icon is visible at a time */
.theme-toggle svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.theme-toggle svg[style*="display: none"] {
    display: none !important;
}

/* Navigation */
.nav-panel {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md) var(--spacing-xl);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.current-user {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-links {
    display: flex;
    gap: var(--spacing-lg);
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: var(--spacing-md);
    right: var(--spacing-md);
    height: 2px;
    background: var(--accent-blue);
    border-radius: 1px;
}

.nav-link.logout {
    color: var(--accent-red);
}

/* Buttons */
.glass-button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

[data-theme="light"] .glass-button {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

[data-theme="light"] .glass-button:hover {
    background: rgba(0, 0, 0, 0.1);
}

.glass-button:active {
    transform: translateY(0);
}

.power-button {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
}

.icon-button {
    width: 36px;
    height: 36px;
    padding: 0;
}

.primary-button {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    width: 100%;
    padding: var(--spacing-md);
    font-size: 16px;
    margin-top: var(--spacing-lg);
}

.primary-button:hover {
    background: rgba(0, 122, 255, 0.9);
}

/* Data Panel */
.data-panel {
    margin-bottom: var(--spacing-lg);
    min-width: 0;
}

/* Direct table container in data-panel should have no padding */
.data-panel > .table-container {
    padding: 0;
}

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

.panel-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-controls {
    display: flex;
    gap: var(--spacing-sm);
}

/* Table */
.table-container {
    overflow-x: hidden;
    padding: 0;
}

/* Only allow scroll on smaller screens */
@media (max-width: 1200px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.data-table thead {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .data-table thead {
    background: rgba(0, 0, 0, 0.03);
}

.data-table th {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: middle;
}

.th-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

/* First two columns (Rank, User) - left align */
.data-table th:nth-child(1),
.data-table td:nth-child(1),
.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    text-align: left;
}

.data-table th:nth-child(1) .th-content,
.data-table th:nth-child(2) .th-content {
    justify-content: flex-start;
}

.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.sortable:hover {
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .sortable:hover {
    background: rgba(0, 0, 0, 0.02);
}

.sortable:hover .th-content {
    color: var(--text-primary);
}

.sort-icon {
    opacity: 0.3;
    transition: all 0.2s ease;
    width: 20px;
    height: 20px;
    margin-left: var(--spacing-xs);
    vertical-align: middle;
    display: inline-block;
}

.sortable:hover .sort-icon {
    opacity: 0.6;
}

/* Sorted column styles */
.sortable.sorted {
    background: rgba(0, 122, 255, 0.05);
}

[data-theme="light"] .sortable.sorted {
    background: rgba(0, 122, 255, 0.08);
}

.sortable.sorted .sort-icon {
    opacity: 1;
    color: var(--accent-color);
}

/* Rotate arrow for ascending sort */
.sortable.sorted.asc .sort-icon {
    transform: rotate(180deg);
}

.data-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .data-table tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .data-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.03);
}

/* Clickable row styles for rankings */
.data-table tbody tr.clickable-row {
    cursor: pointer;
    position: relative;
}

.data-table tbody tr.clickable-row:hover {
    background: rgba(0, 122, 255, 0.08);
    transform: translateX(2px);
}

[data-theme="light"] .data-table tbody tr.clickable-row:hover {
    background: rgba(0, 122, 255, 0.12);
}

.data-table tbody tr.clickable-row:active {
    transform: translateX(1px);
}

/* Add subtle arrow indicator on hover */
.data-table tbody tr.clickable-row::after {
    content: '→';
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.2s ease;
    color: var(--accent-color);
    font-size: 18px;
}

.data-table tbody tr.clickable-row:hover::after {
    opacity: 0.6;
    transform: translateY(-50%) translateX(2px);
}

.data-table td {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 14px;
    color: var(--text-primary);
    vertical-align: middle;
    text-align: center;
}

/* Column widths */
.data-table th:nth-child(1),
.data-table td:nth-child(1) {
    width: 80px;
    max-width: 80px;
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-sm);
    white-space: nowrap;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    min-width: 120px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Numeric columns - constrain width */
.data-table th:nth-child(n+3),
.data-table td:nth-child(n+3) {
    white-space: nowrap;
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
}

/* Cost columns */
/* Total Cost (3), Daily Avg (5), Monthly Avg (6) */
.data-table th:nth-child(3),
.data-table td:nth-child(3),
.data-table th:nth-child(5),
.data-table td:nth-child(5),
.data-table th:nth-child(6),
.data-table td:nth-child(6) {
    max-width: 120px;
}

/* Token columns - can be wider */
/* Total Tokens (4) */
.data-table th:nth-child(4),
.data-table td:nth-child(4) {
    max-width: 150px;
}

/* Days and streak columns */
/* Days Active (7), Longest Streak (8) */
.data-table th:nth-child(7),
.data-table td:nth-child(7),
.data-table th:nth-child(8),
.data-table td:nth-child(8) {
    max-width: 110px;
}

/* Extra right padding for last column */
.data-table th:nth-child(8),
.data-table td:nth-child(8) {
    padding-right: var(--spacing-xl);
}

/* Recent Activity Table - Equal Column Distribution */
.recent-activity-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.recent-activity-table thead {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .recent-activity-table thead {
    background: rgba(0, 0, 0, 0.03);
}

.recent-activity-table th,
.recent-activity-table td {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: center;
    width: 20%; /* 5 columns = 20% each */
    vertical-align: middle;
}

.recent-activity-table th {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: middle;
}

.recent-activity-table td {
    font-size: 14px;
    color: var(--text-primary);
}

/* First column - left align */
.recent-activity-table th:first-child,
.recent-activity-table td:first-child {
    text-align: left;
}

/* Last column - right align */
.recent-activity-table th:last-child,
.recent-activity-table td:last-child {
    text-align: right;
}

/* Remove extra padding from th-content divs */
.recent-activity-table .th-content {
    display: inline;
    padding: 0;
}

/* Rank colors */
.data-table tbody tr:nth-child(1) td:first-child { color: var(--accent-orange); font-weight: 600; }
.data-table tbody tr:nth-child(2) td:first-child { color: var(--gray-1); font-weight: 600; }
.data-table tbody tr:nth-child(3) td:first-child { color: #cd7f32; font-weight: 600; }

/* Username links - deprecated, using clickable rows instead */
/* 
.username-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.username-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}
*/

/* Sorted column value highlight */
.sorted-value {
    background: rgba(0, 122, 255, 0.1);
    font-weight: 600;
}

[data-theme="light"] .sorted-value {
    background: rgba(0, 122, 255, 0.15);
}

/* Pagination */
.pagination {
    padding: var(--spacing-lg);
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
}

.pagination-button {
    min-width: 36px;
    height: 36px;
    padding: 0 var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.pagination-button.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.close-button {
    background: transparent;
    border: none;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Forms */
.modal-form {
    padding: var(--spacing-lg);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

.form-footer {
    margin-top: var(--spacing-lg);
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}

.form-link:hover {
    text-decoration: underline;
}

.error-message {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--accent-red);
    border: 1px solid var(--accent-red);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    text-align: center;
    display: none;
    animation: slideIn 0.3s ease-out;
}

.error-message:not(:empty) {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Upload Section - Compact Version */
.upload-section-compact {
    margin-top: var(--spacing-md);
}

.header-short-separator {
    width: 40px;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: var(--spacing-sm) 0;
}

[data-theme="light"] .header-short-separator {
    background: rgba(0, 0, 0, 0.1);
}

.upload-header-compact {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    padding: var(--spacing-xs) 0;
    transition: all 0.2s ease;
}

.upload-header-compact:hover .upload-subtitle {
    color: var(--text-primary);
}

.upload-subtitle {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.disclosure-button {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

[data-theme="light"] .disclosure-button {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.disclosure-button:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

[data-theme="light"] .disclosure-button:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.15);
}

.disclosure-button:active {
    transform: translateY(0);
}

.disclosure-indicator {
    width: 14px;
    height: 14px;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.upload-section-compact.expanded .disclosure-indicator {
    transform: rotate(180deg);
}

.upload-instruction {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
}

.upload-body {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.upload-section-compact.expanded .upload-body {
    max-height: 200px;
    opacity: 1;
    padding-top: var(--spacing-md);
}

.mock-terminal.compact {
    margin-bottom: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

[data-theme="light"] .mock-terminal.compact {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.mock-terminal.compact .terminal-body {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 13px;
    background: transparent;
}

.upload-section-compact .terminal-prompt {
    color: var(--accent-green);
    margin-right: var(--spacing-xs);
}

.upload-section-compact .terminal-command {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

[data-theme="light"] .upload-section-compact .terminal-command {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.upload-note {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.upload-note strong {
    color: var(--accent-orange);
    font-weight: 600;
}

/* Upload Explainer */
.upload-explainer {
    margin-bottom: var(--spacing-lg);
    transition: all 0.3s ease;
    animation: fadeInSlide 0.5s ease-out;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upload-explainer.collapsed {
    margin-bottom: var(--spacing-md);
}

.explainer-content {
    padding: var(--spacing-lg);
}

.explainer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    cursor: pointer;
    user-select: none;
    padding: var(--spacing-sm);
    margin: calc(-1 * var(--spacing-sm));
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.explainer-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .explainer-header:hover {
    background: rgba(0, 0, 0, 0.03);
}

.explainer-header:active {
    transform: scale(0.99);
}

.upload-explainer.collapsed .explainer-header {
    margin-bottom: 0;
}

.explainer-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    pointer-events: none; /* Prevent text selection on click */
}

.collapse-button {
    transition: transform 0.3s ease;
    pointer-events: auto; /* Ensure button remains clickable */
}

.upload-explainer.collapsed .collapse-button {
    transform: rotate(180deg);
}

.explainer-body {
    opacity: 1;
    max-height: 500px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.upload-explainer.collapsed .explainer-body {
    opacity: 0;
    max-height: 0;
    margin: 0;
    padding: 0;
}

.explainer-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

/* Mock Terminal */
.mock-terminal {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

[data-theme="light"] .mock-terminal {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.terminal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

[data-theme="light"] .terminal-header {
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.terminal-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

[data-theme="light"] .terminal-title {
    color: rgba(255, 255, 255, 0.8);
}

.terminal-body {
    padding: var(--spacing-md);
    font-size: 14px;
    line-height: 1.6;
}

.terminal-prompt {
    color: var(--accent-green);
    margin-right: var(--spacing-sm);
    font-weight: 600;
}

.terminal-command {
    color: var(--text-primary);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    user-select: all;
    cursor: pointer;
}

[data-theme="light"] .terminal-command {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.terminal-command:hover {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .terminal-command:hover {
    background: rgba(255, 255, 255, 0.3);
}

.explainer-notes {
    font-size: 13px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .explainer-notes {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.explainer-notes p {
    margin: 0;
    line-height: 1.5;
}

.explainer-notes strong {
    color: var(--accent-orange);
    font-weight: 600;
}

/* Profile */
.profile-panel {
    min-height: 500px;
}

.profile-content {
    padding: 0;
}

/* Profile sections */
.profile-stats-panel,
.social-links-panel,
.recent-activity-panel {
    margin-bottom: var(--spacing-lg);
}

.profile-stats-panel:last-child,
.social-links-panel:last-child,
.recent-activity-panel:last-child {
    margin-bottom: 0;
}

.profile-stats-section,
.recent-activity-section,
.social-links-section {
    padding: 0;
}

.profile-stats-table {
    margin-top: 0;
}

/* Profile section headers */
.recent-activity-section .panel-header,
.social-links-section .panel-header {
    padding: var(--spacing-md) var(--spacing-xl);
    /*background: rgba(255, 255, 255, 0.03);*/
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Content padding for sections with headers */
.recent-activity-section .table-container {
    padding-bottom: var(--spacing-xl)}

.social-links-section .social-links-content {
    padding: var(--spacing-xl);
}

/* Social link items */
.social-link-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.social-link-item:last-child {
    margin-bottom: 0;
}

/* Merged input group with glass background */
.social-link-input-group {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s ease;
}

[data-theme="light"] .social-link-input-group {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.social-link-input-group:hover,
.social-link-input-group:focus-within {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .social-link-input-group:hover,
[data-theme="light"] .social-link-input-group:focus-within {
    border-color: rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.9);
}

.social-link-favicon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.social-link-favicon img,
.social-link-favicon .social-emoji {
    width: 20px;
    height: 20px;
    object-fit: contain;
    font-size: 20px;
    line-height: 1;
}

/* Vertical separator */
.social-link-separator {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

[data-theme="light"] .social-link-separator {
    background: rgba(0, 0, 0, 0.1);
}

.social-link-input {
    flex: 1;
    min-width: 0;
    padding: var(--spacing-md);
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    outline: none;
}

.social-link-input::placeholder {
    color: var(--text-secondary);
}

.social-link-item .remove-button {
    flex-shrink: 0;
    padding: var(--spacing-md);
    height: auto;
    min-height: 0;
}

/* Add link button */
.add-link-button {
    margin-top: var(--spacing-lg);
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    font-weight: 500;
}

.no-social-links {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--spacing-xl) 0;
    font-style: italic;
}

/* Read-only social links */
.social-links-readonly {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.social-link-readonly {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

[data-theme="light"] .social-link-readonly {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.social-link-readonly:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

[data-theme="light"] .social-link-readonly:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.2);
}

.social-link-readonly .social-link-favicon {
    padding: 0;
    background: none;
    border: none;
}

.social-link-text {
    font-size: 14px;
}

[data-theme="light"] .recent-activity-section .panel-header,
[data-theme="light"] .social-links-section .panel-header {
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Profile footer */
.profile-footer {
    padding: var(--spacing-lg);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .profile-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.profile-footer small {
    color: var(--text-secondary);
    font-size: 12px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    transition: all 0.2s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-xs);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Contribution Activity Graph */
.contribution-activity-panel {
    margin-bottom: var(--spacing-lg);
}

.contribution-content {
    padding: var(--spacing-xl);
}

.contribution-header {
    margin-bottom: var(--spacing-lg);
}

.contribution-count {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.contribution-graph {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.month-labels {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 13px;
    gap: 3px;
    margin-bottom: var(--spacing-sm);
    margin-left: 40px; /* Align with grid */
    font-size: 12px;
    color: var(--text-secondary);
}

.month-label {
    text-align: left;
}

.contribution-grid-wrapper {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.day-labels {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
    min-width: 30px;
}

.day-labels span {
    height: 13px;
    line-height: 13px;
}

/* Hide some day labels like GitHub does */
.day-labels span:nth-child(even):not(:nth-child(2)) {
    opacity: 0;
}

.contribution-grid {
    display: flex;
    gap: 3px;
}

.contribution-week {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.contribution-cell {
    width: 13px;
    height: 13px;
    background: var(--gray-5);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

[data-theme="light"] .contribution-cell {
    background: var(--gray-6);
}

.contribution-cell.empty {
    visibility: hidden;
}

/* Contribution levels - green shades */
.contribution-cell[data-level="0"] {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .contribution-cell[data-level="0"] {
    background: rgba(0, 0, 0, 0.05);
}

.contribution-cell[data-level="1"] {
    background: rgba(52, 199, 89, 0.25);
}

.contribution-cell[data-level="2"] {
    background: rgba(52, 199, 89, 0.5);
}

.contribution-cell[data-level="3"] {
    background: rgba(52, 199, 89, 0.75);
}

.contribution-cell[data-level="4"] {
    background: rgba(52, 199, 89, 1);
}

.contribution-cell:hover {
    outline: 2px solid var(--text-primary);
    outline-offset: 1px;
    z-index: 1;
}

/* Legend */
.contribution-legend {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    margin-left: 40px; /* Align with grid */
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-scale {
    display: flex;
    gap: 3px;
}

.legend-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .contribution-graph {
        overflow-x: auto;
    }
    
    .month-labels {
        margin-left: 30px;
    }
    
    .day-labels {
        min-width: 25px;
        font-size: 11px;
    }
    
    .contribution-cell {
        width: 11px;
        height: 11px;
    }
    
    .contribution-legend {
        margin-left: 30px;
    }
}

/* Utility Classes */
.hide {
    display: none !important;
}

.hide-mobile {
    display: table-cell;
}

.hide-tablet {
    display: table-cell;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-md);
    }
    
    .header-content {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .logo-section {
        text-align: center;
        align-items: center;
        display: flex;
        flex-direction: column;
    }
    
    .auth-nav {
        position: absolute;
        top: var(--spacing-md);
        right: var(--spacing-md);
        display: flex;
        gap: var(--spacing-sm);
        align-items: center;
    }
    
    .app-title {
        font-size: 28px;
    }
    
    .app-subtitle {
        font-size: 14px;
    }
    
    .upload-header-content {
        flex-direction: column;
        gap: var(--spacing-xs);
        align-items: flex-start;
    }
    
    .upload-subtitle {
        font-size: 14px;
    }
    
    .header-short-separator {
        width: 30px;
    }
    
    .nav-content {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .nav-links {
        width: 100%;
        justify-content: space-around;
    }
    
    .panel-header {
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .panel-title {
        font-size: 20px;
    }
    
    .data-table th,
    .data-table td {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 13px;
    }
    
    .hide-mobile {
        display: none !important;
    }
    
    .stat-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .hide-tablet {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .glass-panel {
        background: rgba(255, 255, 255, 0.1);
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
    
    .form-input {
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Global Stats Panel */
.stats-panel {
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-lg);
}

.stat-item {
    text-align: center;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

[data-theme="light"] .stat-item {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

[data-theme="light"] .stat-item:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .stat-item {
        padding: var(--spacing-sm);
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .stats-panel {
        padding: var(--spacing-md);
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
}

/* Main Content */
.main-content {
    flex: 1 0 auto;
}

/* Footer Styles */
.site-footer {
    margin-top: auto;
    padding: var(--spacing-xl) var(--spacing-md);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    margin: 0;
}

.footer-link {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--accent-teal);
    text-decoration: underline;
}