/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', arial, sans-serif;
    background-color: #ffffff;
    color: #202124;
    line-height: 1.6;
}

body.yt-body {
    background-color: #ffffff;
    color: #202124;
}

body.admin-body {
    background-color: #f5f5f5;
    color: #202124;
}

/* Home page */
.home-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

/* Bachatube layout */
.yt-app {
    min-height: 100vh;
    background-color: #ffffff;
}

.yt-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
}

.yt-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.yt-icon-button {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: #202124;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.yt-icon-button svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.yt-icon-button:hover {
    background-color: #f3f4f6;
}

.yt-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #e23636;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.yt-logo img {
    border-radius: 6px;
    display: block;
}

.yt-logo span {
    font-family: 'Roboto', arial, sans-serif;
}

.yt-search-form {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 680px;
    margin-left: 0.75rem;
}

.yt-search-input {
    width: 100%;
    padding: 0.6rem 0.9rem;
    font-size: 1rem;
    border: 1px solid #e3e5e8;
    border-right: none;
    border-radius: 999px 0 0 999px;
    background-color: #ffffff;
    color: #202124;
    outline: none;
}

.yt-search-input::placeholder {
    color: #8d96a0;
}

.yt-search-input:focus {
    border-color: #ff4d4d;
}

.yt-search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 42px;
    border: 1px solid #e3e5e8;
    border-left: none;
    border-radius: 0 999px 999px 0;
    background-color: #ff4d4d;
    cursor: pointer;
    color: #ffffff;
}

.yt-search-button svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.yt-search-button:hover {
    background-color: #e23636;
}

.yt-layout {
    display: flex;
    min-height: calc(100vh - 66px);
}

.yt-sidebar {
    width: 220px;
    flex-shrink: 0;
    padding: 1rem 0.75rem;
    border-right: 1px solid #f0f0f0;
    background-color: #ffffff;
}

.yt-nav-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    color: #202124;
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    transition: background-color 0.2s ease;
}

.yt-nav-item:hover,
.yt-nav-item.active {
    background-color: #ffe3e3;
}

.yt-content {
    flex: 1;
    padding: 1.25rem 1.5rem 2rem;
}

.yt-section-header h1 {
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
}

.yt-section-header p {
    color: #666666;
    font-size: 0.95rem;
}

.yt-chip-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.yt-chip {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background-color: #f3f4f6;
    color: #202124;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.yt-chip:hover {
    background-color: #ffe3e3;
}

.yt-chip.active {
    background-color: #ff4d4d;
    color: #ffffff;
}

.yt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.yt-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.yt-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background-color: #f3f4f6;
    text-decoration: none;
}

.yt-thumb-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.yt-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #7a7a7a;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.8rem;
}

.yt-instagram-icon {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.yt-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.yt-title {
    font-size: 1rem;
    line-height: 1.4;
    margin: 0;
    color: #202124;
}

.yt-title a {
    color: inherit;
    text-decoration: none;
}

.yt-title a:hover {
    text-decoration: underline;
}

.yt-meta-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #666666;
    font-size: 0.85rem;
}

.yt-badge {
    text-transform: uppercase;
    font-size: 0.7rem;
    background-color: #ffe3e3;
    color: #c21818;
    border: 1px solid #ffd0d0;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
}

.yt-dot {
    color: #a0a0a0;
}

.yt-tags {
    margin: 0;
    color: #6b7280;
    font-size: 0.8rem;
    line-height: 1.4;
}

.yt-empty {
    text-align: center;
    padding: 4rem 1.5rem;
    color: #6b7280;
}


.home-title {
    font-size: 5.5rem;
    font-weight: 400;
    margin-bottom: 1.75rem;
    color: #4285f4;
    letter-spacing: 0;
    font-family: 'Roboto', arial, sans-serif;
    position: relative;
}

.home-title::first-letter {
    color: #ea4335;
}

.search-form {
    width: 100%;
    max-width: 584px;
    position: relative;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    fill: #9aa0a6;
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1.5rem 0.875rem 3rem;
    font-size: 1rem;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    outline: none;
    transition: all 0.2s;
    background-color: #fff;
    box-shadow: 0 2px 5px 1px rgba(64, 60, 67, 0.16);
    font-family: arial, sans-serif;
}

.search-input:hover {
    box-shadow: 0 2px 8px 1px rgba(64, 60, 67, 0.28);
    border-color: rgba(223, 225, 229, 0);
}

.search-input:focus {
    box-shadow: 0 2px 8px 1px rgba(64, 60, 67, 0.28);
    border-color: rgba(223, 225, 229, 0);
    outline: none;
}

.search-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

.search-button {
    background-color: #f8f9fa;
    border: 1px solid #f8f9fa;
    border-radius: 4px;
    color: #3c4043;
    font-family: 'Roboto', arial, sans-serif;
    font-size: 0.875rem;
    margin: 0.6875rem 0.25rem;
    padding: 0 1rem;
    line-height: 1.6875rem;
    height: 2.25rem;
    min-width: 3.375rem;
    text-align: center;
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    display: inline-block;
    transition: all 0.1s ease-in-out;
}

.search-button:hover {
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa;
    border: 1px solid #dadce0;
    color: #202124;
}

.search-button:focus {
    border: 1px solid #4285f4;
    outline: none;
}

.lucky-button {
    background-color: #f8f9fa;
    border: 1px solid #f8f9fa;
}

/* Search page */
.search-page {
    max-width: 100%;
    margin: 0;
    padding: 0.5rem 2rem 2rem 180px;
}

@media (max-width: 1200px) {
    .search-page {
        padding: 1.25rem 2rem 2rem 120px;
    }
}

@media (max-width: 900px) {
    .search-page {
        padding: 1.25rem 1.5rem 2rem 1.5rem;
    }
}

.search-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    max-width: 100%;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 300;
    color: #333;
    text-decoration: none;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-link span {
    display: inline-block;
}

.header-logo {
    max-height: 45px;
    width: auto;
    height: auto;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.search-bar {
    flex: 1;
    min-width: 400px;
    max-width: 652px;
}

.filters {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #ebebeb;
    max-width: 652px;
}

.filter-label {
    font-weight: 500;
}

.filter-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #666;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.filter-link:hover {
    background-color: #f5f5f5;
}

.filter-link.active {
    background-color: #4285f4;
    color: white;
}

/* Results - Google style */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
    max-width: 652px;
    padding: 0;
}

.result-item {
    padding: 0;
    margin-bottom: 1.75rem;
    max-width: 100%;
}

.result-title-wrapper {
    margin-bottom: 0.1875rem;
}

.result-title {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.3;
    margin: 0;
    padding: 0;
}

.result-title a {
    color: #1a0dab;
    text-decoration: none;
    cursor: pointer;
}

.result-title a:visited {
    color: #681da8;
}

.result-title a:hover {
    text-decoration: underline;
}

.result-url {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.1875rem;
    line-height: 1.5;
    font-size: 0.875rem;
}

.url-text {
    color: #202124;
    font-size: 0.875rem;
    font-style: normal;
}

.result-type-badge {
    color: #70757a;
    font-size: 0.75rem;
    text-transform: uppercase;
    background: #f1f3f4;
    padding: 0.125rem 0.375rem;
    border-radius: 2px;
}

.result-style {
    color: #70757a;
    font-size: 0.875rem;
}

.result-snippet {
    line-height: 1.58;
    color: #4d5156;
    font-size: 0.875rem;
    margin-top: 0.1875rem;
}

.snippet-text {
    margin: 0.1875rem 0 0 0;
    color: #4d5156;
    font-size: 0.875rem;
    line-height: 1.58;
}

.video-preview {
    margin: 0.5rem 0;
}

.video-thumbnail {
    width: 100%;
    max-width: 600px;
    max-height: 400px;
    border-radius: 4px;
    background: #000;
}

.instagram-preview {
    margin: 0.5rem 0;
}

.instagram-link-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #1a73e8;
    text-decoration: none;
    font-size: 0.875rem;
}

.instagram-link-inline:hover {
    text-decoration: underline;
}

.instagram-icon-small {
    width: 16px;
    height: 16px;
    fill: #1a73e8;
    flex-shrink: 0;
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

/* Admin page */
.admin-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.admin-body .admin-container {
    background-color: #f5f5f5;
}

.admin-container h1 {
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 300;
}

.auth-info {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.auth-info code {
    background: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.admin-forms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
}

.admin-form-section {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
    background: white;
}

.admin-form-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 400;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.form-input:focus {
    border-color: #4285f4;
}

.btn-primary {
    background: #4285f4;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background: #357ae8;
}

.result-success {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
}

.result-success h3 {
    margin-bottom: 0.5rem;
}

.result-success p {
    margin: 0.5rem 0;
}

.result-success a {
    color: #155724;
    text-decoration: underline;
}

.result-error {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
}

.result-error h3 {
    margin-bottom: 0.5rem;
}

.btn-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: #4285f4;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.btn-link:hover {
    background: #357ae8;
}

/* Responsive */
@media (max-width: 768px) {
    .home-title {
        font-size: 3.5rem;
    }
    
    .search-input {
        max-width: 100%;
        padding: 0.75rem 1.25rem 0.75rem 2.5rem;
    }
    
    .search-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .search-button {
        width: 100%;
        max-width: 200px;
    }

    .admin-forms {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .yt-layout {
        flex-direction: column;
    }

    .yt-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .yt-nav-item {
        margin-bottom: 0;
    }
}

@media (max-width: 700px) {
    .yt-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .yt-search-form {
        max-width: 100%;
    }
}
