    /* RED THEME ADAPTATION */
    :root {
        --primary-red: #E53E3E; /* Tailwind red-600 equivalent */
        --primary-red-dark: #C53030; /* Tailwind red-700 equivalent */
        --primary-red-light: rgba(239, 68, 68, 0.1); /* Tailwind red-500/10 */
        --youtube-gray: #606060;
        --youtube-dark: #0F0F0F;
        --background-white: #FFFFFF;
        --surface-light: #FAFAFA;
        --shadow-premium: 0 8px 25px rgba(0, 0, 0, 0.1);
        --velocity-green: #15a550; /* Kept for Velocity metric */ 
        --engagement-purple: #9C27B0; /* Kept for Engagement metric */
        --trending-yellow: #F9A825; /* Kept for Trending metric */
        --opportunity-score: #E53E3E; /* Changed Opportunity Blue to Primary Red for theme consistency */
        --evergreen-teal: #067c56;
        --transition: all 0.3s ease;
    }

    /* --- Global & Typography --- */
    * {
        box-sizing: border-box;
    }

    .tool-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 30px 20px;
    }

    /* --- Header & Search --- */
    .tool-title {
        text-align: center;
        margin: 40px auto 30px auto;
    }

    .tool-title h1 {
        font-size: 2.8rem;
        font-weight: 900;
        color: var(--youtube-dark);
        text-transform: uppercase;
    }
    
    .title-highlight {
        color: var(--primary-red);
    }

    .tagline {
        color: var(--youtube-gray);
        font-size: 1.1rem;
        max-width: 700px;
        margin: 10px auto 0;
    }

    .search-container {
        background-color: var(--background-white);
        border-radius: 12px;
        padding: 25px;
        box-shadow: var(--shadow-premium);
        margin-bottom: 40px;
        border-top: 5px solid var(--primary-red); /* Red Border */ 
    }

    .input-group {
        display: flex;
        max-width: 100%;
        margin: 0 auto;
        gap: 15px;
    }

    .search-input {
        flex: 1;
        padding: 15px 25px;
        border: 1px solid #C0C0C0;
        border-radius: 30px;
        font-size: 1rem;
        transition: border-color 0.2s;
    }

    .search-input:focus {
        outline: none;
        border-color: var(--primary-red);
        box-shadow: 0 0 0 3px var(--primary-red-light);
    }

    .search-btn {
        background-color: var(--primary-red);
        color: white;
        border: none;
        border-radius: 30px;
        padding: 0 35px;
        cursor: pointer;
        font-weight: 700;
        font-size: 1rem;
        transition: var(--transition);
        display: flex;
        align-items: center;
        gap: 10px;
        height: 50px;
    }

    .search-btn:hover {
        background-color: var(--primary-red-dark);
        box-shadow: 0 4px 10px rgba(229, 62, 62, 0.4);
    }
    
    /* New Controls Group */
    .controls-group {
        display: flex;
        justify-content: flex-start;
        gap: 20px;
        margin-top: 20px;
        flex-wrap: wrap;
    }
    
    .control-item {
        display: flex;
        flex-direction: column;
        min-width: 180px;
    }
    
    .control-item label {
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--youtube-dark);
        margin-bottom: 5px;
    }
    
    .control-item select, 
    .control-item input[type="number"] {
        padding: 10px 15px;
        border: 1px solid #C0C0C0;
        border-radius: 8px;
        font-size: 1rem;
        background-color: var(--background-white);
        appearance: none; 
    }
    
    /* --- Video List Enhancements --- */
    .video-item {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        border-bottom: 1px solid #EDEDED;
        transition: background-color 0.2s;
    }
    .video-item-main {
        display: flex;
        gap: 20px;
        align-items: flex-start;
        flex-grow: 1;
    }
    .video-item:hover {
        background-color: var(--primary-red-light); /* Light Red Hover */
        border-radius: 6px;
    }

    .video-info-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .reveal-btn {
        background-color: transparent;
        color: var(--primary-red); /* Red Button Text */
        border: 1px solid var(--primary-red); /* Red Border */
        border-radius: 20px;
        padding: 5px 15px;
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
        transition: var(--transition);
        align-self: flex-start;
        margin-top: 10px;
    }
    .reveal-btn:hover {
        background-color: var(--primary-red); /* Solid Red Hover */
        color: white;
    }

    /* --- Revealed Details Area --- */
    .video-details-reveal {
        border-top: 1px dashed #E0E0E0;
        margin-top: 15px;
        padding-top: 15px;
        display: none;
    }

    .detail-group {
        margin-bottom: 15px;
    }

    .detail-group h4 {
        font-size: 1rem;
        color: var(--youtube-dark);
        margin-bottom: 5px;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .detail-group h4 i {
        color: var(--velocity-green); /* Kept for specific feature (Tags/Desc) */
    }

    .detail-content {
        background-color: var(--background-white);
        border: 1px solid #E0E0E0;
        border-radius: 6px;
        padding: 10px;
        font-size: 0.9rem;
        white-space: pre-wrap;
        word-break: break-word;
        max-height: 200px;
        overflow-y: auto;
        position: relative;
    }

    .detail-content.tag-list span {
        display: inline-block;
        background-color: #F0F0F0;
        padding: 3px 8px;
        margin: 3px;
        border-radius: 4px;
        font-family: monospace;
    }

    .copy-detail-btn {
        background-color: var(--velocity-green); /* Kept for copy action */
        color: white;
        border: none;
        border-radius: 4px;
        padding: 5px 10px;
        font-size: 0.8rem;
        cursor: pointer;
        transition: background-color 0.2s;
        margin-left: auto;
    }
    .copy-detail-btn:hover {
        background-color: #008f7a;
    }

    /* --- Status & Error --- */
    .api-status-section {
        text-align: right;
        margin-bottom: 20px;
        font-size: 0.85rem;
        color: var(--youtube-gray);
    }
    .error-message {
        color: #D32F2F;
        background-color: #FFEBEE;
        padding: 20px;
        border-radius: 8px;
        text-align: center;
        margin: 20px 0;
        display: none;
    }

    /* --- Loading & Results --- */
    .loading {
        display: none;
        text-align: center;
        padding: 60px;
    }
    .spinner {
        border: 5px solid rgba(0, 0, 0, 0.1);
        border-radius: 50%;
        border-top: 5px solid var(--primary-red); /* Red Spinner */
        width: 50px;
        height: 50px;
        animation: spin 1s linear infinite;
        margin: 0 auto 20px;
    }
    @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

    .results-container {
        display: none;
        background-color: var(--background-white);
        border-radius: 12px;
       /* box-shadow: var(--shadow-premium); */
        padding: 30px;
        margin-top: 30px;
    }
    
    .section-title {
        font-size: 1.6rem; 
        font-weight: 700; 
        margin-bottom: 25px;
        color: var(--youtube-dark);
        border-bottom: 2px solid #E0E0E0;
        padding-bottom: 10px;
    }
    .section-title i {
        color: var(--primary-red); /* Red Icon */
        margin-right: 10px;
    }

    /* --- Stat Cards --- */
    .hashtag-stats {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
        gap: 20px;
        margin-bottom: 40px;
    }

    .stat-card {
        background-color: var(--surface-light);
        border-radius: 8px;
        padding: 20px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        border: 1px solid #E0E0E0;
        border-left: 5px solid var(--primary-red); /* Default Red Card */
    }
    
    .stat-card.trending { border-left-color: var(--trending-yellow); }
    .stat-card.velocity { border-left-color: var(--velocity-green); }
    .stat-card.opportunity { border-left-color: var(--opportunity-score); } /* Red border for Opportunity */

    .stat-title {
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--youtube-gray);
        margin-bottom: 10px;
        text-transform: uppercase;
    }

    .stat-value {
        font-size: 2.0rem;
        font-weight: 900;
        color: var(--primary-red); /* Default Red Value */
    }
    
    .stat-card.trending .stat-value { color: var(--trending-yellow); }
    .stat-card.velocity .stat-value { color: var(--velocity-green); }
    .stat-card.opportunity .stat-value { color: var(--opportunity-score); } /* Red Value for Opportunity */

    /* --- Video Sort Controls --- */
    .video-sort-controls {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 10px;
        margin-bottom: 30px;
    }
    
    .sort-button {
        padding: 10px 20px;
        border: 1px solid #D0D0D0;
        border-radius: 25px;
        cursor: pointer;
        font-size: 0.9rem;
        font-weight: 500;
        transition: var(--transition);
        background-color: var(--background-white);
        color: var(--youtube-dark);
        white-space: nowrap;
    }
    
    .sort-button i {
        margin-right: 5px;
    }
    
    /* Active States */
    /* Changed the default active button to the theme's primary red */
    .sort-button.active-sort-trending {
        background-color: var(--primary-red); 
        color: white;
        border-color: var(--primary-red);
    }
    .sort-button.active-sort-velocity {
        background-color: var(--velocity-green);
        color: white;
        border-color: var(--velocity-green);
    }
    .sort-button.active-sort-engagement {
        background-color: var(--engagement-purple);
        color: white;
        border-color: var(--engagement-purple);
    }
    .sort-button.active-sort-evergreen {
        background-color: var(--evergreen-teal);
        color: white;
        border-color: var(--evergreen-teal);
    }

    /* --- Video List (Blueprints) --- */
    .videos-container {
        margin-bottom: 40px;
    }

    .video-thumbnail {
        width: 160px; 
        min-width: 160px; 
        height: 90px;
        border-radius: 16px;
        object-fit: cover;
        flex-shrink: 0;
		border: 1px solid #E0E0E0;
		box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .video-details-link {
        text-decoration: none;
        color: inherit;
    }

    .video-title {
        font-weight: 600;
        margin-bottom: 3px;
        font-size: 1.1rem;
        color: var(--youtube-dark);
        line-height: 1.3;
    }

    .video-channel {
        font-size: 0.9rem;
        color: var(--youtube-gray);
        margin-bottom: 5px;
    }

    .video-stats {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        font-size: 0.85rem;
        color: var(--youtube-gray);
        margin-top: 5px;
    }

    .video-stats span i {
        margin-right: 5px;
    }
    
    .video-stats .stat-val {
        font-weight: 600;
    }

    .video-stats .velocity-stat {
        color: var(--velocity-green);
    }
    .video-stats .engagement-stat {
        color: var(--engagement-purple);
    }
    .video-stats .age-stat {
        color: var(--evergreen-teal);
        font-style: italic;
    }
    
    /* --- Hashtag Generator --- */
    .hashtag-generator {
        background-color: var(--surface-light);
        padding: 20px;
        border-radius: 8px;
        margin-bottom: 30px;
        border: 1px solid #E0E0E0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
    
    .generator-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
    }
    
    .generator-controls label {
        font-weight: 500;
        color: var(--youtube-dark);
        cursor: pointer;
        margin-right: 15px;
    }
    
    .tag-list-display {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 0;
        min-height: 50px;
    }

    .tag-item-chip {
        background-color: var(--background-white);
        color: var(--youtube-dark);
        padding: 5px 10px;
        border-radius: 20px;
        border: 1px solid var(--primary-red); /* Red Border on Chip */
        font-size: 0.9rem;
        font-weight: 500;
        cursor: pointer;
        transition: var(--transition);
    }
    
    .tag-item-chip:hover {
        background-color: var(--primary-red); /* Solid Red Hover */
        color: white;
    }

    .tag-item-chip.selected {
        background-color: var(--primary-red); /* Selected Chip is Primary Red */
        color: white;
        border-color: var(--primary-red);
    }

    .generate-btn {
        background-color: var(--velocity-green); /* Changed to Velocity Green for distinct action button */
        color: white;
        border: none;
        border-radius: 25px;
        padding: 10px 20px;
        font-weight: 600;
        cursor: pointer;
        transition: var(--transition);
    }
    
    .generate-btn:hover {
        background-color: #008f7a;
    }
    
    /* --- Hashtag List (The table view) --- */
    .hashtag-list {
        margin-top: 40px;
    }

    .hashtag-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
        border-bottom: 1px solid #EDEDED;
        transition: var(--transition);
    }

    .hashtag-item:hover {
        background-color: var(--primary-red-light); /* Light Red Hover */
        border-radius: 4px;
    }

    .hashtag-name {
        font-weight: 600;
        font-size: 1.1rem;
        color: var(--youtube-dark);
        flex: 1; 
    }

    .hashtag-metrics {
        display: flex;
        gap: 30px;
        text-align: right;
        min-width: 400px;
    }

    .idea-prompt {
        flex: 1.5;
        font-size: 0.9rem;
        font-style: italic;
        color: var(--youtube-gray);
        border-left: 1px solid #EDEDED;
        padding-left: 15px;
        margin-left: 15px;
        text-align: left;
    }
    .idea-prompt strong {
        color: var(--primary-red); /* Idea prompt highlight in Red */
    }
    
    .metric {
        text-align: center;
    }

    .metric-value {
        font-weight: 700;
        color: var(--primary-red); /* Default Red Value */
        font-size: 1.1rem;
    }
    .metric.opportunity .metric-value {
        color: var(--primary-red); /* Opportunity value is Primary Red */
        font-size: 1.3rem;
    }
    
    .metric-label {
        font-size: 0.75rem;
        color: var(--youtube-gray);
        text-transform: uppercase;
    }
    
    /* --- Chart --- */
    .chart-container {
        margin: 40px 0;
        position: relative;
        height: 380px; 
    }

    /* --- Responsive Adjustments (No changes needed, CSS remains) --- */
    @media (max-width: 1024px) {
        .hashtag-metrics {
            min-width: 300px; 
            gap: 15px;
        }
        .hashtag-item {
            flex-wrap: wrap;
        }
    }
    
    @media (max-width: 768px) {
        .input-group {
            flex-direction: column;
        }
        .search-btn {
            width: 100%;
            justify-content: center;
        }
        .controls-group {
            flex-direction: column;
            align-items: stretch;
        }
        .control-item {
            min-width: 100%;
        }
        .hashtag-stats {
            grid-template-columns: 1fr;
        }
        .video-item-main {
            flex-direction: column;
            align-items: center;
        }
        .video-thumbnail {
            width: 100%;
            height: auto;
            min-width: 100%;
        }
        .video-sort-controls {
            flex-direction: column;
        }
        .hashtag-item {
            flex-direction: column;
            align-items: flex-start;
            gap: 10px;
        }
        .hashtag-metrics {
            flex-wrap: wrap;
            width: 100%;
            justify-content: space-between;
            min-width: auto;
        }
        .idea-prompt {
            border-left: none;
            padding-left: 0;
            margin-left: 0;
            margin-top: 10px;
            width: 100%;
        }
        .generator-controls {
            flex-direction: column;
            align-items: flex-start;
            gap: 10px;
        }
        .copy-detail-btn {
            margin-top: 10px;
            margin-left: 0;
        }
    }
	
	.search-btn {
    background-color: var(--primary-red);
    color: white;
    border: none;
    padding: 0 35px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    /* Soft initial shadow */
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3); 
}

.search-btn:hover {
    background-color: var(--primary-red-dark);
    /* Subtle change on hover */
    box-shadow: 0 6px 15px rgba(229, 62, 62, 0.5); 
}
.search-btn:active {
    transform: translateY(1px); /* Soft press down effect */
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.4);
}

.search-container {
  box-shadow: 0 4px 12px #0000000d;
  border: 1px solid #e2e8f0;
          border-top: 5px solid var(--primary-red); /* Red Border */ 
  border-radius: 18px;
}

.controls-group {justify-content: center;}

#videosSectionTitle span {color:#2563eb}