:root {
    --primary-color: #ff0000;
    --secondary-color: #2c3e50;
    --background-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #777777;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --border-radius: 12px;
}

body.dark-mode {
    --background-color: #121212;
    --secondary-color: #ecf0f1;
    --card-bg: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #b0b0b0;
    --shadow: 0 4px 6px rgba(0,0,0,0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    padding: 2rem;
    transition: background 0.3s, color 0.3s;
}

.container {
    max-width: 900px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

header .text-red {
    color: var(--primary-color);
}

/* Search Results Suggestions */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    margin-top: 10px;
    z-index: 100;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.dark-mode .search-item {
    border-bottom: 1px solid #333;
}

.search-item:hover {
    background-color: #f8f8f8;
}

.dark-mode .search-item:hover {
    background-color: #2a2a2a;
}

.search-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.search-item .info {
    display: flex;
    flex-direction: column;
}

.search-item .title {
    font-weight: 600;
    color: var(--text-main);
}

.search-item .handle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.search-section {
    margin-bottom: 2rem;
    position: relative; /* suggestions 위치 기준 */
}

.search-box {
    display: flex;
    gap: 0.5rem;
    background: var(--card-bg);
    padding: 0.5rem;
    border-radius: 50px;
    box-shadow: var(--shadow);
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-size: 1rem;
    background: transparent;
    color: var(--text-main);
}

.search-box button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.search-box button:hover {
    background-color: #cc0000;
}

.search-box button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Theme Toggle Button */
#themeToggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    color: var(--secondary-color);
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 1000;
}

/* Loading Spinner */
#loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #ddd;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

/* Channel Header */
.channel-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    animation: fadeIn 0.5s ease;
}

#channelAvatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

#channelName {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin: 0;
}

/* Result Dashboard */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.main-card {
    text-align: center;
}

.score-display {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 1rem 0;
}

.score-display small {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.message-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--secondary-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-card i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0.5rem 0;
    color: var(--secondary-color);
}

.stat-card span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.detail-card h4 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    color: var(--secondary-color);
}

#adReportList {
    list-style: none;
}

#adReportList li {
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dark-mode #adReportList li {
    border-bottom: 1px solid #333;
}

#adReportList li:last-child {
    border-bottom: none;
}

.ad-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}

.rank {
    background-color: var(--secondary-color);
    color: var(--card-bg);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

.ad-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    transition: color 0.2s;
    max-width: 250px;
}

.ad-title:hover {
    color: var(--primary-color);
}

.category-badge {
    background-color: #eee;
    color: #555;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    white-space: nowrap;
}

.dark-mode .category-badge {
    background-color: #333;
    color: #aaa;
}

/* Verify Section */
.scan-verify-card {
    background-color: #f9f9f9;
    border: 1px dashed #ccc;
}

.dark-mode .scan-verify-card {
    background-color: #1a1a1a;
    border: 1px dashed #444;
}

.verify-item {
    margin: 0.5rem 0;
    display: flex;
    gap: 10px;
    font-size: 0.9rem;
}

.verify-item span {
    color: var(--text-muted);
}

#lastVideoLink {
    color: var(--secondary-color);
    text-decoration: underline;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
