:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --background-color: #ecf0f1;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
    --text-color: #2c3e50;
    --border-radius: 16px;
    --shadow: 0 8px 32px rgba(44, 62, 80, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-color);
    min-height: 100vh;
    padding-bottom: 80px;
}

.app-header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.user-stats {
    display: flex;
    gap: 1rem;
    font-weight: 600;
}

.user-stats span {
    background: var(--glass-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
}

.app-main {
    padding: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.content-section.active {
    display: block;
}

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

.welcome-card, .problem-card, .form-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.welcome-card h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.welcome-card p {
    text-align: center;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.difficulty-selector h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.difficulty-btn {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.difficulty-btn:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--secondary-color);
}

.difficulty-btn.selected {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.difficulty-btn i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.difficulty-btn span {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.difficulty-btn small {
    opacity: 0.8;
}

.session-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.timer-option, .problem-count {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.timer-option label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.timer-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

select {
    padding: 0.5rem;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
}

.primary-btn, .secondary-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    box-shadow: var(--shadow);
}

.primary-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.secondary-btn {
    background: var(--primary-color);
}

.secondary-btn:hover {
    background: #34495e;
    transform: translateY(-2px);
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.problem-counter {
    font-weight: 600;
    color: var(--primary-color);
}

.timer-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
    font-weight: 600;
}

.problem-statement {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.answer-section label {
    font-weight: 600;
    color: var(--primary-color);
}

.answer-section input {
    padding: 1rem;
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    text-align: center;
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
    width: 200px;
}

.hint-section {
    margin-top: 2rem;
    text-align: center;
}

.hint-btn {
    background: #f39c12;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
}

.hint-content {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(243, 156, 18, 0.1);
    border-radius: 12px;
    border-left: 4px solid #f39c12;
}

.feedback-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.feedback-content {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow);
}

.feedback-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.feedback-message {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.solution-steps {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 12px;
    margin: 1rem 0;
    text-align: left;
}

.solution-steps h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.solution-steps ol {
    padding-left: 1.5rem;
}

.solution-steps li {
    margin-bottom: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.knowledge-tree, .recent-sessions {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.knowledge-tree h3, .recent-sessions h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.tree-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.skill-node {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.node-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.node-label {
    display: block;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.progress-bar {
    background: rgba(255, 255, 255, 0.2);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--success-color);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.session-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-info-item {
    display: flex;
    flex-direction: column;
}

.session-date {
    font-weight: 600;
    color: var(--primary-color);
}

.session-stats {
    font-size: 0.9rem;
    opacity: 0.8;
}

.session-score {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--success-color);
}

.lists-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.lists-container h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.lists-container p {
    margin-bottom: 2rem;
    opacity: 0.8;
}

.create-list-section {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.lists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.list-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.list-title {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.list-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.icon-btn.edit {
    color: var(--secondary-color);
}

.icon-btn.delete {
    color: var(--error-color);
}

.list-description {
    margin-bottom: 1rem;
    opacity: 0.8;
    font-size: 0.9rem;
}

.list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.meta-tag {
    background: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.meta-tag.difficulty {
    background: var(--primary-color);
}

.list-topics {
    font-size: 0.9rem;
    opacity: 0.8;
}

.faq-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.faq-container h2 {
    margin-bottom: 2rem;
    color: var(--primary-color);
    text-align: center;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.1);
}

.faq-icon {
    font-size: 1.2rem;
    font-weight: 700;
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    line-height: 1.6;
    opacity: 0.9;
}

.faq-answer[hidden] {
    display: none;
}

.no-data {
    text-align: center;
    opacity: 0.6;
    font-style: italic;
    padding: 2rem;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    min-width: 60px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-item.active {
    color: var(--secondary-color);
    background: rgba(52, 152, 219, 0.2);
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.nav-item span {
    font-size: 0.8rem;
    font-weight: 600;
}

footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    margin-top: 2rem;
}

.success {
    color: var(--success-color);
}

.error {
    color: var(--error-color);
}

.correct-answer .feedback-icon::before {
    content: "🎉";
}

.correct-answer .feedback-message {
    color: var(--success-color);
}

.incorrect-answer .feedback-icon::before {
    content: "🤔";
}

.incorrect-answer .feedback-message {
    color: var(--error-color);
}

@media (max-width: 768px) {
    .app-header {
        padding: 0.75rem;
    }
    
    .app-header h1 {
        font-size: 1.25rem;
    }
    
    .user-stats {
        gap: 0.5rem;
    }
    
    .user-stats span {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .welcome-card, .problem-card, .form-container {
        padding: 1.5rem;
    }
    
    .difficulty-buttons {
        grid-template-columns: 1fr;
    }
    
    .session-options {
        gap: 0.75rem;
    }
    
    .timer-option, .problem-count {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .session-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .tree-container {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .lists-grid {
        grid-template-columns: 1fr;
    }
    
    .feedback-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .nav-item span {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .app-main {
        padding: 0.75rem;
    }
    
    .welcome-card, .problem-card, .form-container {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .session-item {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.celebration {
    animation: bounce 1s ease-in-out;
}

.pulse {
    animation: pulse 2s infinite;
}

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