/* ===========================================
   Platform Charts - Gemeinsame Styles
   Wird von den eingebetteten Chart-PHP-Dateien verwendet
   =========================================== */

/* Hide utility */
.hide {
    display: none !important;
}

/* Platform Chart Section - Abstand zwischen Charts */
.platform-chart-section {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.platform-chart-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Chart Header mit Controls */
.platform-chart-section .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.platform-chart-section .chart-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Chart Controls Toolbar */
.chart-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    background: var(--bg-glass);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--border-color);
    gap: 2px;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.control-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.control-btn.active {
    background: var(--accent-primary, #6366f1);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.control-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.control-btn i {
    font-size: 0.95em;
}

/* Growth Toggle */
.growth-toggle .control-btn {
    padding: 8px 14px;
    gap: 6px;
    border: 1px solid transparent;
    transition: all 0.25s ease;
}

.growth-toggle .control-btn i {
    color: #22c55e;
    transition: color 0.25s ease;
}

.growth-toggle .control-btn:hover:not(.disabled) {
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.1);
}

.growth-toggle .control-btn.active {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.4);
}

.growth-toggle .control-btn.active i {
    color: #ffffff;
}

.growth-toggle .control-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.growth-toggle .control-btn.disabled:hover {
    background: transparent;
    border-color: transparent;
}

/* Zoom Controls */
.zoom-controls .control-btn {
    padding: 8px 12px;
    border: 1px solid transparent;
    transition: all 0.25s ease;
}

.zoom-controls .control-btn i {
    color: var(--text-secondary);
}

.zoom-controls .control-btn:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.1);
}

.zoom-controls .control-btn:hover i {
    color: #6366f1;
}

/* Zoom Info Button */
.zoom-controls .zoom-info-btn {
    position: relative;
}

.zoom-controls .zoom-info-btn i {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.zoom-controls .zoom-info-btn:hover i {
    color: #6366f1;
}

/* Zoom Info Tooltip */
.zoom-info-tooltip {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    min-width: 220px;
    animation: fadeInTooltip 0.2s ease-out;
}

@keyframes fadeInTooltip {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.zoom-info-tooltip h4 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.zoom-info-tooltip h4 i {
    color: #6366f1;
}

.zoom-info-tooltip ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.zoom-info-tooltip li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.zoom-info-tooltip li:last-child {
    border-bottom: none;
}

.zoom-info-tooltip .key {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 8px;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Main Container - scoped to platform-chart-section */
.platform-chart-section .main-container {
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: 25px;
    animation: fadeIn 0.6s ease-out;
}

/* Chart Canvas Container - scoped to platform-chart-section */
.platform-chart-section .platform-chart-canvas {
    width: 65%;
    height: 32vh;
    min-height: 32vh;
    background: var(--bg-glass);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

/* Table Container - scoped to platform-chart-section */
.platform-chart-section .table-container {
    width: 30%;
    overflow-x: auto;
    border-radius: 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
}

/* Table Styles */
.platform-chart-section table {
    width: 100%;
    text-align: center;
    border-collapse: collapse;
}

.platform-chart-section th {
    padding: 14px 10px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9em;
    border-bottom: 1px solid var(--border-color);
}

.platform-chart-section tr {
    background-color: transparent;
    color: var(--text-primary);
    height: 50px;
    transition: all 0.3s ease;
}

.platform-chart-section td {
    padding: 10px 7px;
    border-bottom: 1px solid var(--border-color);
}

/* Change Badges */
.change {
    border-radius: 20px;
    padding: 5px 10px;
    margin-left: 12px;
    display: inline-block;
    font-size: 0.75em;
    font-weight: 600;
}

.positive {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.negative {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.platform-chart-section .expand {
    width: 100% !important;
}

/* Platform Chart Headers */
.platform-chart-section h2 {
    color: var(--text-primary);
    font-size: 1.5em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Platform-specific Icon Colors */
.platform-chart-section h2 .icon-youtube {
    color: #ff0000;
}

.platform-chart-section h2 .icon-spotify {
    color: #1db954;
}

.platform-chart-section h2 .icon-instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.platform-chart-section h2 .icon-tiktok {
    color: #fe2c55;
}

.platform-chart-section h2 .icon-twitter {
    color: #1da1f2;
}

.platform-chart-section h2 .icon-twitch {
    color: #9146ff;
}

/* Platform-specific Row Hover Colors */
.platform-chart-section.youtube tr:hover {
    background-color: rgba(255, 0, 0, 0.05);
}

.platform-chart-section.spotify tr:hover {
    background-color: rgba(29, 185, 84, 0.05);
}

.platform-chart-section.instagram tr:hover {
    background-color: rgba(193, 53, 132, 0.05);
}

.platform-chart-section.tiktok tr:hover {
    background-color: rgba(254, 44, 85, 0.05);
}

.platform-chart-section.twitter tr:hover {
    background-color: rgba(29, 161, 242, 0.05);
}

.platform-chart-section.twitch tr:hover {
    background-color: rgba(145, 70, 255, 0.05);
}

/* Responsive */
@media only screen and (max-width: 900px) {
    .platform-chart-section .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-controls {
        width: 100%;
        justify-content: flex-start;
    }
    
    .period-selector .control-btn span,
    .growth-toggle .control-btn span {
        display: none;
    }
    
    .period-selector .control-btn,
    .growth-toggle .control-btn {
        padding: 8px 12px;
    }
}

@media only screen and (max-width: 600px) {
    .platform-chart-section .main-container {
        flex-direction: column;
    }

    .platform-chart-section .platform-chart-canvas {
        width: 100%;
        height: 45vh;
    }

    .platform-chart-section .table-container {
        width: 100%;
        margin-top: 0;
    }
    
    .chart-controls {
        gap: 8px;
    }
    
    .control-group {
        padding: 3px;
    }
    
    .control-btn {
        padding: 6px 10px;
        font-size: 0.8em;
    }
}
