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

body {
    font-family: "Quicksand", -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: #1b1b1b;
    background: #fafafa;
    min-height: 100vh;
}

header {
    text-align: center;
    padding: 2rem 1rem 0.5rem;
}

.logo {
    max-width: 240px;
    height: auto;
}

.subtitle {
    color: #777;
    font-size: 0.95rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

main {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
}

/* Search bar */
.search-bar {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.search-bar input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    color: #1b1b1b;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.search-bar input::placeholder {
    color: #aaa;
}

.search-bar input:focus {
    border-color: #30b800;
}

.search-bar button {
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #30b800;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: #28a000;
}

/* Search mode options */
.search-options {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.75rem;
    padding-left: 0.25rem;
}

.search-options label {
    font-size: 0.85rem;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 500;
}

.search-options input[type="radio"] {
    accent-color: #30b800;
}

.search-hint {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: #888;
    background: #f0f0f0;
    border-radius: 6px;
    line-height: 1.5;
}

.search-hint strong {
    color: #555;
}

/* Status */
.status {
    text-align: center;
    padding: 1rem;
    color: #888;
    font-size: 0.9rem;
}

/* Results */
#results {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.episode-group {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 1rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid #30b800;
}

.episode-group:first-child {
    margin-top: 0;
}

.episode-group-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1b1b1b;
}

.episode-group-date {
    font-size: 0.8rem;
    color: #aaa;
    white-space: nowrap;
}

.result-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    border-left: 3px solid #30b800;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s;
}

.result-card:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.episode-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1b1b1b;
}

.timestamp {
    font-size: 0.8rem;
    color: #30b800;
    font-weight: 600;
    white-space: nowrap;
}

.result-text {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.7;
}

.result-text mark {
    background: rgba(48, 184, 0, 0.15);
    color: #1b7a00;
    padding: 0.05em 0.2em;
    border-radius: 2px;
}

.result-meta {
    margin-top: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #aaa;
}

.listen-link {
    color: #fff;
    background: #30b800;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5em 1em;
    border-radius: 5px;
    font-size: 0.85rem;
    transition: background 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.listen-link:hover {
    background: #28a000;
}

.result-count {
    text-align: center;
    color: #aaa;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.8rem;
}

footer a {
    color: #30b800;
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

/* Mobile */
@media (max-width: 480px) {
    header {
        padding: 1.5rem 1rem 0.5rem;
    }

    .logo {
        max-width: 180px;
    }

    .search-bar {
        gap: 0.4rem;
    }

    .search-bar input {
        padding: 0.65rem 0.75rem;
        font-size: 16px; /* prevents iOS zoom on focus */
    }

    .search-bar button {
        padding: 0.65rem 1rem;
    }

    .search-options {
        gap: 0.75rem;
    }

    .search-options label {
        font-size: 0.9rem;
        padding: 0.25rem 0;
    }

    .search-hint {
        font-size: 0.75rem;
    }

    .episode-group {
        flex-direction: column;
        gap: 0.1rem;
    }

    .result-header {
        flex-direction: column;
        gap: 0.2rem;
    }

    .result-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .listen-link {
        padding: 0.6em 1.2em;
        font-size: 0.9rem;
    }
}
