/**
 * Rudnex YouTube Keyword Trend Checker - Public Styles
 * Modern, responsive design with smooth animations
 */

:root {
    --rudnex-primary: #ff6b35;
    --rudnex-primary-dark: #e55a2b;
    --rudnex-secondary: #4a90e2;
    --rudnex-success: #27ae60;
    --rudnex-warning: #f39c12;
    --rudnex-danger: #e74c3c;
    --rudnex-info: #3498db;
    --rudnex-light: #f8f9fa;
    --rudnex-dark: #2c3e50;
    --rudnex-border: #dee2e6;
    --rudnex-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --rudnex-shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --rudnex-radius: 8px;
    --rudnex-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Container */
.rudnex-yt-trend-checker {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--rudnex-dark);
}

/* Search Form */
.rudnex-search-form {
    background: white;
    border-radius: var(--rudnex-radius);
    padding: 24px;
    box-shadow: var(--rudnex-shadow);
    margin-bottom: 24px;
    border: 1px solid var(--rudnex-border);
    transition: var(--rudnex-transition);
}

.rudnex-search-form:hover {
    box-shadow: var(--rudnex-shadow-hover);
}

.rudnex-input-group {
    display: flex;
    gap: 12px;
    align-items: stretch;
    flex-wrap: wrap;
}

.rudnex-keyword-input {
    flex: 1;
    min-width: 250px;
    padding: 14px 16px;
    border: 2px solid var(--rudnex-border);
    border-radius: var(--rudnex-radius);
    font-size: 16px;
    transition: var(--rudnex-transition);
    background: white;
}

.rudnex-keyword-input:focus {
    outline: none;
    border-color: var(--rudnex-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.rudnex-region-select {
    min-width: 160px;
    padding: 14px 16px;
    border: 2px solid var(--rudnex-border);
    border-radius: var(--rudnex-radius);
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: var(--rudnex-transition);
}

.rudnex-region-select:focus {
    outline: none;
    border-color: var(--rudnex-secondary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.rudnex-check-button {
    min-width: 120px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--rudnex-primary), var(--rudnex-primary-dark));
    color: white;
    border: none;
    border-radius: var(--rudnex-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--rudnex-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.rudnex-check-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--rudnex-shadow-hover);
}

.rudnex-check-button:active {
    transform: translateY(0);
}

.rudnex-check-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.rudnex-check-button .button-loader {
    display: none;
}

.rudnex-check-button.loading .button-text {
    opacity: 0;
}

.rudnex-check-button.loading .button-loader {
    display: inline-block;
}

.rudnex-spinner {
    animation: rudnex-spin 1s linear infinite;
}

@keyframes rudnex-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Results Container */
.rudnex-results-container {
    background: white;
    border-radius: var(--rudnex-radius);
    box-shadow: var(--rudnex-shadow);
    border: 1px solid var(--rudnex-border);
    overflow: hidden;
    animation: rudnex-slideIn 0.4s ease-out;
}

@keyframes rudnex-slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status Section */
.rudnex-status-section {
    padding: 24px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid var(--rudnex-border);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.rudnex-status-badge {
    display: inline-block;
}

.rudnex-status-badge .status-text {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
    white-space: nowrap;
}

.rudnex-status-badge .status-text.trending {
    background: linear-gradient(135deg, var(--rudnex-success), #2ecc71);
    color: white;
}

.rudnex-status-badge .status-text.breaking-out {
    background: linear-gradient(135deg, var(--rudnex-warning), #f1c40f);
    color: white;
}

.rudnex-status-badge .status-text.stable {
    background: linear-gradient(135deg, var(--rudnex-info), #5dade2);
    color: white;
}

.rudnex-status-badge .status-text.cooling {
    background: linear-gradient(135deg, var(--rudnex-danger), #ec7063);
    color: white;
}

.rudnex-keyword-title h3 {
    margin: 0 0 4px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--rudnex-dark);
}

.rudnex-keyword-title .region-info {
    font-size: 14px;
    color: #6c757d;
    opacity: 0.8;
}

/* Metrics Grid */
.rudnex-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1px;
    background: var(--rudnex-border);
}

.metric-item {
    background: white;
    padding: 20px 16px;
    text-align: center;
    transition: var(--rudnex-transition);
}

.metric-item:hover {
    background: #f8f9fa;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--rudnex-primary);
    margin-bottom: 4px;
    line-height: 1;
}

.metric-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Sparkline Section */
.rudnex-sparkline-section {
    padding: 24px;
    border-bottom: 1px solid var(--rudnex-border);
}

.rudnex-sparkline-section h4 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--rudnex-dark);
}

.rudnex-sparkline-container {
    background: #f8f9fa;
    border-radius: var(--rudnex-radius);
    padding: 16px;
    overflow-x: auto;
}

.rudnex-sparkline-chart {
    width: 100%;
    height: 80px;
    display: block;
}

/* Related Keywords Section */
.rudnex-related-section {
    padding: 24px;
    border-bottom: 1px solid var(--rudnex-border);
}

.rudnex-related-section h4 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--rudnex-dark);
}

.rudnex-related-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.related-keyword {
    display: inline-block;
    padding: 6px 12px;
    background: var(--rudnex-light);
    border: 1px solid var(--rudnex-border);
    border-radius: 16px;
    font-size: 14px;
    color: var(--rudnex-dark);
    text-decoration: none;
    transition: var(--rudnex-transition);
    cursor: pointer;
}

.related-keyword:hover {
    background: var(--rudnex-primary);
    color: white;
    border-color: var(--rudnex-primary);
    transform: translateY(-1px);
}

/* Evidence Videos Section */
.rudnex-evidence-section {
    padding: 24px;
    border-bottom: 1px solid var(--rudnex-border);
}

.rudnex-evidence-section h4 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--rudnex-dark);
}

.rudnex-evidence-videos {
    display: grid;
    gap: 16px;
}

.evidence-video {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: var(--rudnex-radius);
    transition: var(--rudnex-transition);
    text-decoration: none;
    color: inherit;
}

.evidence-video:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: var(--rudnex-shadow);
}

.evidence-video-thumbnail {
    width: 120px;
    height: 68px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.evidence-video-info {
    flex: 1;
    min-width: 0;
}

.evidence-video-title {
    font-weight: 600;
    margin: 0 0 4px 0;
    font-size: 16px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.evidence-video-meta {
    font-size: 14px;
    color: #6c757d;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.evidence-video-channel {
    font-weight: 500;
}

.evidence-video-views {
    color: var(--rudnex-primary);
    font-weight: 600;
}

/* Meta Info */
.rudnex-meta-info {
    padding: 16px 24px;
    background: #f8f9fa;
    font-size: 12px;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

/* Error Container */
.rudnex-error-container {
    background: white;
    border-radius: var(--rudnex-radius);
    box-shadow: var(--rudnex-shadow);
    border: 1px solid var(--rudnex-border);
    animation: rudnex-slideIn 0.4s ease-out;
}

.rudnex-error-message {
    padding: 24px;
    text-align: center;
    color: var(--rudnex-danger);
    background: #fff5f5;
    border-radius: var(--rudnex-radius);
}

.rudnex-error-message p {
    margin: 0;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rudnex-input-group {
        flex-direction: column;
    }
    
    .rudnex-keyword-input,
    .rudnex-region-select,
    .rudnex-check-button {
        min-width: 100%;
    }
    
    .rudnex-status-section {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .rudnex-metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .evidence-video {
        flex-direction: column;
    }
    
    .evidence-video-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
}

@media (max-width: 480px) {
    .rudnex-search-form,
    .rudnex-status-section,
    .rudnex-sparkline-section,
    .rudnex-related-section,
    .rudnex-evidence-section {
        padding: 16px;
    }
    
    .rudnex-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .metric-item {
        padding: 16px 12px;
    }
    
    .metric-value {
        font-size: 20px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .rudnex-yt-trend-checker {
        --rudnex-border: #333;
        --rudnex-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .rudnex-keyword-input,
    .rudnex-region-select {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .rudnex-spinner {
        animation: none;
    }
}

/* Print styles */
@media print {
    .rudnex-search-form {
        display: none;
    }
    
    .rudnex-results-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .evidence-video {
        page-break-inside: avoid;
    }
}