/* General Setup */
body { font-family: Arial, sans-serif; margin: 0; padding: 0; color: #202124; overflow-x: hidden; }
.blue { color: #4285F4; } .red { color: #EA4335; } .yellow { color: #FBBC05; } .green { color: #34A853; }

/* Top Navigation Buttons */
.top-right-nav { position: absolute; top: 25px; right: 30px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.top-bar-actions { margin-left: auto; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.github-btn { 
    display: inline-flex; align-items: center; justify-content: center; background-color: #1f2328; color: #ffffff; 
    text-decoration: none; padding: 0 16px; height: 42px; box-sizing: border-box; border-radius: 6px; font-size: 15px; 
    font-weight: 500; transition: background-color 0.2s, opacity 0.2s;
}
.github-btn:hover { background-color: #000000; opacity: 0.9; }
.github-icon { 
    width: 22px; height: 22px; margin-right: 8px; 
    filter: brightness(0) invert(1); 
}
.github-text:hover { text-decoration: underline; }

.purple-btn {
    display: inline-flex; align-items: center; justify-content: center;
    background-color: #673ab7; color: #ffffff; text-decoration: none;
    padding: 0 18px; height: 42px; box-sizing: border-box; border-radius: 6px; font-size: 15px; font-weight: 500;
    transition: background-color 0.2s, box-shadow 0.2s;
}
.purple-btn:hover { background-color: #512da8; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }

/* Home View */
.home-body { display: flex; align-items: center; justify-content: center; height: 100vh; text-align: center; position: relative; }
.logo { font-size: 80px; margin-bottom: 25px; font-weight: bold; letter-spacing: -2px; }
.demo-tag { font-size: 30px; vertical-align: top; margin-left: 8px; color: #70757a; font-weight: normal; }
.search-box { width: 584px; padding: 14px 20px; border-radius: 24px; border: 1px solid #dfe1e5; font-size: 16px; outline: none; }
.search-box:hover { box-shadow: 0 1px 6px rgba(32,33,36,.28); }
.btn-group { margin-top: 25px; }
.search-btn { margin: 0 4px; padding: 10px 20px; background-color: #f8f9fa; border: 1px solid #f8f9fa; border-radius: 4px; cursor: pointer; color: #3c4043; }

/* SERP Top Bar */
.top-bar { display: flex; align-items: center; padding: 20px 30px; gap: 20px; }
.logo-small { font-size: 28px; margin: 0; }
.search-input-wrapper { position: relative; width: 690px; display: flex; align-items: center; }
.search-box-small { width: 100%; padding: 10px 45px 10px 20px; border-radius: 24px; border: 1px solid #dfe1e5; font-size: 16px; outline: none; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.search-btn-small { position: absolute; right: 15px; background: none; border: none; font-size: 18px; cursor: pointer; color: #4285F4; }
hr { border: 0; height: 1px; background: #ebebeb; margin: 0; }

/* Results Container & Pagination */
.results-container { padding: 20px 180px; max-width: 652px; }
.result-stats { color: #70757a; font-size: 14px; margin-bottom: 20px; }

.pagination-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; background-color: #f8f9fa; padding: 12px 16px; border-radius: 8px; border: 1px solid #dfe1e5; gap: 15px; margin-bottom: 15px; }
.pagination-controls.bottom { margin-top: 30px; margin-bottom: 60px; }
.limit-form { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #3c4043; }
.limit-form select { padding: 8px 12px; border-radius: 4px; border: 1px solid #dadce0; background: white; font-size: 14px; outline: none; cursor: pointer; }
.page-nav { display: flex; align-items: center; gap: 12px; }
.page-btn { text-decoration: none; padding: 8px 14px; border-radius: 4px; border: 1px solid #dadce0; background: white; color: #1a0dab; font-size: 14px; transition: background 0.2s; }
.page-btn:hover { background: #f1f3f4; }
.page-info { font-size: 14px; color: #70757a; }

/* Result Items */
.result-item { display: flex; gap: 16px; margin-bottom: 35px; align-items: flex-start; }
.result-content { flex-grow: 1; min-width: 0; }
.result-cite { font-size: 14px; color: #202124; margin-bottom: 4px; }
.breadcrumb-arrow { color: #70757a; margin: 0 4px; }
.result-title h3 { color: #1a0dab; font-size: 20px; font-weight: 400; margin: 0; }
.result-title:hover h3 { text-decoration: underline; }
.result-meta { font-size: 13px; color: #70757a; margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { background: #f1f3f4; padding: 3px 8px; border-radius: 4px; font-weight: 600; font-size: 11px; color: #3c4043; }
.badge-secondary { background: #e8f0fe; color: #1967d2; }
.action-row { margin: 10px 0; }
.folder-btn { font-size: 12px; background: #f8f9fa; border: 1px solid #dadce0; padding: 6px 12px; border-radius: 18px; cursor: pointer; display: inline-block; }

.result-snippet { 
    font-size: 14px; color: #4d5156; line-height: 1.58; margin: 5px 0 0 0;
    word-wrap: break-word; white-space: normal;
}

/* Media Previews */
.result-media-thumb { 
    flex-shrink: 0; width: 90px; height: 90px; border-radius: 8px; 
    overflow: hidden; border: 1px solid #dadce0; background: #f8f9fa; position: relative; cursor: pointer;
}
.result-media-thumb:hover .media-preview-square { filter: brightness(0.8); }
.media-preview-square { width: 100%; height: 100%; object-fit: cover; transition: filter 0.2s; }
.media-preview-square::-webkit-media-controls { display: none !important; }

.play-overlay { 
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); 
    width: 36px; height: 36px; background: rgba(0,0,0,0.6); color: white; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center; 
    font-size: 14px; padding-left: 3px; box-sizing: border-box; pointer-events: none;
}
.result-media-thumb:hover .play-overlay { background: rgba(26, 13, 171, 0.85); transform: translate(-50%, -50%) scale(1.1); }

/* Modal Player (Theater Mode) */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background-color: rgba(0, 0, 0, 0.85); z-index: 9999; justify-content: center; 
    align-items: center; backdrop-filter: blur(4px);
}
.modal-content {
    position: relative; width: 90%; max-width: 1000px; display: flex; justify-content: center; align-items: center;
}
.modal-content video, .modal-content img {
    max-width: 100%; max-height: 85vh; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); background: #000;
}
.modal-content video { width: 100%; outline: none; }
.close-modal {
    position: fixed; top: 20px; right: 30px; color: white; font-size: 44px; font-weight: bold;
    cursor: pointer; z-index: 10000; line-height: 1; text-shadow: 0 2px 4px rgba(0,0,0,0.8); transition: color 0.2s, transform 0.2s;
}
.close-modal:hover { color: #d2d5d9; transform: scale(1.1); }

@media (max-width: 850px) { .results-container { padding: 20px 40px; } }
@media (max-width: 600px) { .top-right-nav { top: 15px; right: 15px; } .github-btn, .purple-btn { font-size: 13px; padding: 0 12px; height: 38px; } }