/* Mobile Graph Viewer Styles */

/* Graph Modal */
.graph-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.graph-modal-content {
    background: white;
    border-radius: 15px;
    width: 100%;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.graph-modal-close {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #333;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all 0.3s ease;
}

.graph-modal-close:hover {
    background: #fff;
    transform: rotate(90deg);
}

.graph-modal-header {
    padding: 1rem;
    text-align: center;
    border-bottom: 2px solid #eee;
}

.graph-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
}

.graph-modal-body {
    flex: 1;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

#modalGraphCanvas {
    max-width: 100%;
    max-height: 70vh;
}

/* Mobile Graph Button - Only visible on mobile */
.mobile-graph-button {
    display: none;
    width: 100%;
    padding: 1rem;
    margin-top: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.mobile-graph-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.mobile-graph-button i {
    margin-right: 0.5rem;
}


/* Mobile-only display */
@media (max-width: 768px) {
    .mobile-graph-button {
        display: block !important;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .graph-modal-content {
        max-height: 90vh;
    }

    #modalGraphCanvas {
        max-height: 60vh;
    }

    .graph-modal-header h3 {
        font-size: 1rem;
    }
}

/* Desktop - ensure button is hidden */
@media (min-width: 769px) {
    .mobile-graph-button {
        display: none !important;
    }

    /* Ensure canvases are visible on desktop */
    .chart-container canvas,
    .profile-chart-container canvas,
    .radar-chart-container canvas {
        display: block !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .graph-modal-content {
        background: #2d2d2d;
    }

    .graph-modal-header {
        border-bottom-color: #444;
    }

    .graph-modal-header h3 {
        color: #fff;
    }

    .graph-modal-close {
        background: rgba(255, 255, 255, 0.1);
        border-color: #666;
        color: #fff;
    }
}