/* Counting Game - Material Design Theme */

:root {
    --mdc-theme-primary: #5865F2;
    --mdc-theme-secondary: #57F287;
    --mdc-theme-background: #1a1a2e;
    --mdc-theme-surface: #16213e;
    --mdc-theme-on-primary: #ffffff;
    --mdc-theme-on-surface: #ffffff;
    
    --counting-gold: #FFD700;
    --counting-silver: #C0C0C0;
    --counting-bronze: #CD7F32;
    --counting-premium: #9b59b6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
    min-height: 100vh;
}

/* Top App Bar */
.mdc-top-app-bar {
    background: rgba(22, 33, 62, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mdc-top-app-bar__title {
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-btn {
    color: #ffffff !important;
    margin-left: 8px;
}

.nav-btn.mdc-button--outlined {
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.nav-btn.mdc-button--raised {
    background: var(--mdc-theme-primary) !important;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 16px;
    color: rgba(255, 255, 255, 0.8);
}

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

/* Main Content */
.main-content {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Cards */
.mdc-card {
    background: var(--mdc-theme-surface) !important;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
}

.card-header .material-icons {
    color: var(--mdc-theme-primary);
    font-size: 28px;
}

.card-content {
    padding: 24px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.2) 0%, rgba(87, 242, 135, 0.1) 100%);
    border-radius: 24px;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #5865F2, #57F287);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin: 0 auto 24px;
}

/* Ranking List */
.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-position {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-right: 16px;
}

.ranking-position.gold { color: var(--counting-gold); }
.ranking-position.silver { color: var(--counting-silver); }
.ranking-position.bronze { color: var(--counting-bronze); }
.ranking-position.normal { 
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
}

.ranking-info {
    flex: 1;
}

.ranking-name {
    font-weight: 500;
    font-size: 1rem;
}

.ranking-stats {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

.ranking-score {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--mdc-theme-secondary);
}

/* Grid */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

/* Server Cards */
.server-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.server-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(88, 101, 242, 0.3);
}

.server-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--mdc-theme-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.server-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.premium-badge {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.free-badge {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--mdc-theme-secondary);
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

/* Buttons */
.mdc-button {
    border-radius: 8px !important;
    text-transform: none !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
}

.mdc-button--raised {
    background: var(--mdc-theme-primary) !important;
}

.mdc-button--raised.premium {
    background: linear-gradient(135deg, #9b59b6, #8e44ad) !important;
}

.mdc-button--raised.success {
    background: var(--mdc-theme-secondary) !important;
    color: #000 !important;
}

.mdc-button--raised.danger {
    background: #e74c3c !important;
}

/* Form Fields */
.mdc-text-field {
    width: 100%;
    margin-bottom: 16px;
}

.mdc-text-field--filled {
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 8px 8px 0 0;
}

.mdc-text-field--filled .mdc-text-field__input {
    color: #ffffff !important;
}

.mdc-floating-label {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(87, 242, 135, 0.1);
    border: 1px solid rgba(87, 242, 135, 0.3);
    color: var(--mdc-theme-secondary);
}

.alert-error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.alert-info {
    background: rgba(88, 101, 242, 0.1);
    border: 1px solid rgba(88, 101, 242, 0.3);
    color: var(--mdc-theme-primary);
}

/* Footer */
.site-footer {
    background: rgba(0, 0, 0, 0.3);
    padding: 40px 20px;
    text-align: center;
    margin-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content p {
    margin: 8px 0;
    color: rgba(255, 255, 255, 0.5);
}

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.login-card {
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.login-card .card-content {
    padding: 40px;
}

.discord-btn {
    background: #5865F2 !important;
    color: white !important;
    padding: 12px 32px !important;
    font-size: 1rem !important;
}

.discord-btn .material-icons {
    margin-right: 8px;
}

/* Payment */
.payment-card {
    max-width: 500px;
    margin: 0 auto;
}

.price-display {
    font-size: 3rem;
    font-weight: 700;
    color: var(--mdc-theme-secondary);
    text-align: center;
    margin: 24px 0;
}

.price-display small {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
}

.features-list {
    list-style: none;
    padding: 0;
}

.features-list li {
    padding: 12px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.features-list .material-icons {
    color: var(--mdc-theme-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .mdc-top-app-bar__section--align-end {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    
    .nav-user {
        display: none;
    }
}

/* Custom Select */
.custom-select {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.custom-select:focus {
    outline: none;
    border-color: var(--mdc-theme-primary);
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.3);
}

.custom-select option {
    background: #16213e;
    color: #ffffff;
    padding: 12px;
}

/* Custom Switch */
.switch-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.switch-container input {
    display: none;
}

.switch-slider {
    width: 52px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    position: relative;
    transition: background 0.3s;
    flex-shrink: 0;
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: #ffffff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.switch-container input:checked + .switch-slider {
    background: var(--mdc-theme-secondary);
}

.switch-container input:checked + .switch-slider::before {
    transform: translateX(24px);
}

.switch-label {
    margin-left: 12px;
    color: rgba(255, 255, 255, 0.9);
}

/* Subscription Badge */
.subscription-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(87, 242, 135, 0.1);
    border: 1px solid rgba(87, 242, 135, 0.3);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--mdc-theme-secondary);
}
