/* CSS Variables - Purple Dark Theme */
:root {
    --primary-purple: #7B2CBF;
    --secondary-purple: #9D4EDD;
    --light-purple: #C77DFF;
    --very-light-purple: #E0AAFF;
    --background-black: #000000;
    --background-dark: #1A1A1A;
    --background-medium: #2D2D2D;
    --text-light: #FFFFFF;
    --text-gray: #CCCCCC;
    --text-dim: #999999;
    --success-green: #00FF88;
    --warning-yellow: #FFD700;
    --border-color: rgba(123, 44, 191, 0.3);
    --shadow-color: rgba(123, 44, 191, 0.2);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--background-black) 0%, var(--background-dark) 100%);
    color: var(--text-light);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease;
}

.app-title {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--secondary-purple), var(--light-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    font-weight: 800;
}

.tagline {
    color: var(--text-gray);
    font-size: 1.1rem;
    font-style: italic;
}

/* Card Components */
.card {
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px var(--shadow-color);
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--light-purple);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Hero Section */
.hero-display {
    display: flex;
    align-items: center;
    gap: 30px;
}

.hero-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-purple), var(--secondary-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px var(--shadow-color);
    transition: transform 0.3s ease;
}

.hero-avatar:hover {
    transform: scale(1.1) rotate(5deg);
}

.hero-icon {
    font-size: 4rem;
}

.hero-info {
    flex: 1;
}

.hero-name {
    font-size: 2.5rem;
    margin-bottom: 5px;
    background: linear-gradient(135deg, var(--light-purple), var(--very-light-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-tier {
    color: var(--warning-yellow);
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.hero-stats {
    display: flex;
    gap: 30px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    background: var(--background-medium);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stat-label {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.stat-value {
    color: var(--light-purple);
    font-size: 1.8rem;
    font-weight: 700;
}

/* Level Section */
.level-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.level-header {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-gray);
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--background-medium);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-purple), var(--secondary-purple), var(--light-purple));
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: 700;
}

.level-requirements {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.requirement {
    flex: 1;
    padding: 15px;
    background: var(--background-medium);
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.requirement-label {
    display: block;
    color: var(--text-dim);
    margin-bottom: 5px;
}

.requirement span:last-child {
    color: var(--light-purple);
    font-size: 1.5rem;
    font-weight: 700;
}

/* Workout Section */
.date-display {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-gray);
    margin-bottom: 25px;
    padding: 10px;
    background: var(--background-medium);
    border-radius: 8px;
}

.workout-tracker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.workout-item {
    background: var(--background-medium);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.workout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.workout-header h3 {
    font-size: 1.4rem;
    color: var(--light-purple);
}

.workout-count {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--success-green);
}

.workout-progress {
    margin-bottom: 20px;
}

.workout-progress-bar {
    width: 100%;
    height: 20px;
    background: var(--background-dark);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.workout-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-purple), var(--light-purple));
    transition: width 0.5s ease;
}

.workout-percentage {
    text-align: right;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.workout-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.btn-increment {
    background: var(--primary-purple);
    color: white;
    flex: 1;
    min-width: 60px;
}

.btn-increment:hover {
    background: var(--secondary-purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.btn-increment:active {
    transform: translateY(0);
}

.btn-custom {
    background: var(--light-purple);
    color: var(--background-black);
}

.btn-custom:hover {
    background: var(--very-light-purple);
}

.custom-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-dark);
    color: var(--text-light);
    font-size: 1rem;
    min-width: 80px;
}

.custom-input:focus {
    outline: none;
    border-color: var(--light-purple);
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--background-medium);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: scale(1.05);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-card .stat-label {
    color: var(--text-dim);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 5px;
}

.stat-card .stat-value {
    color: var(--light-purple);
    font-size: 1.8rem;
    font-weight: 700;
}

/* Charts Section */
.chart-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.btn-chart-toggle {
    background: var(--background-medium);
    color: var(--text-gray);
    border: 1px solid var(--border-color);
}

.btn-chart-toggle.active {
    background: var(--primary-purple);
    color: white;
    border-color: var(--primary-purple);
}

.btn-chart-toggle:hover {
    border-color: var(--light-purple);
}

.chart-container {
    position: relative;
    height: 300px;
    background: var(--background-medium);
    padding: 20px;
    border-radius: 12px;
}

/* Motivation Section */
.motivation-section {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-purple), var(--secondary-purple));
}

.motivation-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.motivation-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
}

/* Actions Section */
.actions-section {
    text-align: center;
    margin-bottom: 50px;
}

.btn-reset {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border-color);
    padding: 10px 30px;
}

.btn-reset:hover {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4444;
    border-color: #ff4444;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-purple), var(--secondary-purple));
    color: white;
    padding: 15px 40px;
    font-size: 1.1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, var(--background-dark), var(--background-medium));
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    border: 2px solid var(--light-purple);
    box-shadow: 0 0 50px var(--shadow-color);
    animation: scaleIn 0.5s ease;
}

.modal-celebration {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.modal-content h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--light-purple), var(--very-light-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-content p {
    font-size: 1.2rem;
    color: var(--text-gray);
    margin-bottom: 15px;
}

.tier-announce {
    color: var(--warning-yellow);
    font-weight: 700;
    font-size: 1.4rem !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-title {
        font-size: 2rem;
    }

    .hero-display {
        flex-direction: column;
        text-align: center;
    }

    .hero-avatar {
        width: 100px;
        height: 100px;
    }

    .hero-icon {
        font-size: 3rem;
    }

    .hero-name {
        font-size: 2rem;
    }

    .hero-stats {
        flex-wrap: wrap;
        justify-content: center;
    }

    .workout-tracker {
        grid-template-columns: 1fr;
    }

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

    .card {
        padding: 20px;
    }

    .modal-content {
        padding: 30px;
        margin: 20px;
    }

    .modal-celebration {
        font-size: 3rem;
    }

    .modal-content h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .workout-controls {
        flex-direction: column;
    }

    .btn-increment {
        min-width: 100%;
    }

    .level-requirements {
        flex-direction: column;
    }
}

/* Accessibility */
.btn:focus,
.custom-input:focus {
    outline: 2px solid var(--light-purple);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .btn {
        display: none;
    }
}
