/* General Styling & Fonts */
:root {
    --bg-dark: #1a1a2d;
    --card-bg: #252841;
    --primary-accent: #4a90e2;
    --easy-color: #5ddea8;
    --medium-color: #ffc44d;
    --hard-color: #ff6b6b;
    --text-light: #e0e0e0;
    --text-dark: #a0a0a0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    line-height: 1.6;
}

/* Main Container */
.container {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 15px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 25px;
}

.header h1 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    background: -webkit-linear-gradient(45deg, var(--easy-color), var(--primary-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.header p {
    color: var(--text-dark);
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

/* User Input Section */
.user-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

#user-input {
    flex-grow: 1;
    min-width: 200px;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: #1a1a2d;
    color: var(--text-light);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

#user-input:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

#search-btn {
    padding: 14px 24px;
    font-size: 1rem;
    border-radius: 8px;
    border: none;
    background-color: var(--primary-accent);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    white-space: nowrap;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

#search-btn:hover {
    background-color: #3a80d2;
    transform: translateY(-2px);
}

#search-btn:active {
    transform: translateY(0);
}

#search-btn:disabled {
    background-color: #444;
    cursor: not-allowed;
    transform: none;
}

/* Progress Circles */
.progress {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
}

.progress-item {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 100px;
    max-width: 120px;
}

.circle {
    width: 100px;
    height: 100px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.circle-content {
    position: absolute;
    text-align: center;
    width: 100%;
}

.circle-content span {
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: 700;
    display: block;
    line-height: 1.2;
}

.circle-content p {
    font-size: clamp(0.75rem, 2.5vw, 0.9rem);
    color: var(--text-dark);
    margin-top: 2px;
}

.progress-ring {
    transform: rotate(-90deg);
    width: 100px;
    height: 100px;
}

.progress-ring__circle {
    transition: 0.5s stroke-dashoffset;
    stroke: var(--primary-accent);
    stroke-width: 6;
    r: 42;
}

.easy-progress .progress-ring__circle { stroke: var(--easy-color); }
.medium-progress .progress-ring__circle { stroke: var(--medium-color); }
.hard-progress .progress-ring__circle { stroke: var(--hard-color); }


/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.card {
    background-color: #1a1a2d;
    padding: 16px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.card h4 {
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.card p {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 700;
    color: var(--text-light);
    line-height: 1.2;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }

    .container {
        padding: 20px;
        border-radius: 12px;
        margin: 0;
    }

    .header {
        margin-bottom: 20px;
    }

    .header h1 {
        font-size: clamp(1.8rem, 6vw, 2.2rem);
        margin-bottom: 0.3rem;
    }

    .header p {
        font-size: clamp(0.85rem, 3vw, 0.95rem);
    }

    .user-input-container {
        margin-bottom: 20px;
        gap: 8px;
    }

    #user-input {
        padding: 12px 14px;
        font-size: 0.95rem;
        min-width: 180px;
    }

    #search-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
        min-height: 44px;
    }

    .progress {
        gap: 15px;
        margin-bottom: 20px;
    }

    .progress-item {
        min-width: 90px;
        max-width: 100px;
    }

    .circle {
        width: 90px;
        height: 90px;
    }

    .progress-ring {
        width: 90px;
        height: 90px;
    }

    .progress-ring__circle {
        stroke-width: 5;
        r: 37;
    }

    .circle-content span {
        font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    }

    .circle-content p {
        font-size: clamp(0.7rem, 3vw, 0.85rem);
    }

    .stats-cards {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }

    .card {
        padding: 14px;
        min-height: 70px;
    }

    .card h4 {
        font-size: clamp(0.75rem, 3vw, 0.85rem);
        margin-bottom: 6px;
    }

    .card p {
        font-size: clamp(1.1rem, 5vw, 1.3rem);
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    .container {
        padding: 16px;
        border-radius: 10px;
    }

    .header h1 {
        font-size: clamp(1.6rem, 7vw, 2rem);
    }

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

    #user-input {
        width: 100%;
        min-width: unset;
    }

    #search-btn {
        width: 100%;
    }

    .progress {
        gap: 10px;
    }

    .progress-item {
        min-width: 80px;
        max-width: 90px;
    }

    .circle {
        width: 80px;
        height: 80px;
    }

    .progress-ring {
        width: 80px;
        height: 80px;
    }

    .progress-ring__circle {
        stroke-width: 4;
        r: 32;
    }

    .circle-content span {
        font-size: clamp(0.8rem, 4vw, 1rem);
    }

    .circle-content p {
        font-size: clamp(0.65rem, 3.5vw, 0.8rem);
    }

    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .card {
        padding: 12px;
        min-height: 65px;
    }

    .card h4 {
        font-size: clamp(0.7rem, 3.5vw, 0.8rem);
    }

    .card p {
        font-size: clamp(1rem, 5.5vw, 1.2rem);
    }
}

@media (max-width: 360px) {
    .container {
        padding: 12px;
    }

    .progress-item {
        min-width: 70px;
        max-width: 80px;
    }

    .circle {
        width: 70px;
        height: 70px;
    }

    .progress-ring {
        width: 70px;
        height: 70px;
    }

    .progress-ring__circle {
        r: 27;
    }

    .stats-cards {
        grid-template-columns: 1fr 1fr;
    }

    .card {
        padding: 10px;
        min-height: 60px;
    }
}
