/* Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Utility Classes */
.bg-primary { background-color: var(--color-bg-primary); }
.bg-secondary { background-color: var(--color-bg-secondary); }
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Navigation */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-text-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-success) 100%);
    color: white;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon.large {
    width: 64px;
    height: 64px;
    font-size: 2rem;
    border-radius: var(--radius-lg);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.15s ease;
}

.nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-link:hover {
    background-color: var(--color-bg-hover);
    color: var(--color-text-primary);
    text-decoration: none;
}

.nav-link.active {
    background-color: var(--color-accent-light);
    color: var(--color-accent);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user {
    position: relative;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    color: var(--color-text-primary);
    transition: all 0.15s ease;
}

.user-button:hover {
    background-color: var(--color-bg-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* Initials-based avatars */
.initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color, #6366f1);
    color: white;
    font-weight: 600;
    font-size: 0.75em;
    text-transform: uppercase;
    border-radius: 50%;
}

.profile-avatar.initials {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
}

.meta-avatar.initials,
.info-avatar.initials,
.bet-avatar.initials,
.invited-avatar.initials,
.invitation-avatar.initials {
    width: 24px;
    height: 24px;
    font-size: 0.6rem;
}

.user-avatar-sm.initials {
    width: 28px;
    height: 28px;
    font-size: 0.65rem;
}

.user-name {
    font-weight: 500;
}

.dropdown-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.15s ease;
}

.rotate-180 {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 240px;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.dropdown-header {
    padding: 1rem;
    background-color: var(--color-bg-secondary);
}

.dropdown-name {
    display: block;
    font-weight: 600;
    color: var(--color-text-primary);
}

.dropdown-email {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-top: 0.125rem;
}

.dropdown-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.dropdown-stats .stat {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--color-border);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: background-color 0.15s ease;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background-color: var(--color-bg-hover);
    text-decoration: none;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 64px);
    padding: 2rem 0;
}

.main-content-full {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
}

.page-subtitle {
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

/* Messages */
.messages-container {
    position: fixed;
    top: 80px;
    right: 1.5rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    transition: opacity 0.3s ease;
}

.message-success {
    border-left: 4px solid var(--color-success);
}

.message-error {
    border-left: 4px solid var(--color-danger);
}

.message-info {
    border-left: 4px solid var(--color-accent);
}

.message-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--color-text-secondary);
}

.breadcrumb a:hover {
    color: var(--color-accent);
}

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

*::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
    border-radius: 5px;
}

*::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 5px;
    border: 2px solid var(--color-bg-secondary);
}

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

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) var(--color-bg-secondary);
}
