/* =========================================================
   ULTIMATE CSS STYLESHEET FOR VidSEO pro
   THEME: TubeTric Inspired (Dark & Red)
   VERSION: Final, Full & Formatted Code
   ========================================================= */

/* --- General Setup & Variables --- */
:root {
    --dark-bg: #101010;
    --card-bg: #1A1A1A;
    --primary-red: #FF003C;
    --primary-red-glow: rgba(255, 0, 60, 0.5);
    --text-light: #F0F0F0;
    --text-dark: #A0A0A0;
    --border-color: #2a2a2a;
    --font-family: 'Poppins', sans-serif;
}

html.light-mode {
    --dark-bg: #F8F9FA;
    --card-bg: #FFFFFF;
    --text-light: #101010;
    --text-dark: #555555;
    --border-color: #E0E0E0;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--dark-bg);
    color: var(--text-light);
    transition: background-color 0.3s, color 0.3s;
}

#tsparticles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Header & Navigation (FIXED) --- */
.header {
    backdrop-filter: blur(10px);
    background: rgba(16, 16, 16, 0.5);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    text-decoration: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo-icon {
    height: 32px;
    animation: wipe-in-out 5s infinite ease-in-out;
}

@keyframes wipe-in-out {
    0% {
        clip-path: inset(0 100% 0 0);
    }
    40% {
        clip-path: inset(0 0 0 0);
    }
    60% {
        clip-path: inset(0 0 0 0);
    }
    100% {
        clip-path: inset(0 0 0 100%);
    }
}

.hamburger-menu,
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    z-index: 10;
    transition: all 0.3s;
}

.theme-toggle:hover,
.hamburger-menu:hover {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
}

.mobile-nav {
    display: none;
    flex-direction: column;
    background: #151515;
    border-top: 1px solid var(--border-color);
}

.mobile-nav.active {
    display: flex;
}

.mobile-nav a {
    color: var(--text-light);
    text-decoration: none;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
}

/* --- Hero & Feature Cards --- */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
}

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

.hero-tagline {
    font-size: 1.1rem;
    color: var(--text-dark);
    max-width: 600px;
    margin: 1.5rem auto 0 auto;
    line-height: 1.6;
}

.features-section {
    padding: 2rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 15px;
    text-decoration: none;
    color: var(--text-light);
    transition: all 0.3s ease;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-red);
}

.feature-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem auto;
    border-radius: 50%;
    background-color: rgba(255, 0, 60, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-red);
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-dark);
    font-size: 1rem;
    line-height: 1.6;
}

.wide-card {
    grid-column: 1 / -1;
}

@keyframes icon-fade-glow {
    0% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); text-shadow: 0 0 15px var(--primary-red-glow); }
    100% { opacity: 0.7; transform: scale(1); }
}

.live-icon {
    animation: icon-fade-glow 3s infinite ease-in-out;
}

/* --- Tool Pages --- */
.tool-page-main {
    padding: 3rem 0;
    display: grid;
    gap: 2rem;
}

.tool-page-main.full-width {
    grid-template-columns: 1fr;
}

.tool-content-wrapper {
    text-align: center;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
}

.tool-content-wrapper h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.tool-subtitle {
    color: var(--text-dark);
    margin-bottom: 2rem;
}

.tool-input-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tool-input-area.search-bar {
    flex-direction: row;
}

.tool-input-area input,
.tool-input-area textarea {
    width: 100%;
    background-color: var(--dark-bg);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-family);
}

.tool-input-area textarea {
    height: 120px;
    resize: vertical;
}

.btn-primary {
    background-color: var(--primary-red);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}

.results-container,
.ai-results-tabs {
    text-align: left;
    margin-top: 2rem;
}

.ai-result, .error {
    line-height: 1.8;
    white-space: pre-wrap;
}

.error {
    color: #ff4d4d;
}

#ai-generate-btn .fa-spin,
#channel-search-btn .fa-spin,
#video-analyze-btn .fa-spin {
    margin-right: 0.5rem;
}

.motion-graphic-container {
    display: none;
}

.motion-graphic-container h3 {
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

/* AI Results Tabs */
.ai-results-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-link {
    background: none;
    border: none;
    color: var(--text-dark);
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-link.active {
    color: var(--primary-red);
    border-bottom-color: var(--primary-red);
}

.tab-content {
    padding: 1.5rem;
    color: var(--text-dark);
    display: none;
    background-color: var(--dark-bg);
    border: 1px dashed var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    min-height: 150px;
}

/* Gauge Meter */
.gauge-meter {
    width: 180px;
    height: 90px;
    position: relative;
    overflow: hidden;
    margin: 1rem auto 0 auto;
    border-top-left-radius: 180px;
    border-top-right-radius: 180px;
    background: conic-gradient(from 0.75turn at 50% 100%, #ff4d4d, #f9c642 50%, #28a745);
}

.gauge-meter::before {
    content: '';
    position: absolute;
    inset: 15px;
    background: var(--card-bg);
    border-radius: inherit;
}

.gauge-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 2px;
    height: 80%;
    background: var(--text-light);
    transform-origin: bottom;
    transform: rotate(-90deg);
    transition: transform 1s ease-out;
}

.gauge-center {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--text-light);
    border-radius: 50%;
    border: 4px solid var(--dark-bg);
}

.gauge-value {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    font-weight: bold;
}

/* Channel Search & Details */
.channel-results-area { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.channel-card { display: flex; align-items: center; gap: 1rem; background: var(--dark-bg); padding: 1rem; border-radius: 8px; cursor: pointer; transition: background-color 0.3s; }
.channel-card:hover { background-color: #2a2a2a; }
.channel-card img { width: 50px; height: 50px; border-radius: 50%; }
.channel-info { flex-grow: 1; min-width: 0; }
.channel-info h4 { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-info p { color: var(--text-dark); font-size: 0.9rem; margin-top: 0.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back-button { background: none; border: 1px solid var(--border-color); color: var(--text-dark); padding: 0.5rem 1rem; border-radius: 50px; cursor: pointer; margin-bottom: 2rem; display: inline-flex; align-items: center; gap: 0.5rem; }
.channel-header { display: flex; flex-direction: column; align-items: center; gap: 1rem; margin-bottom: 2rem; text-align: center; }
.channel-header img { width: 80px; height: 80px; border-radius: 50%; }
.channel-header h2 { font-size: 1.8rem; }
.stats-grid, .revenue-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.stat-box { background: var(--dark-bg); padding: 1.5rem; border-radius: 8px; text-align: center; }
.stat-box h4 { color: var(--text-dark); font-size: 0.9rem; text-transform: uppercase; margin-bottom: 0.5rem; }
.stat-box p { font-size: 1.5rem; font-weight: bold; color: var(--primary-red); }
.revenue-section, .popular-videos-section { text-align: left; margin-top: 2rem; }
.revenue-section h3, .popular-videos-section h3 { font-size: 1.2rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
.video-list { display: flex; flex-direction: column; gap: 1rem; }
.video-card { display: flex; gap: 1rem; align-items: center; background: var(--dark-bg); padding: 0.5rem; border-radius: 8px; text-decoration: none; color: var(--text-light); }
.video-card img { width: 120px; border-radius: 4px; }
.video-card p { font-size: 0.9rem; }

/* SEO Orb Animation */
@keyframes orb-rotate { to { transform: rotate(360deg); } }
@keyframes core-pulse { 50% { transform: scale(1.1); box-shadow: 0 0 25px var(--primary-red); } }
.seo-orb-container { display: flex; align-items: center; justify-content: center; height: 100%; }
.seo-orb { width: 200px; height: 200px; position: relative; display: flex; align-items: center; justify-content: center; }
.orb-core { width: 50px; height: 50px; background-color: var(--primary-red); border-radius: 50%; box-shadow: 0 0 15px var(--primary-red-glow); animation: core-pulse 2s infinite alternate; }
.orb-ring { position: absolute; width: 100%; height: 100%; border-radius: 50%; border: 2px solid transparent; animation: orb-rotate 10s linear infinite; }
.ring1 { border-top-color: var(--primary-red); animation-duration: 8s; }
.ring2 { border-left-color: var(--primary-red); animation-duration: 12s; animation-direction: reverse; }
.ring3 { border-right-color: var(--primary-red); border-bottom-color: var(--primary-red); animation-duration: 15s; }

/* Ad Containers & Footer */
.ad-container-top, .native-ad-container { text-align: center; padding: 2rem 0; }
.footer { border-top: 1px solid var(--border-color); margin-top: 2rem; }
.footer-bottom { text-align: center; padding: 1.5rem; color: var(--text-dark); }

/* Responsive Styles */
@media (min-width: 768px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .features-grid .wide-card { grid-column: 1 / -1; }
    .tool-page-main { grid-template-columns: 1fr 1fr; }
    .motion-graphic-container { display: block; background: var(--card-bg); border-radius: 15px; padding: 2rem; text-align: center; }
}