/*
 * WordPress Learning Platform - Integrated CSS
 * Combines TailwindCSS with existing custom styles
 * Version: 1.0.0
 * 
 * Color Scheme:
 * Primary: Blue (#3b82f6, #1e40af)
 * Secondary: Purple (#a855f7, #7c3aed) 
 * Accent: Cyan (#06b6d4, #0891b2)
 * Background: Gray dominance (#f8fafc, #f1f5f9, #e2e8f0)
 */

/* Import TailwindCSS compiled output */
@import url('./tailwind-output.css');

/* WordPress Theme Compatibility */
body.wp-admin {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* Override WordPress default styles with our design system */
.wp-admin .button-primary {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: white !important;
    border-radius: 0.5rem !important;
    padding: 0.5rem 1rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.wp-admin .button-primary:hover {
    background: #1e40af !important;
    border-color: #1e40af !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

.wp-admin .button-secondary {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #374151 !important;
    border-radius: 0.5rem !important;
    padding: 0.5rem 1rem !important;
    font-weight: 500 !important;
}

.wp-admin .button-secondary:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

/* Learning Platform Specific Styles */
.learning-platform {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    background-color: #f8fafc;
    min-height: 100vh;
}

/* Header Styles */
.platform-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
}

.platform-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.platform-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.platform-nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.platform-nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.platform-nav-link:hover,
.platform-nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Dashboard Layout */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

@media (max-width: 768px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }
}

/* Main Content Area */
.main-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
        border-radius: 0.75rem;
    }
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Course Cards */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .course-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1rem;
    }
}

.course-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.course-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.course-content {
    padding: 1.5rem;
}

@media (max-width: 768px) {
    .course-content {
        padding: 1rem;
    }
}

.course-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .course-title {
        font-size: 1rem;
    }
}

.course-description {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.course-difficulty {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.difficulty-beginner {
    background: #dcfce7;
    color: #166534;
}

.difficulty-intermediate {
    background: #fef3c7;
    color: #92400e;
}

.difficulty-advanced {
    background: #fee2e2;
    color: #991b1b;
}

.course-duration {
    color: #6b7280;
    font-size: 0.875rem;
}

.course-progress {
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 0.5rem;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #1e40af 100%);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.course-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-continue {
    flex: 1;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .btn-continue {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }
}

.btn-continue:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-preview {
    background: #f8fafc;
    color: #374151;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .btn-preview {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }
}

.btn-preview:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* Todo List Widget */
.todo-widget {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    .todo-widget {
        padding: 1rem;
        border-radius: 0.75rem;
    }
}

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

.todo-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

@media (max-width: 768px) {
    .todo-title {
        font-size: 1rem;
    }
}

.todo-add-btn {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (max-width: 768px) {
    .todo-add-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
}

.todo-add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.todo-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.todo-item:hover {
    background: #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.todo-checkbox {
    width: 1rem;
    height: 1rem;
    accent-color: #3b82f6;
    cursor: pointer;
}

.todo-text {
    flex: 1;
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .todo-text {
        font-size: 0.8125rem;
    }
}

.todo-text.completed {
    text-decoration: line-through;
    color: #9ca3af;
}

.todo-priority {
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.priority-high {
    background: #fee2e2;
    color: #991b1b;
}

.priority-medium {
    background: #fef3c7;
    color: #92400e;
}

.priority-low {
    background: #dcfce7;
    color: #166534;
}

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

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    text-align: center;
}

@media (max-width: 768px) {
    .stat-card {
        padding: 1rem;
        border-radius: 0.75rem;
    }
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .stat-number {
        font-size: 1.5rem;
    }
}

.stat-label {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .stat-label {
        font-size: 0.75rem;
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    .platform-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .platform-nav-links {
        gap: 1rem;
    }
    
    .course-actions {
        flex-direction: column;
    }
    
    .btn-preview {
        order: -1;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .platform-header,
    .todo-widget,
    .course-actions {
        display: none !important;
    }
    
    .dashboard-container {
        grid-template-columns: 1fr !important;
    }
    
    .main-content {
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .course-card,
    .todo-widget,
    .stat-card,
    .main-content {
        border: 2px solid #000 !important;
    }
    
    .btn-continue,
    .todo-add-btn {
        border: 2px solid #000 !important;
    }
}

/* Dark Mode Support (for future implementation) */
@media (prefers-color-scheme: dark) {
    .learning-platform {
        background-color: #0f172a;
        color: #f1f5f9;
    }
    
    .main-content,
    .course-card,
    .todo-widget,
    .stat-card {
        background: #1e293b;
        border-color: #334155;
        color: #f1f5f9;
    }
    
    .course-title,
    .todo-title,
    .stat-number {
        color: #f1f5f9;
    }
    
    .course-description,
    .todo-text,
    .stat-label {
        color: #cbd5e1;
    }
}