/* Color Palette Variables */
:root {
    --bg-main: #1a1a1a;
    --bg-card: #282828;
    --text-main: #ffffff;
    --text-muted: #8a8a8a;
    --accent: #ffa116; /* LeetCode Orange */
    --easy-color: #00b8a3;
    --medium-color: #ffc01e;
    --hard-color: #ff375f;
    --ring-bg: #3e3e3e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background-color: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

h1 {
    font-size: 2rem;
    color: var(--text-main);
    text-align: center;
}

.user-container p {
    color: var(--text-muted);
    margin-bottom: 8px;
}

.user-input-container {
    display: flex;
    gap: 10px;
}

#user-input {
    flex-grow: 1;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--ring-bg);
    background-color: var(--bg-main);
    color: var(--text-main);
    outline: none;
    transition: border 0.3s ease;
}

#user-input:focus {
    border-color: var(--accent);
}

#search-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: none;
    background-color: var(--accent);
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#search-btn:hover {
    background-color: #e58f12;
}

/* Hide Class for JS toggle */
.hidden {
    display: none !important;
}

.progress {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.progress-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Progress Rings */
/* Progress Rings */
.circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    position: relative;
    display: flex;
    flex-direction: column; /* THIS IS THE FIX: Stacks items vertically */
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Creates the inner hollow part of the ring */
.circle::before {
    content: "";
    position: absolute;
    width: 100px; 
    height: 100px;
    background-color: var(--bg-card);
    border-radius: 50%;
    z-index: 1;
}

/* Ensure BOTH the numbers and the labels sit on top of the inner circle */
.circle span, 
.circle p {
    position: relative;
    z-index: 2;
}

/* Make the labels slightly smaller so they fit nicely under the numbers */
.circle p {
    font-size: 0.8rem;
    margin-top: 2px;
}

/* Specific Colors for Difficulty */
.easy-progress {
    background: conic-gradient(var(--easy-color) var(--progress-degree, 0%), var(--ring-bg) 0%);
    color: var(--easy-color);
}
.easy-progress p { color: var(--easy-color); }

.medium-progress {
    background: conic-gradient(var(--medium-color) var(--progress-degree, 0%), var(--ring-bg) 0%);
    color: var(--medium-color);
}
.medium-progress p { color: var(--medium-color); }

.hard-progress {
    background: conic-gradient(var(--hard-color) var(--progress-degree, 0%), var(--ring-bg) 0%);
    color: var(--hard-color);
}
.hard-progress p { color: var(--hard-color); }

/* Stats Cards */
.stats-cards {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
}

.card {
    background-color: var(--bg-main);
    width: 48%;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border-top: 3px solid var(--accent);
}

.card h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.card p {
    font-size: 1.5rem;
    font-weight: bold;
} 

.hidden {
    display: none !important;
}

/* =========================================
   Mobile Responsiveness (Screens under 768px)
   ========================================= */
@media (max-width: 768px) {
    
    /* 1. Stack the input field and search button */
    .user-input-container { 
        flex-direction: column;
    }
    
    #user-input, #search-btn {
        width: 100%;
    }

    /* 2. Stack the progress circles perfectly in a column */
    .progress {
        flex-direction: column;
        align-items: center;
        gap: 30px; /* Gives them a bit more breathing room vertically */
    }

    /* 3. Make the stats cards span 100% width instead of 48% */
    .stats-cards {
        flex-direction: column;
    }

    .card {
        width: 100%; 
    }
}
