:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.25);
    --status-none: #e2e8f0;
    --status-started: #f59e0b;
    --status-started-bg: #fef3c7;
    --status-finished: #10b981;
    --status-finished-bg: #d1fae5;
    --radius: 20px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --border-color: #f1f5f9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 20px;
    padding-bottom: 80px;
}

header {
    margin-bottom: 32px;
    animation: slideDown 0.6s ease;
}

.header-top {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 28px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo svg {
    width: 36px;
    height: 36px;
    color: var(--primary);
    filter: drop-shadow(0 4px 6px var(--primary-glow));
}

.logo h1 {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: var(--text-main);
}

.logo h1 span {
    color: var(--primary);
}

.progress-section {
    background: var(--bg-card);
    padding: 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-weight: 700;
    font-size: 18px;
}

#totalPercent {
    color: var(--primary);
    font-size: 22px;
}

.progress-bar-container {
    height: 14px;
    background: var(--bg-main);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #a78bfa);
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
}

.stats-row {
    display: flex;
    gap: 12px;
}

.stat-badge {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid var(--border-color);
}

.stat-badge span {
    font-size: 20px;
    font-weight: 800;
}

.stat-badge.not-started {
    color: var(--text-muted);
}

.stat-badge.started {
    color: var(--status-started);
    background: var(--status-started-bg);
    border-color: transparent;
}

.stat-badge.finished {
    color: var(--status-finished);
    background: var(--status-finished-bg);
    border-color: transparent;
}


/* Sections (TYT, AYT) */
.section-accordion {
    margin-bottom: 24px;
    animation: fadeIn 0.5s ease;
}

.section-header {
    background: linear-gradient(135deg, var(--bg-card), #f8fafc);
    padding: 22px 24px;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    user-select: none;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    color: var(--text-main);
}

.section-header:active {
    transform: scale(0.98);
}

.section-header .perc {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg-main);
    padding: 4px 12px;
    border-radius: 20px;
}

.section-body {
    display: none;
    padding: 16px 0;
}

.section-accordion.active .section-body {
    display: block;
    animation: slideDownFade 0.4s ease;
}

.section-accordion.active .section-header {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    border-bottom-width: 3px;
    border-bottom-color: var(--primary);
}


/* Courses */
.course-accordion {
    background: var(--bg-card);
    margin-bottom: 14px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.course-header {
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 17px;
    transition: var(--transition);
}

.course-header:active,
.course-header:hover {
    background: var(--bg-card-hover);
}

.course-header .perc {
    font-size: 15px;
    color: var(--primary);
    font-weight: 700;
}

.course-body {
    display: none;
    background: var(--bg-main);
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.course-accordion.active .course-body {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
    animation: fadeIn 0.4s ease;
}

@media (min-width: 600px) {
    .course-accordion.active .course-body {
        grid-template-columns: 1fr 1fr;
    }
}


/* Topics */
.topic-item {
    background: var(--bg-card);
    padding: 16px 18px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
    border-left: 5px solid var(--status-none);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.topic-item:active {
    transform: scale(0.97);
}

.topic-item .title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    pointer-events: none;
}

.topic-item .status-indicator {
    font-size: 11px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 20px;
    background: var(--status-none);
    color: var(--text-muted);
    transition: var(--transition);
    pointer-events: none;
}

.topic-item[data-state="0"] {
    border-left-color: var(--status-none);
}

.topic-item[data-state="1"] {
    border-left-color: var(--status-started);
    background: var(--status-started-bg);
}

.topic-item[data-state="1"] .title {
    color: #b45309;
}

.topic-item[data-state="1"] .status-indicator {
    color: #b45309;
    background: rgba(245, 158, 11, 0.2);
}

.topic-item[data-state="2"] {
    border-left-color: var(--status-finished);
    background: var(--status-finished-bg);
}

.topic-item[data-state="2"] .title {
    color: #047857;
}

.topic-item[data-state="2"] .status-indicator {
    color: #047857;
    background: rgba(16, 185, 129, 0.2);
}


/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* PWA Prompt Modalı */
.pwa-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: transparent;
    z-index: 9999;
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    pointer-events: none;
}

.pwa-prompt-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 420px;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--border-color);
    display: flex;
    gap: 16px;
    align-items: center;
    pointer-events: auto;
    position: relative;
    animation: slideUpPrompt 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.pwa-close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pwa-close-btn:active {
    background: var(--bg-card-hover);
}

.pwa-prompt-icon img {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    object-fit: cover;
}

.pwa-prompt-body {
    flex: 1;
}

.pwa-prompt-body h3 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text-main);
}

.pwa-prompt-body p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
}

.pwa-install-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.pwa-install-btn:active {
    transform: scale(0.96);
}

.pwa-ios-instructions {
    font-size: 13px;
    color: #475569;
    background: #f1f5f9;
    padding: 12px 14px;
    border-radius: 12px;
    line-height: 1.4;
    border: 1px solid #e2e8f0;
}

@keyframes slideUpPrompt {
    from {
        transform: translateY(120%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDownPromptHide {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(150%);
        opacity: 0;
    }
}