/**
 * Modern Creator Dashboard Styles
 * Purple/Blue gradient dark theme design
 */

/* Modern Dashboard Container - v2 */
.cas-creator-dashboard-modern {
    background: linear-gradient(135deg, #1a1832 0%, #2d1b4e 100%) fixed !important;
    background-size: 100% 100vh !important;
    color: rgba(255, 255, 255, 0.9);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    position: relative;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 120px rgba(139, 92, 246, 0.1);
}

/* Add gradient overlays for enhanced visual depth */
.cas-creator-dashboard-modern::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: 
        radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
    pointer-events: none;
}

.cas-creator-dashboard-modern > * {
    position: relative;
    z-index: 1;
}

/* Dashboard Header */
.dashboard-header-modern {
    padding: 30px 40px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    flex: 1;
}

.dashboard-header-modern .dashboard-title {
    font-size: 38px;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
    text-align: left;
}

/* Header Stats */
.header-right {
    display: flex;
    align-items: center;
}

.header-stats {
    display: flex;
    gap: 40px;
}

.header-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.header-stats .stat-value {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #60A5FA 0%, #A78BFA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    text-shadow: none;
}

.header-stats .stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    font-weight: 500;
}

/* Navigation */
.dashboard-nav-modern {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 40px;
}

.dashboard-nav-modern .nav-tabs {
    display: flex;
    gap: 0;
}

.dashboard-nav-modern .nav-tab {
    padding: 16px 24px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    position: relative;
}

.dashboard-nav-modern .nav-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.dashboard-nav-modern .nav-tab.active {
    color: #ffffff;
    border-bottom-color: #7c4dff;
    background: rgba(124, 77, 255, 0.1);
}

/* Dashboard sections - ensure all sections inherit gradient */
.dashboard-section {
    background: transparent !important;
    position: relative;
}

/* Projects Section - matching Analytics section styling */
#projects-section {
    padding: 30px 40px;
    position: relative;
}

/* Add the pink overlay directly to projects section */
#projects-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#projects-section > * {
    position: relative;
    z-index: 1;
}

.projects-container {
    max-width: 1400px;
    margin: 0 auto;
}

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.projects-title {
    color: #ffffff;
    font-size: 28px;
    margin: 0;
    font-weight: 700;
    background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Content Grid */
.dashboard-content-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
}

/* Projects Table Section */
.projects-table-section {
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    overflow-x: auto; /* Allow horizontal scroll */
    overflow-y: visible; /* Don't cut off vertically */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 100%;
}

.modern-projects-table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
}

.modern-projects-table thead {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.3) 0%, rgba(236, 72, 153, 0.3) 50%, rgba(59, 130, 246, 0.3) 100%);
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
}

.modern-projects-table th {
    padding: 14px 8px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.modern-projects-table .th-project {
    min-width: 250px;
    text-align: left;
    padding-left: 25px;
}

.modern-projects-table .th-views {
    text-align: center;
    width: 55px;
    max-width: 55px;
}

.modern-projects-table .th-downloads {
    text-align: center;
    width: 95px;
    max-width: 95px;
}

.modern-projects-table .th-plays {
    text-align: center;
    width: 55px;
    max-width: 55px;
}

.modern-projects-table .th-status {
    text-align: center;
    width: 85px;
    max-width: 85px;
}

.modern-projects-table .th-actions {
    text-align: center;
    width: 100px;
    max-width: 100px;
    padding-right: 8px;
    padding-left: 8px;
}

/* Table Rows */
.modern-projects-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.modern-projects-table tbody tr:hover {
    background: rgba(124, 77, 255, 0.05);
}

.modern-projects-table td {
    padding: 16px 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

/* Project Cell */
.project-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0; /* Allow flex item to shrink below content size */
}

.project-cell {
    max-width: 300px; /* Prevent cell from expanding too much */
}

.project-thumbnail-small {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    border: 2px solid rgba(139, 92, 246, 0.3);
}

.project-thumbnail-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    border: 2px solid rgba(139, 92, 246, 0.3);
}

.project-name {
    font-weight: 500;
    color: #ffffff;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 200px;
    display: inline-block;
}

/* Views, Downloads and Plays Cells */
.views-cell,
.downloads-cell,
.plays-cell {
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    background: linear-gradient(135deg, #60A5FA 0%, #A78BFA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Status Badge */
.status-cell {
    text-align: center;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.status-badge.status-published {
    background: rgba(52, 211, 153, 0.2);
    color: #34D399;
    border: 1px solid rgba(52, 211, 153, 0.4);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.2);
}

.status-badge.status-restricted {
    background: rgba(251, 146, 60, 0.2);
    color: #FB923C;
    border: 1px solid rgba(251, 146, 60, 0.4);
    box-shadow: 0 0 10px rgba(251, 146, 60, 0.2);
}

.status-badge.status-pending {
    background: rgba(250, 204, 21, 0.2);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.3);
}

.status-badge.status-draft {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Cell alignments */
.views-cell,
.downloads-cell {
    text-align: center;
}

.status-cell {
    text-align: center;
    min-width: 100px;
}

/* Action Buttons */
.actions-cell {
    text-align: center;
    min-width: 120px;
    padding-right: 15px !important; 
    padding-left: 10px !important;
    white-space: nowrap; /* Prevent wrapping */
}

.action-buttons {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
}

.action-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    color: #A5B4FC;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
}

.action-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    color: #C7D2FE;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.action-btn svg {
    width: 13px;
    height: 13px;
}

/* Specific button styles - removed green styling for view button */
/* All buttons now use the same blue color scheme */

/* Empty State Styles */
.empty-state-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    padding: 60px 20px;
}

.empty-state-content {
    text-align: center;
    max-width: 500px;
}

.empty-state-icon {
    margin: 0 auto 30px;
    display: inline-block;
    opacity: 0.8;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.empty-state-title {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 15px;
    background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.empty-state-message {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 35px;
    line-height: 1.5;
}

.empty-state-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.empty-state-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.4);
    background: linear-gradient(135deg, #9F6FFF 0%, #F472B6 100%);
    color: white;
    text-decoration: none;
}

.empty-state-button svg {
    flex-shrink: 0;
}

/* Charts Section */
.charts-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-card {
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.chart-card:first-child .chart-title {
    background: linear-gradient(90deg, #EC4899 0%, #F472B6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chart-card:last-child .chart-title {
    background: linear-gradient(90deg, #3B82F6 0%, #60A5FA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chart-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-wrapper {
    position: relative;
    height: 200px;
    margin-bottom: 10px;
}

.chart-x-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    margin-top: 10px;
}

.chart-x-labels span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

/* Analytics Section */
#analytics-section {
    padding: 30px 40px;
}

.analytics-container {
    max-width: 1400px;
    margin: 0 auto;
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.analytics-title {
    color: #ffffff;
    font-size: 28px;
    margin: 0;
    font-weight: 700;
    background: linear-gradient(135deg, #8B5CF6 0%, #3B82F6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.analytics-period {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
}

/* Analytics Stats Grid */
.analytics-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.analytics-stat-card {
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.analytics-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8B5CF6 0%, #EC4899 100%);
}

.analytics-stat-card .stat-value {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #60A5FA 0%, #A78BFA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    line-height: 1;
}

.analytics-stat-card .stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.analytics-stat-card .stat-change {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
}

.analytics-stat-card .stat-change.positive {
    color: #34D399;
}

.analytics-stat-card .stat-change.negative {
    color: #EF4444;
}

/* Analytics Charts Grid */
.analytics-charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.analytics-chart-container {
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.analytics-chart-container .chart-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 25px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-canvas-wrapper {
    position: relative;
    height: 350px;
    width: 100%;
    margin-bottom: 20px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Date Filter Controls */
.analytics-date-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.analytics-date-filter label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
}

.analytics-date-filter input[type="date"] {
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    transition: all 0.3s ease;
}

.analytics-date-filter input[type="date"]:hover {
    border-color: rgba(139, 92, 246, 0.5);
}

.analytics-date-filter input[type="date"]:focus {
    outline: none;
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.apply-filter-btn {
    background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.apply-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

.apply-filter-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Full-width Combined Chart Container */
.analytics-chart-container-full {
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 35px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    margin-top: 30px;
}

.analytics-chart-container-full .chart-title {
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.analytics-chart-container-full .chart-canvas-wrapper {
    height: 450px;
}

/* Top Games List */
.top-games-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top-game-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(124, 77, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(124, 77, 255, 0.1);
}

.game-rank {
    font-weight: 700;
    color: #a78bfa;
    margin-right: 12px;
}

.game-name {
    flex: 1;
    color: #ffffff;
    font-weight: 500;
}

.game-stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
}

.game-stats .views,
.game-stats .downloads {
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-content-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-section {
        flex-direction: row;
        gap: 20px;
    }
    
    .chart-card {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .dashboard-header-modern {
        padding: 20px;
    }
    
    .dashboard-header-modern .dashboard-title {
        font-size: 28px;
    }
    
    .dashboard-content-grid {
        padding: 20px;
        gap: 20px;
    }
    
    .charts-section {
        flex-direction: column;
    }
    
    .modern-projects-table th,
    .modern-projects-table td {
        padding: 12px;
    }
    
    .action-buttons {
        gap: 4px;
    }
    
    .action-btn {
        width: 28px;
        height: 28px;
    }
}

/* Scrollbar Styling */
.cas-creator-dashboard-modern::-webkit-scrollbar {
    width: 10px;
}

.cas-creator-dashboard-modern::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.cas-creator-dashboard-modern::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
}

.cas-creator-dashboard-modern::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-row {
    animation: fadeIn 0.3s ease-out;
}

/* Chart Canvas Placeholder Styling */
canvas {
    max-width: 100%;
    height: auto !important;
}

/* Legacy styles compatibility - Keep existing functionality */
.cas-creator-dashboard {
    display: none;
}

/* Override parent theme styles if needed */
body .cas-creator-dashboard-modern {
    max-width: 100% !important;
    margin: 0 !important;
}

/* No data message */
.no-data {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 40px;
    font-style: italic;
}