* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Default RuPaul color palette */
    --primary-color: #ff69b4;
    --primary-dark: #ff1493;
    --secondary-color: #ffccff;
    --accent-color: #ffffff;
    --text-on-primary: #ffffff;
    --text-on-secondary: #ff69b4;
    --background-tint: rgba(255, 105, 180, 0.05);
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #121212;
    color: #ffffff;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    transition: background 0.6s ease;
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    letter-spacing: 0.25px;
}

.container {
    background: transparent;
    max-width: 100%;
    width: 100%;
    padding: 20px 40px;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 24px;
    padding-top: 20px;
    overflow: visible;
}

h1 {
    /* M3 Display Large */
    font-size: 57px;
    font-weight: 400;
    line-height: 64px;
    letter-spacing: -0.25px;
    color: var(--primary-color);
    margin-bottom: 16px;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.inline-search-header {
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 20px;
}

.header-text {
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
}

.inline-search-wrapper {
    position: relative;
    display: inline-block;
    min-width: 200px;
    max-width: 600px;
    flex-shrink: 1;
    overflow: visible;
}

.inline-search-input {
    /* M3 Display Large to match h1 */
    font-size: 57px;
    font-weight: 400;
    line-height: 64px;
    letter-spacing: -0.25px;
    color: var(--primary-color);
    border: none;
    border-bottom: 3px solid var(--primary-color);
    background: transparent;
    padding: 0 10px 8px 10px;
    text-align: center;
    width: 100%;
    min-width: 100px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    border-radius: 0;
}

.inline-search-input:hover {
    border-bottom-color: var(--primary-dark);
}

.inline-search-input:focus {
    outline: none;
    border-bottom-color: var(--primary-dark);
}

.inline-search-input::placeholder {
    color: var(--primary-color);
    opacity: 0.6;
}

.subtitle {
    /* M3 Title Large */
    font-size: 22px;
    font-weight: 400;
    line-height: 28px;
    letter-spacing: 0px;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

/* Old search container styles - no longer needed with inline search */

.search-results {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 500px;
    background: #1e1e1e;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    max-height: 400px;
    overflow: hidden;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 16px 24px;
    cursor: pointer;
    border-bottom: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.search-result-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.search-result-item:last-child::after {
    display: none;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-result-item:active {
    background: rgba(255, 255, 255, 0.15);
}

.search-result-item img {
    width: 48px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: none;
}

.search-result-info {
    flex: 1;
}

.search-result-title {
    /* M3 Body Large */
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.search-result-year {
    /* M3 Body Medium */
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: 0.25px;
    color: rgba(255, 255, 255, 0.7);
}

.search-loading {
    /* M3 Body Medium */
    padding: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: 0.25px;
}

.search-no-results {
    /* M3 Body Medium */
    padding: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: 0.25px;
}

/* Clear button removed - no longer needed */

.country-selector-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--secondary-color);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease;
}

.selector-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.selector-right {
    display: flex;
    align-items: center;
}

.country-selector-container label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-on-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.country-selector-container select {
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    background: var(--accent-color);
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.country-selector-container select:hover {
    background: var(--secondary-color);
    border-color: var(--primary-color);
}

.country-selector-container select:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--secondary-color);
}

#countryFlag {
    height: 48px;
    width: auto;
    border-radius: 6px;
    border: 1px solid #333333;
}

.episode-info {
    display: flex;
    flex-direction: row;
    gap: 25px;
    align-items: stretch;
}

.next-episode-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
    flex: 1;
}

.next-episode {
    background: var(--primary-color);
    padding: 24px;
    border-radius: 12px;
    color: var(--text-on-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    min-height: 220px;
}

.next-episode:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--primary-color);
}

.next-episode h2 {
    /* M3 Headline Medium */
    font-size: 28px;
    font-weight: 400;
    line-height: 36px;
    letter-spacing: 0px;
    margin-bottom: 16px;
    text-align: center;
    color: var(--text-on-primary);
    transition: color 0.3s ease;
}

.episode-details {
    text-align: center;
    padding: 10px 0;
    min-height: 140px;
}

.show-title {
    /* M3 Title Large */
    font-size: 22px;
    font-weight: 400;
    line-height: 28px;
    letter-spacing: 0px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    color: var(--text-on-primary);
}

.episode-number {
    /* M3 Body Large */
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
    color: var(--secondary-color);
}

.episode-title {
    /* M3 Body Medium */
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: 0.25px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    color: var(--secondary-color);
}

.next-episode .air-date {
    /* M3 Body Large */
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: 0.5px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.last-episode .air-date {
    /* M3 Body Large */
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: 0.5px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(118, 75, 162, 0.2);
}

.countdown {
    background: var(--primary-color);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 220px;
    transition: background 0.3s ease;
}

.countdown h3 {
    /* M3 Headline Small */
    text-align: center;
    color: var(--text-on-primary);
    font-size: 24px;
    font-weight: 400;
    line-height: 32px;
    letter-spacing: 0px;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.countdown-timer {
    display: flex;
    justify-content: space-around;
    gap: 15px;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.time-value {
    /* M3 Display Medium */
    font-size: 45px;
    font-weight: 400;
    line-height: 52px;
    letter-spacing: 0px;
    color: var(--text-on-primary);
    background: var(--primary-color);
    padding: 24px 20px;
    border-radius: 8px;
    min-width: 85px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.time-value:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--primary-color);
}

.time-label {
    /* M3 Label Medium */
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    letter-spacing: 0.5px;
    color: var(--secondary-color);
    margin-top: 12px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.last-episode {
    background: var(--primary-color);
    padding: 24px;
    border-radius: 12px;
    color: var(--text-on-primary);
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    min-height: auto;
    text-align: center;
}

.last-episode:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--primary-color);
}

.last-episode h2 {
    /* M3 Headline Medium */
    font-size: 28px;
    font-weight: 400;
    line-height: 36px;
    letter-spacing: 0px;
    margin-bottom: 16px;
    text-align: center;
    color: var(--text-on-primary);
    transition: color 0.3s ease;
}

.episode-thumbnail {
    width: 320px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0a0a0a;
    transition: opacity 0.3s ease;
    margin: 0 auto 20px auto;
    display: block;
}

.last-episode .show-title {
    color: var(--text-on-primary);
    font-weight: 600;
    transition: color 0.3s ease;
    margin-bottom: 8px;
}

.last-episode .episode-number {
    color: var(--secondary-color);
    transition: color 0.3s ease;
    margin-bottom: 4px;
}

.last-episode .episode-title {
    color: var(--secondary-color);
    transition: color 0.3s ease;
    margin-bottom: 12px;
}

.last-episode .air-date {
    color: var(--text-on-primary);
    font-weight: 500;
    transition: color 0.3s ease;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

/* Episode image container no longer used - image is now the background */

/* Home Button */
.home-button {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-on-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.home-button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.home-button:active {
    transform: scale(0.95);
}

/* Add Show Button */
.add-show-button {
    margin-top: 20px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: all 0.3s ease;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.add-show-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.add-show-button:active {
    transform: scale(0.98);
}

.add-show-button svg {
    flex-shrink: 0;
}

.add-show-button.added {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

/* Saved Shows Container */
.saved-shows-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.saved-shows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.saved-show-card {
    background: var(--primary-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 100px;
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.saved-show-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

.saved-show-card h3 {
    /* M3 Title Large */
    font-size: 22px;
    font-weight: 400;
    line-height: 28px;
    color: var(--text-on-primary);
    margin: 0;
    flex-shrink: 1;
    min-width: 0;
}

.saved-show-card .next-air-date {
    /* M3 Body Medium */
    font-size: 14px;
    line-height: 20px;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.saved-show-card .episode-info {
    /* M3 Body Small */
    font-size: 12px;
    line-height: 16px;
    color: var(--secondary-color);
}

/* Card Countdown */
.card-countdown {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.card-countdown-part {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.card-countdown-value {
    /* M3 Title Large */
    font-size: 22px;
    font-weight: 400;
    line-height: 28px;
    color: var(--text-on-primary);
}

.card-countdown-label {
    /* M3 Label Small */
    font-size: 10px;
    font-weight: 500;
    line-height: 16px;
    letter-spacing: 0.5px;
    color: var(--secondary-color);
    text-transform: lowercase;
}

.remove-show-button {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.9);
    border: none;
    color: var(--text-on-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
}

.saved-show-card:hover .remove-show-button {
    opacity: 1;
}

.remove-show-button:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: scale(1.1);
}

footer {
    /* M3 Body Small */
    margin-top: 30px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    letter-spacing: 0.4px;
}

/* Tablet landscape and smaller desktop (1366x768 friendly) */
@media (max-width: 1440px) {
    .container {
        padding: 25px;
    }

    header {
        margin-bottom: 25px;
    }

    h1 {
        /* M3 Display Medium for tablet */
        font-size: 45px;
        line-height: 52px;
        margin-bottom: 12px;
    }

    .inline-search-input {
        /* M3 Display Medium for tablet */
        font-size: 45px;
        line-height: 52px;
        padding: 8px 16px;
    }

    .inline-search-wrapper {
        min-width: 180px;
        max-width: 400px;
    }

    .inline-search-header {
        gap: 12px;
        justify-content: center;
    }

    .search-results {
        min-width: 400px;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .episode-info {
        gap: 25px;
    }

    .next-episode-column {
        gap: 25px;
    }

    .next-episode,
    .last-episode,
    .countdown {
        padding: 25px;
    }

    .next-episode h2,
    .last-episode h2 {
        font-size: 1.6rem;
        margin-bottom: 18px;
    }

    .countdown h3 {
        font-size: 1.3rem;
        margin-bottom: 18px;
    }

    .show-title {
        font-size: 1.3rem;
    }

    .episode-number {
        font-size: 1rem;
    }

    .episode-title {
        font-size: 1rem;
    }

    .next-episode .air-date,
    .last-episode .air-date {
        font-size: 0.95rem;
    }

    .time-value {
        font-size: 2.5rem;
        padding: 18px 15px;
        min-width: 70px;
    }

    .time-label {
        font-size: 0.75rem;
    }

    .country-selector-container {
        padding: 18px;
        margin-bottom: 25px;
    }

    .country-selector-container label {
        font-size: 1rem;
    }

    .country-selector-container select {
        padding: 8px 16px;
        font-size: 0.95rem;
    }

    .countdown-timer {
        gap: 10px;
    }

    .last-episode {
        min-height: auto;
        padding: 24px;
    }

    footer {
        margin-top: 30px;
        font-size: 0.85rem;
    }
}

@media (max-width: 1200px) {
    .episode-info {
        flex-direction: column;
    }

    .container {
        max-width: 800px;
    }
}

/* Optimize for shorter viewports (like 1366x768) */
@media (max-height: 800px) {
    .container {
        padding: 20px;
    }

    header {
        margin-bottom: 20px;
    }

    h1 {
        font-size: 2.5rem;
        margin-bottom: 8px;
    }

    .subtitle {
        font-size: 1rem;
    }

    .country-selector-container {
        padding: 15px;
        margin-bottom: 20px;
    }

    .episode-info {
        gap: 20px;
    }

    .next-episode-column {
        gap: 20px;
    }

    .next-episode,
    .last-episode,
    .countdown {
        padding: 20px;
    }

    .next-episode h2,
    .last-episode h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .countdown h3 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    footer {
        margin-top: 25px;
    }
}

@media (max-width: 768px) {
    .home-button {
        width: 40px;
        height: 40px;
        top: 15px;
        left: 15px;
    }

    .home-button svg {
        width: 20px;
        height: 20px;
    }

    .saved-shows-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .card-countdown {
        gap: 6px;
    }

    .card-countdown-value {
        font-size: 18px;
        line-height: 24px;
    }

    .card-countdown-label {
        font-size: 9px;
    }

    h1 {
        /* M3 Display Small for mobile */
        font-size: 36px;
        line-height: 44px;
    }

    .inline-search-input {
        /* M3 Display Small for mobile */
        font-size: 36px;
        line-height: 44px;
        padding: 6px 12px;
    }

    .inline-search-wrapper {
        min-width: 140px;
        max-width: 300px;
    }

    .inline-search-header {
        gap: 8px;
        justify-content: center;
    }

    .search-results {
        min-width: 90vw;
        left: 50%;
        transform: translateX(-50%);
    }

    .country-selector-container {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
    }

    .selector-left {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .country-selector-container label {
        font-size: 1rem;
    }

    .country-selector-container select {
        width: 100%;
        max-width: 300px;
        font-size: 0.95rem;
    }

    #countryFlag {
        height: 40px;
    }

    .episode-thumbnail {
        width: 240px;
        height: 135px;
    }

    .countdown-timer {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .time-block {
        min-width: auto;
        flex: 1;
    }

    .time-value {
        font-size: 1.75rem;
        padding: 12px 8px;
        min-width: auto;
        width: 100%;
    }

    .time-label {
        font-size: 0.65rem;
        margin-top: 8px;
    }

    .container {
        padding: 20px;
    }

    .show-title {
        font-size: 1.2rem;
    }

    .episode-number {
        font-size: 1rem;
    }

    .episode-title {
        font-size: 0.95rem;
    }

    .air-date {
        font-size: 1.1rem;
    }
}

/* Extra small screens - optimize countdown for phones */
@media (max-width: 480px) {
    h1 {
        font-size: 28px;
        line-height: 36px;
    }

    .inline-search-header {
        gap: 5px;
        justify-content: center;
    }

    .inline-search-input {
        /* Smaller for very small screens */
        font-size: 28px;
        line-height: 36px;
        padding: 4px 8px;
    }

    .inline-search-wrapper {
        min-width: 100px;
        max-width: 200px;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .countdown-timer {
        gap: 4px;
    }

    .time-value {
        font-size: 1.5rem;
        padding: 10px 4px;
    }

    .time-label {
        font-size: 0.6rem;
        margin-top: 6px;
    }

    .countdown h3 {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }
}
