/**
 * Wafeeq Platform - UI/UX Improvements
 * تحسينات واجهة المستخدم
 * Version: 1.0
 */

/* ==========================================
   GLOBAL IMPROVEMENTS
   ========================================== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Better focus states for accessibility */
*:focus {
    outline: 2px solid #683795;
    outline-offset: 2px;
}

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #683795;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(104, 55, 149, 0.2);
}

/* Improve text selection */
::selection {
    background-color: #683795;
    color: #fff;
}

::-moz-selection {
    background-color: #683795;
    color: #fff;
}

/* ==========================================
   BUTTONS IMPROVEMENTS
   ========================================== */

.btn {
    transition: all 0.3s ease;
    border-radius: 8px;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

/* Primary button */
.btn-primary,
.-register {
    background: linear-gradient(135deg, #ef8022 0%, #d97319 100%);
    border: none;
    color: #fff;
    padding: 10px 25px;
}

.btn-primary:hover,
.-register:hover {
    background: linear-gradient(135deg, #d97319 0%, #c56615 100%);
    box-shadow: 0 4px 15px rgba(239, 128, 34, 0.4);
}

/* Secondary button */
.btn-secondary {
    background: linear-gradient(135deg, #683795 0%, #4a2569 100%);
    border: none;
    color: #fff;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4a2569 0%, #3a1d53 100%);
    box-shadow: 0 4px 15px rgba(104, 55, 149, 0.4);
}

/* ==========================================
   FORM IMPROVEMENTS
   ========================================== */

.form-control {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #683795;
    box-shadow: 0 0 0 3px rgba(104, 55, 149, 0.1);
}

.form-control:hover:not(:focus) {
    border-color: #b0b0b0;
}

/* Placeholder styling */
.form-control::placeholder {
    color: #999;
    opacity: 0.8;
}

/* Input groups */
.input-group {
    border-radius: 10px;
    overflow: hidden;
}

/* ==========================================
   CARDS IMPROVEMENTS
   ========================================== */

.card,
.course-card,
.team-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover,
.course-card:hover,
.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-img-top {
    transition: transform 0.3s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

/* ==========================================
   NAVIGATION IMPROVEMENTS
   ========================================== */

.navbar {
    transition: all 0.3s ease;
}

.navbar.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.98) !important;
}

.navbar-nav .nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #683795;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 80%;
}

/* Mobile menu improvements */
@media (max-width: 991px) {
    .navbar-collapse {
        background-color: #fff;
        padding: 20px;
        border-radius: 15px;
        box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
        margin-top: 15px;
    }
    
    .navbar-nav .nav-link {
        padding: 12px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
}

/* ==========================================
   LOADING STATES
   ========================================== */

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f0f0f0;
    border-top-color: #683795;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==========================================
   ALERTS & NOTIFICATIONS
   ========================================== */

.alert {
    border: none;
    border-radius: 12px;
    padding: 15px 20px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background-color: #e8d8f0;
    color: #4d267c;
    border-right: 4px solid #4d267c;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-right: 4px solid #c9104c;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-right: 4px solid #ffc107;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-right: 4px solid #17a2b8;
}

/* ==========================================
   COURSE CARDS SPECIFIC
   ========================================== */

.course-price {
    font-size: 1.2em;
    font-weight: 700;
    color: #ef8022;
}

.course-price .old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.8em;
    margin-right: 8px;
}

.course-rating {
    color: #ffc107;
}

.course-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ef8022, #d97319);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ==========================================
   VIDEO PLAYER IMPROVEMENTS
   ========================================== */

.video-container {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
}

.video-container iframe {
    border-radius: 15px;
}

/* ==========================================
   FOOTER IMPROVEMENTS
   ========================================== */

footer {
    background: linear-gradient(180deg, #f8f8f8 0%, #f0f0f0 100%);
}

footer a {
    transition: color 0.3s ease;
}

footer a:hover {
    color: #683795 !important;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin: 0 5px;
}

.social-links a:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    background-color: #683795;
    color: #fff !important;
}

/* ==========================================
   MOBILE IMPROVEMENTS
   ========================================== */

@media (max-width: 768px) {
    /* Better touch targets */
    .btn,
    .nav-link,
    a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Larger form inputs on mobile */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 16px;
    }
    
    /* Better spacing */
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    /* Hide scroll on body when mobile menu open */
    body.menu-open {
        overflow: hidden;
    }
    
    /* Course cards on mobile */
    .course-card {
        margin-bottom: 20px;
    }
    
    /* Section spacing */
    section {
        padding: 40px 0;
    }
    
    h1, .h1 {
        font-size: 1.8rem;
    }
    
    h2, .h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    /* Stack buttons on small screens */
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
    }
}

/* ==========================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================== */

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #683795;
    color: #fff;
    padding: 8px 16px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .form-control {
        border: 2px solid #000;
    }
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    header,
    footer,
    nav,
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
    
    .page-break {
        page-break-before: always;
    }
}

/* ==========================================
   DARK MODE SUPPORT (Optional)
   ========================================== */

@media (prefers-color-scheme: dark) {
    /* Uncomment if you want to support dark mode
    :root {
        --bg-color: #1a1a2e;
        --text-color: #f5f5f5;
        --card-bg: #16213e;
    }
    
    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .card {
        background-color: var(--card-bg);
    }
    */
}
