/* File: styles/graphs.css */

/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #121212;
    color: #fff;
    padding: 2rem;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #37474f;
}

.header-left h1 {
    font-size: 2.5rem;
    color: #bb86fc;
}

.header-right .back-home-btn {
    background-color: #292929;
    color: #bb86fc;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 1px solid #bb86fc;
}

.header-right .back-home-btn:hover {
    background-color: #bb86fc;
    color: #292929;
}

/* Intro Section */
.intro {
    margin-bottom: 3rem;
    text-align: center;
}

.intro p {
    font-size: 1.2rem;
    color: #e0e0e0;
}

/* Graph Grid */
.graph-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 0 auto;
}

/* Graph Cards */
.graph-card {
    background: #1e1e1e;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    position: relative;
}

.graph-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.graph-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #4a148c, #880e4f, #bb86fc, #7b1fa2);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
    mix-blend-mode: color-dodge;
    border-radius: 12px;
}

.graph-card:hover::before {
    opacity: 0.4;
}

.graph-card h2 {
    color: #e0e0e0;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

/* Graph Content */
.graph-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

/* Graph Preview */
.graph-preview {
    background: #292929;
    padding: 1rem;
    border-radius: 8px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* CSS Charts */
.css-chart {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Line Graph */
.line-graph {
    width: 100%;
    height: 100%;
    border-bottom: 2px solid #bb86fc;
    position: relative;
    overflow: hidden;
}

.line-graph::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: #bb86fc;
    transform: rotate(-45deg);
    top: 50%;
    left: 0;
}

/* Bar Graph */
.bar-graph {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 100%;
    gap: 10px;
}

.bar {
    width: 30px;
    background: #bb86fc;
    opacity: 0.8;
    border-radius: 4px;
}

.bar:nth-child(1) {
    height: 60%;
}

.bar:nth-child(2) {
    height: 80%;
}

.bar:nth-child(3) {
    height: 40%;
}

.bar:nth-child(4) {
    height: 70%;
}

/* Pie Chart */
.pie-chart {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient( #bb86fc 0% 25%,
    #a29bfe 25% 56%,
    #81ecec 56% 100%);
    margin: auto;
}

/* Scatter Plot */
.scatter-plot {
    width: 100%;
    height: 100%;
    position: relative;
}

.scatter-plot::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #bb86fc;
    border-radius: 50%;
    top: 30%;
    left: 40%;
}

.scatter-plot::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #bb86fc;
    border-radius: 50%;
    top: 60%;
    left: 70%;
}

/* Graph Info */
.graph-info {
    padding: 1rem;
    background: #292929;
    border-radius: 8px;
    color: #e0e0e0;
}

.graph-info h3 {
    color: #e0e0e0;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.graph-info ul {
    list-style-position: inside;
    margin-bottom: 1rem;
    color: #9fa8da;
}

.view-more {
    display: inline-block;
    color: #bb86fc;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.view-more:hover {
    color: #a78bfa;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .header-left h1 {
        font-size: 2rem;
    }

    .graph-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .graph-card {
        padding: 1.5rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .graph-card {
        transition: none;
    }

    .graph-card:hover {
        transform: none;
    }
}
