/* Active365 - Clean Professional UI */

:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-light: #DBEAFE;
    --secondary: #64748B;
    --bg-main: #F8FAFC;
    --bg-card: #FFFFFF;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --success: #059669;
    --success-bg: #ECFDF5;
    --danger: #DC2626;
    --danger-bg: #FEF2F2;
    --warning: #D97706;
    --warning-bg: #FFFBEB;
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: white;
    font-weight: 500;
    transition: background 0.15s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border);
    font-weight: 500;
    transition: all 0.15s ease;
}

.btn-secondary:hover {
    background: var(--bg-main);
    border-color: var(--secondary);
}

.btn-danger {
    background: var(--danger);
    color: white;
    font-weight: 500;
    transition: background 0.15s ease;
}

.btn-danger:hover {
    background: #B91C1C;
}

/* Cards */
.card-shadow {
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}

.activity-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.15s ease;
}

.activity-card:hover {
    border-color: var(--primary);
}

/* Stats */
.stats-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
}

.stats-card.accent {
    border-left: 3px solid #0891B2;
}

.stats-card.success {
    border-left: 3px solid var(--success);
}

/* Inputs */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

/* Gradient - subtle */
.gradient-bg {
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
}

/* Avatar */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 20px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #A7F3D0;
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #FECACA;
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid #FDE68A;
}

/* Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    padding: 8px 0;
    display: flex;
    justify-content: space-around;
    z-index: 50;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 16px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    transition: color 0.15s ease;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    margin-bottom: 2px;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--primary);
}

/* Dropdown */
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 4px;
    min-width: 180px;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s ease;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 14px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: var(--bg-main);
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    color: var(--text-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 4px;
}

.pagination-item {
    padding: 8px 14px;
    border-radius: 6px;
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.pagination-item:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 16px;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin: 0 auto 12px;
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast */
.toast {
    position: fixed;
    top: 16px;
    right: 16px;
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Animations - subtle */
.fade-in {
    animation: fadeIn 0.2s ease;
}

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

.slide-up {
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(12px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: block !important; }
    .pb-mobile-nav { padding-bottom: 72px; }
}

@media (min-width: 769px) {
    .hide-desktop { display: none !important; }
    .show-desktop { display: block !important; }
    .bottom-nav { display: none; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

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

/* Pull to Refresh */
.pull-refresh-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    transition: transform 0.3s ease;
    font-size: 13px;
    color: var(--text-secondary);
}

.pull-refresh-indicator.visible {
    transform: translateX(-50%) translateY(0);
}

.pull-refresh-indicator.pulling {
    transform: translateX(-50%) translateY(0);
}

.pull-refresh-spinner {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.pull-refresh-indicator.refreshing .pull-refresh-spinner {
    animation: spin 0.8s linear infinite;
}

/* Scrollbar hide utility */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Leaderboard specific */
.leaderboard-podium {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

@media (min-width: 640px) {
    .leaderboard-podium {
        gap: 16px;
    }
}

/* Primary color utilities for Tailwind-like usage */
.bg-primary-50 { background-color: #EFF6FF; }
.bg-primary-100 { background-color: #DBEAFE; }
.bg-primary-600 { background-color: #2563EB; }
.text-primary-600 { color: #2563EB; }
.border-primary-300 { border-color: #93C5FD; }

/* Touch action for pull refresh */
#pull-refresh-container {
    overscroll-behavior-y: contain;
    touch-action: pan-y;
}
