/**
 * Match Info Finder - Modern Responsive Styles
 * Mobile-first design with glassmorphism and smooth animations
 */

/* === CSS Variables === */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --bg-dark: #0f0f23;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #b4b4c8;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Base Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(245, 87, 108, 0.1) 0%, transparent 50%);
    animation: gradientShift 20s ease infinite;
    z-index: -1;
}

@keyframes gradientShift {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(-5%, 5%) rotate(180deg);
    }
}

/* === Container === */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
}

/* === Header === */
.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    stroke: url(#logo-gradient);
    filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.5));
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    line-height: 1.2;
    word-break: break-word;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

/* === Fake Video Player (Ad) === */
.video-player-container {
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease 0.3s backwards;
}

.video-player {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: var(--transition);
}

.video-player:hover .play-overlay {
    transform: translate(-50%, -50%) scale(1.1);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 aspect ratio */
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    overflow: hidden;
    cursor: pointer;
}

.video-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(102, 126, 234, 0.3) 0%, transparent 60%),
        radial-gradient(circle at 70% 50%, rgba(245, 87, 108, 0.2) 0%, transparent 60%);
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.video-info {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 0, 0, 0.9);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.4);
    flex-shrink: 0;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.video-title {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    margin: 0;
    line-height: 1.3;
    word-break: break-word;
    flex: 1;
}

/* Centered Play Icon Overlay */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    width: 80px;
    height: 80px;
    background: rgba(255, 0, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.5);
}

.play-overlay:hover {
    background: rgba(255, 0, 0, 1);
    box-shadow: 0 6px 30px rgba(255, 0, 0, 0.7);
}

.play-icon {
    width: 40px;
    height: 40px;
    color: white;
    margin-left: 4px;
    /* Slight offset for visual centering */
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ff0000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Bottom Info Overlay */
.video-bottom-info {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.viewers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.quality {
    padding: 0.25rem 0.75rem;
    background: rgba(255, 0, 0, 0.9);
    border: 1px solid rgba(255, 0, 0, 1);
    border-radius: 4px;
    font-weight: 700;
    color: white;
    font-size: 0.75rem;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.4);
}

/* === Description Page (Homepage without query) === */
.description-container {
    max-width: 800px;
    margin: 0 auto 3rem;
    animation: fadeInUp 0.6s ease 0.2s backwards;
}

.description-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-lg);
}

.description-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.description-content p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-align: justify;
}

.description-content p:last-child {
    margin-bottom: 0;
}

/* === Search Section === */
.search-section {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    animation: fadeInUp 0.6s ease 0.2s backwards;
}

.search-section.compact {
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.search-form {
    width: 100%;
}

.search-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    pointer-events: none;
}

#queryInput {
    flex: 1;
    padding: 1rem 1rem 1rem 3rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    position: relative;
}

#queryInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

#queryInput::placeholder {
    color: var(--text-secondary);
}

.search-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.4);
}

.search-button:active {
    transform: translateY(0);
}

.button-icon {
    width: 20px;
    height: 20px;
}

/* === Examples === */
.examples {
    margin-top: 1.5rem;
    text-align: center;
}

.examples-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.example-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.example-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

.example-tag:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #667eea;
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* === Loading State === */
.loading-state {
    text-align: center;
    padding: 3rem 2rem;
    animation: fadeIn 0.3s ease;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === Error Container === */
.error-container {
    animation: fadeInUp 0.6s ease;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(245, 87, 108, 0.1);
    border: 1px solid rgba(245, 87, 108, 0.3);
    border-radius: var(--radius-md);
    color: #ff6b81;
    margin-bottom: 1.5rem;
}

.error-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* === Results Container === */
.results-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s ease;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.results-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.new-search-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

.new-search-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateX(-4px);
}

.new-search-button svg {
    width: 16px;
    height: 16px;
}

/* === Match Info Content === */
.match-info-content {
    line-height: 1.8;
}

.match-info-content h1,
.match-info-content h2,
.match-info-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.match-info-content h1 {
    font-size: 1.75rem;
    color: var(--text-primary);
}

.match-info-content h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
    padding-bottom: 0.5rem;
}

.match-info-content h3 {
    font-size: 1.25rem;
    color: #667eea;
}

.match-info-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.match-info-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.match-info-content ul {
    margin: 1rem 0;
    padding-left: 0;
    list-style: none;
}

.match-info-content li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.match-info-content li::before {
    content: '●';
    position: absolute;
    left: 0;
    color: #667eea;
}

/* === Footer === */
.footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer strong {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-note {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* === Animations === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
    }

    .video-player-container {
        margin-bottom: 1.5rem;
    }

    .video-title {
        font-size: 0.875rem;
    }

    .play-overlay {
        width: 70px;
        height: 70px;
    }

    .play-icon {
        width: 35px;
        height: 35px;
    }

    .spinner {
        width: 50px;
        height: 50px;
    }

    .loading-text {
        font-size: 0.875rem;
    }

    .description-content {
        padding: 2rem 1.5rem;
    }

    .description-content h2 {
        font-size: 1.75rem;
    }

    .description-content p {
        font-size: 1rem;
        line-height: 1.7;
    }

    .search-section {
        padding: 1rem;
    }

    .search-input-wrapper {
        position: relative;
        /* Keep icon inside */
    }

    #queryInput {
        width: 100%;
        margin-bottom: 0.75rem;
    }

    .search-button {
        width: 100%;
        justify-content: center;
    }

    .button-text {
        display: block;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .results-container {
        padding: 1.5rem;
    }

    .match-info-content h1 {
        font-size: 1.5rem;
    }

    .match-info-content h2 {
        font-size: 1.25rem;
    }

    .match-info-content h3 {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.75rem 0.5rem;
    }

    .header {
        margin-bottom: 1.5rem;
    }

    .header h1 {
        font-size: 1.1rem;
        line-height: 1.2;
    }

    .logo {
        gap: 0.5rem;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
    }

    .tagline {
        font-size: 0.75rem;
    }

    .video-player-container {
        margin-bottom: 1rem;
    }

    .video-info {
        top: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
    }

    .video-title {
        font-size: 0.7rem;
        line-height: 1.2;
    }

    .live-badge {
        font-size: 0.6rem;
        padding: 0.25rem 0.5rem;
        margin-bottom: 0.35rem;
    }

    .live-dot {
        width: 5px;
        height: 5px;
    }

    .play-overlay {
        width: 50px;
        height: 50px;
    }

    .play-icon {
        width: 24px;
        height: 24px;
    }

    .video-bottom-info {
        bottom: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
    }

    .viewers {
        font-size: 0.65rem;
    }

    .quality {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
    }

    .search-section {
        padding: 0.75rem;
    }

    .search-input-wrapper {
        position: relative;
        display: block;
    }

    #queryInput {
        font-size: 0.875rem;
        padding: 0.75rem 0.75rem 0.75rem 2.5rem;
        width: 100%;
        margin-bottom: 0.75rem;
    }

    .search-icon {
        position: absolute;
        left: 0.875rem;
        top: 0.75rem;
        width: 16px;
        height: 16px;
    }

    .search-button {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
        width: 100%;
    }

    .example-tags {
        flex-direction: column;
        gap: 0.5rem;
    }

    .example-tag {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
    }

    .description-container {
        margin-bottom: 2rem;
    }

    .description-content {
        padding: 1.5rem 1rem;
    }

    .description-content h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .description-content p {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }

    .results-container {
        padding: 1rem;
    }

    .match-info-content h1 {
        font-size: 1.25rem;
    }

    .match-info-content h2 {
        font-size: 1.1rem;
    }

    .match-info-content h3 {
        font-size: 1rem;
    }
}