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

:root {
    --primary-color: #0088cc;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --bg-color: #ffffff;
    --text-color: #212529;
    --card-bg: #f8f9fa;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-color);
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Screen Management */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    z-index: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0.3s;
}

.screen.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 1 !important;
    transform: translateX(0) !important;
}

/* Ensure non-active screens are completely hidden */
.screen:not(.active) {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: 0 !important;
    transform: translateX(100%) !important;
}

/* Language screen needs flex when active */
#language-screen {
    display: flex;
    align-items: center;
    justify-content: center;
}

#language-screen.active {
    display: flex !important;
}

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

/* Language Selection Screen */
#language-screen {
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.welcome-animation {
    text-align: center;
    margin-bottom: 40px;
}

.animated-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
    animation: slideDown 0.6s ease-out;
}

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

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    animation: fadeIn 0.8s ease-out;
}

.language-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 300px;
}

.lang-btn {
    background: white;
    border: none;
    padding: 20px 30px;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    animation: scaleIn 0.5s ease-out backwards;
}

.lang-btn:nth-child(1) {
    animation-delay: 0.2s;
}

.lang-btn:nth-child(2) {
    animation-delay: 0.4s;
}

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

.lang-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.lang-btn:active {
    transform: scale(0.95);
}

.flag {
    font-size: 2rem;
}

/* Header - Modern Design */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 24px;
}

.stars-display {
    background: white;
    padding: 10px 18px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.stars-display:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.star-icon {
    font-size: 1.2rem;
    color: #fbbf24;
}

.lang-switch-btn {
    background: white;
    border: 1px solid #e5e7eb;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-switch-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #d1d5db;
}

.back-btn {
    background: white;
    border: 1px solid #e5e7eb;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover {
    transform: translateX(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #d1d5db;
}

/* Main Content - Modern Design */
.main-content {
    background: transparent;
    padding: 0;
    margin-top: 0;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
}

.main-content h1 {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 32px;
    text-align: center;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3),
        0 6px 12px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(255, 255, 255, 0.3);
    letter-spacing: 0.5px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 0;
}

.action-btn {
    background: white;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    padding: 20px 24px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    text-align: right;
    width: 100%;
    justify-content: flex-start;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.action-btn:hover::before {
    transform: scaleY(1);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: #d1d5db;
    background: #fafafa;
}

.action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.action-btn.primary::before {
    background: rgba(255, 255, 255, 0.2);
}

.action-btn.primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.action-btn.premium {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(240, 147, 251, 0.3);
}

.action-btn.premium::before {
    background: rgba(255, 255, 255, 0.2);
}

.action-btn.premium:hover {
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.4);
    background: linear-gradient(135deg, #e081f1 0%, #e3475c 100%);
}

.btn-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

/* Forms */
.form {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow-lg);
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.1);
}

.submit-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-btn:hover {
    background: #006ba3;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Loading Spinner */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state {
    text-align: center;
    padding: 40px;
}

/* Study Plan Content */
.plan-content {
    background: transparent;
    padding: 0;
    margin-top: 20px;
}

/* Modern Tasks Container */
.tasks-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Add Task Card - Modern Design */
.add-task-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
}

.add-task-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.add-task-input {
    flex: 1;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: #fafafa;
}

.add-task-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.1);
}

.add-task-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 136, 204, 0.2);
}

.add-task-btn:hover {
    background: #006ba3;
    transform: scale(1.05);
}

.add-task-btn:active {
    transform: scale(0.95);
}

/* Modern Day Card */
.modern-day-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    animation: slideInLeft 0.5s ease-out;
}

.modern-day-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.day-card-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.day-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.day-hours {
    background: #f3f4f6;
    color: #6b7280;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

/* Modern Tasks List */
.tasks-list-modern {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-item-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.task-item-modern:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.task-item-modern.task-completed .task-text {
    text-decoration: line-through;
    color: #9ca3af;
}

.task-checkbox-wrapper {
    position: relative;
    flex-shrink: 0;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 0;
    position: absolute;
}

.task-checkbox-label {
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.task-checkbox:checked + .task-checkbox-label {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.task-checkbox:checked + .task-checkbox-label::after {
    content: '✓';
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.task-text {
    flex: 1;
    font-size: 15px;
    color: #374151;
    line-height: 1.5;
}

.task-delete-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 20px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
}

.task-item-modern:hover .task-delete-btn {
    opacity: 1;
}

.task-delete-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

/* Modern Section */
.modern-section {
    margin-top: 32px;
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.section-title-modern {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f3f4f6;
}

/* Goals Grid */
.goals-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.goal-card-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.goal-card-modern:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.goal-card-modern.goal-completed .goal-text {
    text-decoration: line-through;
    color: #9ca3af;
}

.goal-checkbox-wrapper {
    position: relative;
    flex-shrink: 0;
}

.goal-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 0;
    position: absolute;
}

.goal-checkbox-label {
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.goal-checkbox:checked + .goal-checkbox-label {
    background: var(--success-color);
    border-color: var(--success-color);
}

.goal-checkbox:checked + .goal-checkbox-label::after {
    content: '✓';
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.goal-text {
    flex: 1;
    font-size: 15px;
    color: #374151;
    line-height: 1.5;
}

/* Recommendations List Modern */
.recommendations-list-modern {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recommendation-card-modern {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #fef3c7;
    border-radius: 8px;
    border-left: 3px solid #f59e0b;
}

.rec-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.rec-text {
    flex: 1;
    font-size: 15px;
    color: #78350f;
    line-height: 1.5;
    margin: 0;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Progress Screen */
.progress-content {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow-lg);
    margin-top: 20px;
}

#progress-chart {
    width: 100%;
    height: 300px;
    margin-bottom: 20px;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--secondary-color);
    margin-top: 5px;
}

/* Buy Stars Screen */
.stars-packages {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.package-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.package-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.package-card:hover::before {
    left: 100%;
}

.package-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.package-card.featured {
    border: 2px solid var(--primary-color);
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
}

.package-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

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

.package-stars {
    font-size: 1.5rem;
}

.package-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

.package-desc {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.package-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.package-btn:hover {
    background: #006ba3;
    transform: scale(1.02);
}

/* Toast Messages */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-color);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

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

.toast.error {
    background: var(--danger-color);
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
}

[dir="rtl"] .back-btn {
    transform: scaleX(-1);
}

/* Responsive */
@media (max-width: 480px) {
    .animated-title {
        font-size: 2rem;
    }
    
    .main-content,
    .form,
    .plan-content,
    .progress-content {
        padding: 20px;
    }
}

