* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff0000;
    --secondary-color: #282828;
    --text-color: #333;
    --bg-color: #f9f9f9;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background-color: var(--secondary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.logo span {
    color: var(--primary-color);
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: rgba(255,255,255,0.1);
}

.auth-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.login-btn {
    background-color: transparent;
    color: white;
    border: 1px solid white !important;
    margin-right: 10px;
}

.login-btn:hover {
    background-color: white;
    color: var(--secondary-color);
}

.signup-btn {
    background-color: var(--primary-color);
    color: white;
}

.signup-btn:hover {
    background-color: #cc0000;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    margin: 40px 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.analyzer-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.video-input {
    flex: 1;
    padding: 15px;
    font-size: 1rem;
    border: 2px solid transparent;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.video-input:focus {
    border-color: var(--primary-color);
}

.btn {
    padding: 15px 30px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Features Section */
.features {
    padding: 60px 0;
}

.features h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* Results Section */
.results-section {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 30px;
    margin: 40px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.video-title {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.score-badge {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.2rem;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background-color: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--secondary-color);
}

/* Tags Section */
.tags-section {
    margin: 30px 0;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.tag-item {
    background-color: var(--bg-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.tag-item:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.tag-item.high-score {
    background-color: #4caf50;
    color: white;
    border-color: #4caf50;
}

.tag-item.medium-score {
    background-color: #ff9800;
    color: white;
    border-color: #ff9800;
}

.tag-item.low-score {
    background-color: #f44336;
    color: white;
    border-color: #f44336;
}

/* Recommendations */
.recommendations {
    margin-top: 30px;
    padding: 20px;
    background-color: #e8f5e8;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
}

.recommendations h3 {
    color: #2e7d32;
    margin-bottom: 10px;
}

.recommendations ul {
    list-style-type: none;
}

.recommendations li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.recommendations li:before {
    content: "✓";
    color: #4caf50;
    position: absolute;
    left: 0;
}

/* Dashboard Styles */
.dashboard-header {
    margin: 40px 0;
    padding: 20px;
    background: linear-gradient(135deg, var(--secondary-color), #1a1a1a);
    color: white;
    border-radius: 10px;
}

.channel-info {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.channel-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.dashboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    transition: all 0.3s;
    border-radius: 5px;
}

.tab-btn:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Video Cards */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.video-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.video-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.video-info {
    padding: 15px;
}

.video-info h4 {
    margin-bottom: 10px;
    font-size: 1rem;
    line-height: 1.4;
}

.video-stats {
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 0.9rem;
}

/* Tag Analyzer */
.tag-analyzer {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
}

.tag-input-section {
    margin: 20px 0;
}

#tag-input {
    width: 100%;
    height: 100px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 15px;
}

#tag-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.tag-results {
    margin: 30px 0;
    padding: 20px;
    background-color: var(--bg-color);
    border-radius: 8px;
}

.score-bar {
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin: 10px 0;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #ffc107, #f44336);
    transition: width 0.3s;
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
}

/* Loading Spinner */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .analyzer-form {
        flex-direction: column;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    nav a {
        margin: 0 10px;
    }
}

/* Header right section */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* API Key section */
.api-key-section {
    position: relative;
}

.api-key-toggle {
    cursor: pointer;
    padding: 5px 10px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 4px;
    font-size: 0.9rem;
}

.api-key-toggle:hover {
    background-color: rgba(255,255,255,0.2);
}

.api-key-input-container {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 300px;
    display: flex;
    gap: 10px;
}

.api-key-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9rem;
}

.api-key-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.btn-small {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-small:hover {
    background-color: #cc0000;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.notification-success {
    background-color: #4caf50;
}

.notification-error {
    background-color: #f44336;
}

.notification-info {
    background-color: #2196f3;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* API Key Guide Section */
.api-key-guide {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    margin: 40px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-color);
}

.api-key-guide h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.api-key-guide ol {
    padding-left: 20px;
    margin-bottom: 20px;
}

.api-key-guide li {
    margin-bottom: 12px;
    line-height: 1.6;
}

.api-key-guide a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.api-key-guide a:hover {
    text-decoration: underline;
}

.note {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.note.warning {
    background-color: #fff3e0;
    border-left: 4px solid #ff9800;
    color: #e65100;
}

.note.info {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    color: #0d47a1;
}

.help-details {
    margin-top: 20px;
}

.help-details summary {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 500;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.help-details summary:hover {
    background-color: #eeeeee;
}

.help-content {
    padding: 20px;
    background-color: #fafafa;
    border-radius: 8px;
    margin-top: 10px;
}

/* Feature Icons */
.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.feature-card {
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* Recent Analyses Section */
.recent-analyses {
    margin: 40px 0;
}

.recent-analyses h2 {
    margin-bottom: 20px;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.history-item {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.history-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.history-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.history-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
}

.history-score {
    background-color: var(--primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
}

/* Testimonials Section */
.testimonials {
    margin: 60px 0;
}

.testimonials h2 {
    text-align: center;
    margin-bottom: 40px;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.testimonial-card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
}

.testimonial-card::before {
    content: '"';
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.2;
    position: absolute;
    top: -10px;
    left: 10px;
}

.testimonial-card p {
    font-style: italic;
    margin-bottom: 15px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.testimonial-author {
    font-weight: 600;
    color: var(--primary-color);
    text-align: right;
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .api-key-guide {
        padding: 20px;
    }
    
    .api-key-guide h2 {
        font-size: 1.5rem;
    }
    
    .testimonial-grid {
        grid-template-columns: 1fr;
    }
}
/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* API Key Section */
.api-key-section {
    position: relative;
}

.api-key-display {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.api-key-display:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.api-key-status {
    font-size: 0.9rem;
    color: white;
}

.api-key-indicator {
    font-size: 1rem;
}

/* API Key Popup */
.api-key-popup {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    width: 350px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.api-key-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.api-key-popup-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

.api-key-popup-body {
    padding: 20px;
}

.api-key-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.api-key-description a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.api-key-description a:hover {
    text-decoration: underline;
}

.api-key-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.api-key-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.api-key-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.btn-save-key {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-save-key:hover {
    background-color: #cc0000;
}

.api-key-message {
    min-height: 30px;
    font-size: 0.9rem;
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
}

.api-key-message.success {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.api-key-message.error {
    background-color: #ffebee;
    color: #c62828;
}

.api-key-message.info {
    background-color: #e3f2fd;
    color: #1565c0;
}

.api-key-test-result {
    font-size: 0.85rem;
    margin-top: 10px;
}

.api-key-popup-footer {
    padding: 12px 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 12px 12px;
    font-size: 0.8rem;
    color: #999;
    text-align: center;
}

/* User Menu */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    color: white;
    font-size: 0.9rem;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    min-width: 150px;
    display: none;
    z-index: 1000;
}

.user-menu:hover .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
}

.user-dropdown a:hover {
    background-color: #f5f5f5;
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .header-actions {
        gap: 10px;
    }
    
    .api-key-status {
        display: none;
    }
    
    .api-key-display {
        padding: 8px;
    }
    
    .api-key-popup {
        width: 300px;
        right: -50px;
    }
    
    .user-name {
        display: none;
    }
}
