/* CSS Variables */
:root {
    --bg-dark: #0a0a0f;
    --bg-light: #16162a;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-bg-hover: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #c0c0c0;
    --text-muted: #6b6b80;

    /* Category accent colors */
    --color-video: #e5a00d;
    --color-music: #00c853;
    --color-books: #4fc3f7;
    --color-audiobooks: #ab47bc;
    --color-chat: #00bcd4;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Animated background */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(ellipse at 10% 0%, rgba(229, 160, 13, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 100%, rgba(171, 71, 188, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 200, 83, 0.05) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-light) 100%);
}

/* Header */
header {
    text-align: center;
    padding: 4rem 2rem 3rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.mascot {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 8px 32px rgba(229, 160, 13, 0.4));
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-12px) rotate(2deg); }
}

h1 {
    font-family: 'Righteous', cursive;
    font-size: 4rem;
    background: linear-gradient(135deg, #ffffff 0%, #f0c040 40%, #e5a00d 60%, #ab47bc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.tagline {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Main Content */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 2rem 4rem;
}

/* Services Grid - Vertical Stack */
.services-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.service-column {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: stretch;
}

/* Cards - Base */
.card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.card:hover {
    transform: translateY(-6px) scale(1.01);
    background: var(--glass-bg-hover);
}

/* Hero Cards */
.hero-card {
    flex: 1;
    min-height: 140px;
}

.hero-card .card-icon {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-card .card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hero-card h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

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

/* Request Cards */
.request-card {
    width: 200px;
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
    gap: 0.75rem;
    justify-content: center;
}

.request-card .card-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto;
}

.request-card .card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.request-label {
    display: inline-block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 0.25rem;
}

.request-card h3 {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Card Arrow */
.card-arrow {
    margin-left: auto;
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: all 0.4s ease;
    opacity: 0.5;
}

.card:hover .card-arrow {
    color: var(--text-primary);
    transform: translateX(6px);
    opacity: 1;
}

.request-card .card-arrow {
    display: none;
}

/* Card Content */
.card-content {
    flex: 1;
    min-width: 0;
}

/* Category-specific styling */
[data-category="video"] .hero-card {
    border-color: rgba(229, 160, 13, 0.15);
}
[data-category="video"] .card:hover {
    box-shadow:
        0 20px 60px rgba(229, 160, 13, 0.15),
        0 0 0 1px rgba(229, 160, 13, 0.2),
        inset 0 1px 0 rgba(229, 160, 13, 0.1);
}
[data-category="video"] .hero-card .card-icon {
    background: rgba(229, 160, 13, 0.1);
}

[data-category="music"] .hero-card {
    border-color: rgba(0, 200, 83, 0.15);
}
[data-category="music"] .card:hover {
    box-shadow:
        0 20px 60px rgba(0, 200, 83, 0.15),
        0 0 0 1px rgba(0, 200, 83, 0.2),
        inset 0 1px 0 rgba(0, 200, 83, 0.1);
}
[data-category="music"] .hero-card .card-icon {
    background: rgba(0, 200, 83, 0.1);
}

[data-category="books"] .hero-card {
    border-color: rgba(79, 195, 247, 0.15);
}
[data-category="books"] .card:hover {
    box-shadow:
        0 20px 60px rgba(79, 195, 247, 0.15),
        0 0 0 1px rgba(79, 195, 247, 0.2),
        inset 0 1px 0 rgba(79, 195, 247, 0.1);
}
[data-category="books"] .hero-card .card-icon {
    background: rgba(79, 195, 247, 0.1);
}

[data-category="audiobooks"] .hero-card {
    border-color: rgba(171, 71, 188, 0.15);
}
[data-category="audiobooks"] .card:hover {
    box-shadow:
        0 20px 60px rgba(171, 71, 188, 0.15),
        0 0 0 1px rgba(171, 71, 188, 0.2),
        inset 0 1px 0 rgba(171, 71, 188, 0.1);
}
[data-category="audiobooks"] .hero-card .card-icon {
    background: rgba(171, 71, 188, 0.1);
}

/* Matrix Section */
.matrix-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.matrix-card {
    max-width: 100%;
    border-color: rgba(0, 188, 212, 0.15);
}

.matrix-card:hover {
    box-shadow:
        0 20px 60px rgba(0, 188, 212, 0.12),
        0 0 0 1px rgba(0, 188, 212, 0.2),
        inset 0 1px 0 rgba(0, 188, 212, 0.1);
}

.matrix-card .card-icon {
    width: 56px;
    height: 56px;
    padding: 10px;
    background: rgba(0, 188, 212, 0.1);
    border-radius: 14px;
}

.matrix-card .card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.matrix-card h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.matrix-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Hero Wrapper for info button positioning */
.hero-wrapper {
    position: relative;
    flex: 1;
    display: flex;
}

.hero-wrapper .hero-card {
    flex: 1;
}

/* Info Button */
.info-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.info-btn:hover,
.info-btn:focus {
    z-index: 200;
}

.info-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Info Popup */
.info-popup {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 300px;
    padding: 1.25rem;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    text-align: left;
    z-index: 1000;
}

.info-btn:hover .info-popup,
.info-btn:focus .info-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.info-popup h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.info-popup ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-popup li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.4rem 0;
    padding-left: 1.25rem;
    position: relative;
    line-height: 1.4;
}

.info-popup li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

/* App Links in Popup */
.app-links {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.app-links h5 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.app-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.app-row:last-child {
    margin-bottom: 0;
}

.app-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.app-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.app-link svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.app-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 0;
}

/* Popup that opens upward */
.info-popup.popup-up {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 8px;
    transform: translateY(10px);
}

.info-btn:hover .info-popup.popup-up,
.info-btn:focus .info-popup.popup-up {
    transform: translateY(0);
}

/* Matrix wrapper */
.matrix-wrapper {
    max-width: 100%;
    position: relative;
}

.matrix-wrapper .matrix-card {
    flex: 1;
}

.matrix-wrapper .info-btn {
    position: absolute;
    top: 12px;
    right: 12px;
}

/* Chat category popup styling */
[data-category="chat"] .info-popup {
    border-color: rgba(0, 188, 212, 0.2);
}
[data-category="chat"] .info-popup li::before {
    color: var(--color-chat);
}

/* Category-specific info popup accents */
[data-category="video"] .info-popup {
    border-color: rgba(229, 160, 13, 0.2);
}
[data-category="video"] .info-popup li::before {
    color: var(--color-video);
}

[data-category="music"] .info-popup {
    border-color: rgba(0, 200, 83, 0.2);
}
[data-category="music"] .info-popup li::before {
    color: var(--color-music);
}

[data-category="books"] .info-popup {
    border-color: rgba(79, 195, 247, 0.2);
}
[data-category="books"] .info-popup li::before {
    color: var(--color-books);
}

[data-category="audiobooks"] .info-popup {
    border-color: rgba(171, 71, 188, 0.2);
}
[data-category="audiobooks"] .info-popup li::before {
    color: var(--color-audiobooks);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 2.5rem 1.25rem 1.5rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    .mascot {
        width: 70px;
        height: 70px;
    }

    .logo {
        flex-direction: column;
        gap: 0.75rem;
    }

    .tagline {
        font-size: 1rem;
    }

    main {
        padding: 1rem 1rem 2rem;
    }

    .services-grid {
        gap: 1.25rem;
    }

    .service-column {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .request-card {
        width: 100%;
        flex-direction: row;
        text-align: left;
        padding: 1rem 1.25rem;
    }

    .request-card .card-icon {
        margin: 0;
        width: 40px;
        height: 40px;
    }

    .request-card h3 {
        font-size: 0.9rem;
    }

    .hero-card {
        min-height: auto;
        padding: 1.25rem;
    }

    .hero-card .card-icon {
        width: 56px;
        height: 56px;
        padding: 10px;
    }

    .hero-card h2 {
        font-size: 1.3rem;
    }

    .hero-card p {
        font-size: 0.9rem;
    }

    .card {
        gap: 1rem;
        border-radius: 16px;
    }

    .card:hover {
        transform: none;
    }

    .card-arrow {
        font-size: 1.25rem;
    }

    /* Info button - larger touch target on mobile */
    .info-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    /* Info popup - full width on mobile */
    .info-popup {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        overflow-y: auto;
        border-radius: 20px 20px 0 0;
        margin: 0;
        padding: 1.5rem;
        transform: translateY(100%);
    }

    .info-btn:hover .info-popup,
    .info-btn:focus .info-popup {
        transform: translateY(0);
    }

    .info-popup.popup-up {
        top: auto;
        bottom: 0;
        margin-bottom: 0;
        transform: translateY(100%);
    }

    .info-btn:hover .info-popup.popup-up,
    .info-btn:focus .info-popup.popup-up {
        transform: translateY(0);
    }

    .info-popup h4 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .info-popup li {
        font-size: 0.95rem;
        padding: 0.5rem 0;
    }

    .app-links {
        margin-top: 1.25rem;
        padding-top: 1.25rem;
    }

    .app-row {
        flex-wrap: wrap;
    }

    .app-link {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

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

    /* Matrix section */
    .matrix-section {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }

    .matrix-card {
        padding: 1.25rem;
    }

    .matrix-card .card-icon {
        width: 48px;
        height: 48px;
    }

    .matrix-card h2 {
        font-size: 1.2rem;
    }

    .matrix-card p {
        font-size: 0.85rem;
    }

    footer {
        padding: 1.5rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 400px) {
    header {
        padding: 2rem 1rem 1.25rem;
    }

    h1 {
        font-size: 2rem;
    }

    .mascot {
        width: 60px;
        height: 60px;
    }

    .tagline {
        font-size: 0.9rem;
    }

    main {
        padding: 0.75rem 0.75rem 2rem;
    }

    .hero-card {
        padding: 1rem;
    }

    .hero-card .card-icon {
        width: 48px;
        height: 48px;
        padding: 8px;
    }

    .hero-card h2 {
        font-size: 1.15rem;
    }

    .hero-card p {
        font-size: 0.85rem;
    }

    .request-card {
        padding: 0.875rem 1rem;
    }

    .app-row {
        gap: 0.4rem;
    }

    .app-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
}