/* =============================================
   Roblox Player Checker - Main Stylesheet
   ============================================= */

/* --- CSS Variables (Roblox-inspired palette) --- */
:root {
    --roblox-red: #e2231a;
    --roblox-red-dark: #b81a12;
    --roblox-red-light: #ff4d45;
    --bg-dark: #0f1117;
    --bg-card: #1a1d28;
    --bg-card-hover: #232738;
    --bg-input: #13161f;
    --text-primary: #ffffff;
    --text-secondary: #a1a5b7;
    --text-muted: #6c7080;
    --border-color: #2a2e3a;
    --border-focus: #e2231a;
    --success: #00c853;
    --warning: #ff9800;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-red: 0 4px 20px rgba(226, 35, 26, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* --- Background Particles --- */
.bg-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-particle {
    position: absolute;
    background: var(--roblox-red);
    border-radius: 50%;
    opacity: 0.06;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.06;
    }
    90% {
        opacity: 0.04;
    }
    100% {
        transform: translateY(-10vh) scale(1.5);
        opacity: 0;
    }
}

/* --- Header --- */
.header {
    position: relative;
    z-index: 10;
    width: 100%;
    text-align: center;
    padding: 48px 20px 32px;
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo i {
    color: var(--roblox-red);
    font-size: 2.4rem;
    filter: drop-shadow(0 4px 8px rgba(226, 35, 26, 0.5));
}

.logo strong {
    color: var(--roblox-red);
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-top: 6px;
    font-weight: 500;
}

/* --- Main Container --- */
.main-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 640px;
    padding: 0 20px 40px;
    flex: 1;
}

/* --- Search Section --- */
.search-section {
    animation: fadeSlideIn 0.5s ease forwards;
}

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

.search-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.search-card:focus-within {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-md), var(--shadow-red);
}

.search-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--roblox-red), var(--roblox-red-dark));
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow-red);
}

.search-icon i {
    font-size: 2rem;
    color: white;
}

.search-card h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.search-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 28px;
}

.search-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.search-input {
    flex: 1;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-weight: 500;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    min-width: 0;
}

.search-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.search-input:focus {
    border-color: var(--roblox-red);
    box-shadow: 0 0 0 4px rgba(226, 35, 26, 0.12);
}

.search-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--roblox-red);
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--roblox-red-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-red);
}

.search-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

.search-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 16px;
}

.search-hint kbd {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 8px;
    font-family: inherit;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* --- Search Suggestions --- */
.search-suggestions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    min-height: 24px;
}

.suggestion-chip {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    padding: 6px 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    font-weight: 500;
}

.suggestion-chip:hover {
    background: var(--roblox-red);
    border-color: var(--roblox-red);
    color: white;
}

/* --- Loading Section --- */
.loading-section {
    animation: fadeSlideIn 0.3s ease forwards;
}

.loading-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 60px 36px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.spinner {
    margin-bottom: 20px;
}

.spinner i {
    font-size: 2.8rem;
    color: var(--roblox-red);
}

.loading-card p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 600;
}

/* --- Results Section --- */
.results-section {
    animation: fadeSlideIn 0.4s ease forwards;
}

.results-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* Player Banner */
.player-banner {
    position: relative;
    background: linear-gradient(135deg, #2a1a1a 0%, #1a1d28 50%, #1a202a 100%);
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
}

.player-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.player-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid var(--roblox-red);
    box-shadow: 0 0 0 4px var(--bg-card), var(--shadow-red);
    background: var(--bg-input);
    object-fit: cover;
}

.player-online-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid var(--bg-card);
}

.player-online-dot.online {
    background: var(--success);
    box-shadow: 0 0 12px rgba(0, 200, 83, 0.6);
}

.player-online-dot.offline {
    background: var(--text-muted);
}

.player-name-section {
    min-width: 0;
}

.player-display-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    word-break: break-word;
}

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

.player-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 700;
}

.player-status-badge.online-badge {
    background: rgba(0, 200, 83, 0.15);
    color: var(--success);
}

.player-status-badge.offline-badge {
    background: rgba(108, 112, 128, 0.15);
    color: var(--text-muted);
}

/* Player Info */
.player-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    padding: 24px 32px;
}

.info-item {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.info-item:hover {
    border-color: var(--roblox-red);
    background: var(--bg-card-hover);
}

.info-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.info-item-icon.id-icon {
    background: rgba(226, 35, 26, 0.15);
    color: var(--roblox-red);
}

.info-item-icon.calendar-icon {
    background: rgba(66, 165, 245, 0.15);
    color: #42a5f5;
}

.info-item-icon.clock-icon {
    background: rgba(255, 152, 0, 0.15);
    color: var(--warning);
}

.info-item-icon.globe-icon {
    background: rgba(156, 39, 176, 0.15);
    color: #9c27b0;
}

.info-item-content {
    min-width: 0;
}

.info-item-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.info-item-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-all;
}

/* Player Description */
.player-description-section {
    padding: 0 32px 24px;
}

.player-description-section h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.player-description {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
    min-height: 48px;
    word-break: break-word;
}

/* External Link */
.player-link-section {
    padding: 0 32px 28px;
}

.profile-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--roblox-red), var(--roblox-red-dark));
    color: white;
    text-decoration: none;
    padding: 12px 22px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-red);
}

.profile-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(226, 35, 26, 0.4);
}

/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 100px;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.back-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* --- Error Section --- */
.error-section {
    animation: fadeSlideIn 0.4s ease forwards;
}

.error-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 36px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.error-icon {
    width: 72px;
    height: 72px;
    background: rgba(226, 35, 26, 0.15);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.error-icon i {
    font-size: 2.4rem;
    color: var(--roblox-red);
}

.error-card h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.error-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--roblox-red);
    border: none;
    border-radius: 100px;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.retry-btn:hover {
    background: var(--roblox-red-light);
    box-shadow: var(--shadow-red);
}

/* --- Recent Searches --- */
.recent-section {
    margin-top: 24px;
    animation: fadeSlideIn 0.6s ease forwards;
}

.recent-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    box-shadow: var(--shadow-sm);
}

.recent-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.recent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.no-recent {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    margin: 0;
}

.recent-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    padding: 8px 16px;
    font-size: 0.82rem;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.recent-chip:hover {
    background: var(--bg-card-hover);
    border-color: var(--roblox-red);
}

.recent-chip .chip-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.recent-chip .chip-remove {
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    transition: color var(--transition-fast);
    margin-left: 2px;
}

.recent-chip .chip-remove:hover {
    color: var(--roblox-red);
}

.clear-recent-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    margin-top: 14px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: color var(--transition-fast);
}

.clear-recent-btn:hover {
    color: var(--roblox-red);
}

/* --- Footer --- */
.footer {
    position: relative;
    z-index: 10;
    width: 100%;
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
}

/* --- Utility: Hidden --- */
.hidden {
    display: none !important;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .logo {
        font-size: 1.6rem;
    }

    .logo i {
        font-size: 1.8rem;
    }

    .header {
        padding: 32px 16px 24px;
    }

    .search-card {
        padding: 28px 20px;
    }

    .search-input-wrapper {
        flex-direction: column;
    }

    .search-btn {
        justify-content: center;
    }

    .player-banner {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }

    .player-display-name {
        font-size: 1.2rem;
    }

    .player-info-grid {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 10px;
    }

    .player-description-section {
        padding: 0 20px 20px;
    }

    .player-link-section {
        padding: 0 20px 24px;
    }

    .results-card .player-avatar {
        width: 80px;
        height: 80px;
    }
}
