/* ============================================
   Waypoint Studios - Support Centre
   ============================================ */

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

:root {
    --bg-primary: #FEF2F0;
    --bg-secondary: #FBE8E4;
    --bg-card: #ffffff;
    --bg-card-hover: #fff8f7;
    --bg-input: #ffffff;
    --border-color: rgba(57, 19, 105, 0.1);
    --border-color-hover: rgba(236, 74, 35, 0.3);
    --text-primary: #391369;
    --text-secondary: #EC4A23;
    --text-muted: #8a7199;
    --accent-primary: #EC4A23;
    --accent-secondary: #d4401e;
    --accent-glow: rgba(236, 74, 35, 0.15);
    --discord-color: #5865f2;
    --email-color: #EC4A23;
    --wiki-color: #391369;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 100px;
    --shadow-sm: 0 2px 8px rgba(57, 19, 105, 0.06);
    --shadow-md: 0 4px 16px rgba(57, 19, 105, 0.08);
    --shadow-lg: 0 8px 32px rgba(57, 19, 105, 0.1);
    --shadow-glow: 0 0 0 3px rgba(236, 74, 35, 0.15);
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Background Glow --- */
.background-glow {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(ellipse at center, rgba(236, 74, 35, 0.04) 0%, rgba(57, 19, 105, 0.02) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* --- Header --- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(254, 242, 240, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-badge,
.nav-badge:hover,
.nav-badge:visited {
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    text-decoration: none;
    background: var(--accent-primary);
    padding: 4px 14px;
    border-radius: var(--radius-full);
    border: none;
}

/* --- Main Content --- */
.main {
    flex: 1;
    position: relative;
    z-index: 1;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Search Section --- */
.search-section {
    padding-top: 100px;
    padding-bottom: 60px;
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.search-section.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

.search-hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
}

/* --- Creator CTA --- */
.creator-cta {
    text-align: center;
    margin-top: 40px;
}

.creator-cta p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.creator-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-primary);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.creator-cta-link:hover {
    opacity: 0.8;
}

.creator-cta-link svg {
    width: 16px;
    height: 16px;
}

/* --- Search Box --- */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
    overflow: hidden;
}

.search-box:focus-within {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.search-icon {
    position: absolute;
    left: 20px;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-normal);
}

.search-box:focus-within .search-icon {
    color: var(--accent-primary);
}

.search-input {
    width: 100%;
    padding: 18px 50px 18px 52px;
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 400;
    color: var(--text-primary);
    background: transparent;
    border: none;
    outline: none;
}

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

.search-spinner {
    position: absolute;
    right: 16px;
    display: flex;
    align-items: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(236, 74, 35, 0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.search-clear {
    position: absolute;
    right: 14px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.search-clear:hover {
    background: rgba(236, 74, 35, 0.1);
    color: var(--accent-primary);
}

.search-clear svg {
    width: 14px;
    height: 14px;
}

/* --- Search Dropdown --- */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 50;
    animation: dropdownIn 200ms ease;
}

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

.search-results-list {
    list-style: none;
    max-height: 320px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid rgba(57, 19, 105, 0.06);
}

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

.search-result-item:hover,
.search-result-item.active {
    background: rgba(236, 74, 35, 0.06);
}

.result-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 700;
    color: white;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-creator {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.search-no-results {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* --- Results Section --- */
.results-section {
    padding-top: 40px;
    padding-bottom: 60px;
    animation: fadeInUp 400ms ease;
}

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

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition-fast);
    margin-bottom: 32px;
}

.back-btn:hover {
    color: var(--accent-primary);
}

.back-btn svg {
    width: 18px;
    height: 18px;
}

/* --- Product Header --- */
.product-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.product-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.product-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.product-name {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.product-creator {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* --- Support Grid --- */
.support-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- Support Cards --- */
.support-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.support-card:hover {
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon svg {
    width: 22px;
    height: 22px;
}

.game-icon {
    background: rgba(236, 74, 35, 0.1);
    color: var(--accent-primary);
}

.billing-icon {
    background: rgba(57, 19, 105, 0.08);
    color: var(--text-primary);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.card-description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.card-loading {
    display: flex;
    justify-content: center;
    padding: 16px 0;
}

/* --- Support Links --- */
.card-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.support-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.support-link:hover {
    background: rgba(236, 74, 35, 0.05);
    border-color: var(--border-color-hover);
    transform: translateX(4px);
}

.link-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.link-icon svg {
    width: 20px;
    height: 20px;
}

/* Discord link styling */
.discord-link .link-icon {
    background: rgba(88, 101, 242, 0.1);
    color: var(--discord-color);
}

/* Email link styling */
.email-link .link-icon {
    background: rgba(236, 74, 35, 0.1);
    color: var(--accent-primary);
}

/* Wiki/Website link styling */
.wiki-link .link-icon {
    background: rgba(57, 19, 105, 0.08);
    color: var(--text-primary);
}

.link-content {
    flex: 1;
    min-width: 0;
}

.link-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.link-value {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-arrow {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.support-link:hover .link-arrow {
    transform: translateX(4px);
    color: var(--accent-primary);
}

/* --- Card Empty State --- */
.card-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* --- Error Section --- */
.error-section {
    padding-top: 80px;
    padding-bottom: 60px;
    animation: fadeInUp 400ms ease;
}

.error-content {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.error-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.error-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.error-content p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
}

.error-content .back-btn {
    margin: 0 auto;
}

/* --- Footer --- */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    text-align: center;
}

.footer p {
    font-size: 13px;
    color: var(--text-muted);
}

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

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

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

::-webkit-scrollbar-thumb {
    background: rgba(236, 74, 35, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(236, 74, 35, 0.4);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .search-section {
        padding-top: 60px;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .search-input {
        padding: 16px 44px 16px 48px;
        font-size: 15px;
    }

    .support-card {
        padding: 20px;
    }

    .card-header {
        flex-direction: column;
        gap: 12px;
    }

    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .link-value {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 0 16px;
    }

    .main {
        padding: 0 16px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .support-card {
        padding: 16px;
        border-radius: var(--radius-lg);
    }

    .support-link {
        padding: 12px;
    }

    .link-icon {
        width: 34px;
        height: 34px;
    }

    .link-icon svg {
        width: 18px;
        height: 18px;
    }
}
