/* YouTube Analytics Dashboard - CSS Completo */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f0f0f 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f0f0f 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    text-align: center;
    color: #ffffff;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(78, 205, 196, 0.3);
    border-top: 3px solid #4ecdc4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-spinner p {
    font-size: 1.1em;
    font-weight: 500;
    color: #a0a0a0;
}

/* Header Section */
.header {
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.header h1 {
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4, #45b7d1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    text-align: center;
}

/* Status Controls */
.status-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.05);
    padding: 10px 20px;
    border-radius: 25px;
    border: 1px solid rgba(255,255,255,0.1);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px currentColor;
}

.status-indicator.connected {
    background-color: #4ecdc4;
    color: #4ecdc4;
}

.status-indicator.disconnected {
    background-color: #ff6b6b;
    color: #ff6b6b;
}

.status-indicator.checking {
    background-color: #ffd700;
    color: #ffd700;
}

.status-text {
    font-size: 0.9em;
    font-weight: 500;
    color: #e0e0e0;
}

.refresh-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #45b7d1 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.4);
}

.refresh-btn:active {
    transform: translateY(0);
}

.refresh-btn.loading .refresh-icon {
    animation: spin 1s linear infinite;
}

.refresh-icon {
    font-size: 1.1em;
    transition: transform 0.3s ease;
}

/* Manage Channels Button */
.manage-btn {
    background: linear-gradient(135deg, #845ec2 0%, #b39cd0 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(132, 94, 194, 0.3);
}

.manage-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(132, 94, 194, 0.4);
}

.manage-btn:active {
    transform: translateY(0);
}

.manage-icon {
    font-size: 1.1em;
    transition: transform 0.3s ease;
}

/* Channel Management Modal */
.channel-management {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.management-card {
    background: linear-gradient(135deg, rgba(15, 15, 15, 0.95) 0%, rgba(26, 32, 44, 0.95) 100%);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.management-card h2 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.management-card p {
    color: #a0a0a0;
    margin-bottom: 25px;
    line-height: 1.5;
}

.channel-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.channel-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.channel-item:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(132, 94, 194, 0.3);
}

.channel-details {
    display: flex;
    align-items: center;
    gap: 15px;
}

.channel-icon-large {
    font-size: 2em;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #845ec2, #b39cd0);
}

.channel-info-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.channel-name-large {
    color: white;
    font-weight: 600;
    font-size: 1.1em;
}

.channel-status {
    font-size: 0.9em;
    font-weight: 500;
}

.channel-status.connected {
    color: #4ecdc4;
}

.channel-status.disconnected {
    color: #ff6b6b;
}

.channel-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #45b7d1 100%);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.3);
}

.action-btn.disconnect {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5722 100%);
}

.action-btn.disconnect:hover {
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.management-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
}

.action-btn.refresh-channels {
    background: linear-gradient(135deg, #845ec2 0%, #b39cd0 100%);
}

.action-btn.close-management {
    background: linear-gradient(135deg, #666 0%, #444 100%);
}

/* Channel Selector */
.channel-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.channel-btn {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border: 2px solid rgba(255,255,255,0.1);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.channel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border-color: #4ecdc4;
}

.channel-btn.active {
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    border-color: #4ecdc4;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.4);
}

/* Dropdown */
.channel-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border: 2px solid rgba(255,255,255,0.1);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border-color: #4ecdc4;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.dropdown-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    background: linear-gradient(135deg, rgba(15, 15, 15, 0.98) 0%, rgba(26, 32, 44, 0.98) 100%);
    backdrop-filter: blur(20px);
    min-width: 280px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.6);
    z-index: 99999 !important;
    border-radius: 15px;
    border: 2px solid rgba(255,255,255,0.15);
    max-height: 300px;
    overflow-y: auto;
    top: 100%;
    left: 0;
    margin-top: 10px;
    position: fixed !important;
}

.dropdown-content.show {
    display: block;
    animation: fadeInDown 0.3s ease;
}

.dropdown-item {
    color: white;
    padding: 15px 20px;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.dropdown-item:hover {
    background: rgba(78, 205, 196, 0.1);
    color: #4ecdc4;
    transform: translateX(5px);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.channel-icon {
    font-size: 1.2em;
}

.channel-name {
    font-weight: 500;
}

.connection-badge {
    font-size: 0.75em;
    padding: 4px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.connection-badge.connected {
    background: rgba(78, 205, 196, 0.2);
    color: #4ecdc4;
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.connection-badge.disconnected {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.metric-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.2);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1);
}

.highlight-card {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15) 0%, rgba(78, 205, 196, 0.15) 100%);
    border: 2px solid rgba(255, 107, 107, 0.3);
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.2);
}

.highlight-card::before {
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #ff6b6b);
    background-size: 400% 400%;
    animation: gradient-flow 3s ease-in-out infinite;
}

.metric-title {
    font-size: 0.9em;
    color: #a0a0a0;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.metric-value {
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 10px;
    color: #ffffff;
}

.main-revenue {
    font-size: 3em !important;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.last-update {
    font-size: 0.8em;
    color: #4ecdc4;
    margin-top: 10px;
    font-weight: 500;
}

.metric-period {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.period-item {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.period-item:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.05);
}

.period-label {
    font-size: 0.8em;
    color: #a0a0a0;
    margin-bottom: 5px;
}

.period-value {
    font-size: 1.2em;
    font-weight: 600;
    color: #4ecdc4;
}

/* Channel Specific Content */
.channel-specific-content {
    display: grid;
    gap: 25px;
    margin-bottom: 30px;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

.chart-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 25px;
    position: relative;
    overflow: hidden;
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
}

.chart-title {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 20px;
    color: #ffffff;
}

.chart-container {
    height: 250px;
    position: relative;
}

/* Video Card */
.video-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 25px;
    position: relative;
    overflow: hidden;
}

.video-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
}

.video-info {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-top: 20px;
}

.video-thumbnail {
    width: 120px;
    height: 68px;
    background: linear-gradient(135deg, #333, #555);
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.8em;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.video-details {
    flex: 1;
}

.video-title {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #ffffff;
    line-height: 1.4;
}

.video-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.video-stat {
    text-align: center;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
}

.video-stat-label {
    font-size: 0.8em;
    color: #a0a0a0;
    margin-bottom: 5px;
}

.video-stat-value {
    font-size: 1.1em;
    font-weight: 600;
    color: #4ecdc4;
}

/* Floating Elements */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(78, 205, 196, 0.1), transparent);
    animation: float 6s ease-in-out infinite;
}

.floating-circle:nth-child(1) {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 10%;
    animation-delay: -2s;
}

.floating-circle:nth-child(2) {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 10%;
    animation-delay: -4s;
}

.floating-circle:nth-child(3) {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 20%;
    animation-delay: -1s;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, rgba(26, 32, 44, 0.95) 0%, rgba(15, 15, 15, 0.95) 100%);
    margin: 15% auto;
    padding: 30px;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    width: 80%;
    max-width: 500px;
    text-align: center;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.6);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #ff6b6b;
}

.retry-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #45b7d1 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    margin-top: 20px;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.4);
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes gradient-flow {
    0%, 100% { 
        background-position: 0% 50%; 
    }
    50% { 
        background-position: 100% 50%; 
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    50% { 
        transform: translateY(-20px) rotate(180deg); 
    }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 600;
    z-index: 10000;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.success {
    background: rgba(78, 205, 196, 0.9);
    color: white;
}

.notification.error {
    background: rgba(255, 107, 107, 0.9);
    color: white;
}

.notification.warning {
    background: rgba(255, 215, 0, 0.9);
    color: #000;
}

.notification.show {
    transform: translateX(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .status-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .channel-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .video-info {
        flex-direction: column;
    }
    
    .video-thumbnail {
        width: 100%;
        height: 150px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .metric-period {
        flex-direction: column;
        gap: 10px;
    }
    
    .video-stats {
        grid-template-columns: 1fr;
    }
    
    .dropdown-content {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        min-width: 90vw;
        max-height: 70vh;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px;
    }
    
    .metric-card {
        padding: 20px;
    }
    
    .chart-card {
        padding: 20px;
    }
    
    .video-card {
        padding: 20px;
    }
    
    .metric-value {
        font-size: 1.8em;
    }
    
    .main-revenue {
        font-size: 2.5em !important;
    }
}

/* Custom Scrollbar */
.dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.dropdown-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.dropdown-content::-webkit-scrollbar-thumb {
    background: rgba(78, 205, 196, 0.5);
    border-radius: 3px;
}

.dropdown-content::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 205, 196, 0.8);
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Print Styles */
@media print {
    .floating-elements,
    .status-controls,
    .channel-selector {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .metric-card,
    .chart-card,
    .video-card {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
        break-inside: avoid;
    }
} 