/*
Theme Name: Salem World
Theme URI: https://salemworld.com
Author: Salem World Team
Author URI: https://salemworld.com
Description: موقع طبي متكامل للاستشارات والحجوزات الطبية - A comprehensive medical consultation and booking platform
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: salem-world
Tags: rtl-language-support, translation-ready, custom-logo, custom-menu, featured-images
*/

/* === CSS Variables === */
:root {
    --sw-primary: #7C3AED;
    --sw-primary-light: #A78BFA;
    --sw-primary-dark: #5B21B6;
    --sw-secondary: #8B5CF6;
    --sw-accent: #C4B5FD;
    --sw-background: #FAFAFA;
    --sw-surface: #FFFFFF;
    --sw-text: #1F2937;
    --sw-text-light: #6B7280;
    --sw-border: #E5E7EB;
    --sw-success: #10B981;
    --sw-warning: #F59E0B;
    --sw-error: #EF4444;
    --sw-info: #3B82F6;
    --sw-radius: 8px;
    --sw-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --sw-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --sw-transition: all 0.3s ease;
}

/* === Reset & Base === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--sw-text);
    background-color: var(--sw-background);
    direction: rtl;
}

body.ltr {
    direction: ltr;
}

a {
    color: var(--sw-primary);
    text-decoration: none;
    transition: var(--sw-transition);
}

a:hover {
    color: var(--sw-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5em;
    color: var(--sw-text);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

/* === Layout === */
.sw-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.sw-section {
    padding: 4rem 0;
}

.sw-grid {
    display: grid;
    gap: 1.5rem;
}

.sw-grid-2 { grid-template-columns: repeat(2, 1fr); }
.sw-grid-3 { grid-template-columns: repeat(3, 1fr); }
.sw-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .sw-grid-3, .sw-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
    .sw-grid-2, .sw-grid-3, .sw-grid-4 { grid-template-columns: 1fr; }
}

/* === Header === */
.sw-header {
    background: var(--sw-surface);
    box-shadow: var(--sw-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.sw-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.sw-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sw-logo img {
    height: 50px;
    width: auto;
}

.sw-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sw-primary);
}

/* === Navigation === */
.sw-nav ul {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.sw-nav a {
    color: var(--sw-text);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.sw-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--sw-primary);
    transition: var(--sw-transition);
}

body.ltr .sw-nav a::after {
    right: auto;
    left: 0;
}

.sw-nav a:hover::after,
.sw-nav a.current::after {
    width: 100%;
}

.sw-mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--sw-text);
    cursor: pointer;
}

@media (max-width: 768px) {
    .sw-mobile-toggle {
        display: block;
    }
    
    .sw-nav {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 70px);
        background: var(--sw-surface);
        box-shadow: var(--sw-shadow-lg);
        padding: 2rem;
        transition: var(--sw-transition);
    }
    
    body.ltr .sw-nav {
        right: auto;
        left: -100%;
    }
    
    .sw-nav.active {
        right: 0;
    }
    
    body.ltr .sw-nav.active {
        right: auto;
        left: 0;
    }
    
    .sw-nav ul {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* === Buttons === */
.sw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--sw-radius);
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--sw-transition);
    text-align: center;
}

.sw-btn-primary {
    background: var(--sw-primary);
    color: #fff;
}

.sw-btn-primary:hover {
    background: var(--sw-primary-dark);
    color: #fff;
}

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

.sw-btn-secondary:hover {
    background: var(--sw-primary);
    color: #fff;
}

.sw-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.sw-btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* === Cards === */
.sw-card {
    background: var(--sw-surface);
    border-radius: var(--sw-radius);
    box-shadow: var(--sw-shadow);
    overflow: hidden;
    transition: var(--sw-transition);
}

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

.sw-card-image {
    aspect-ratio: 4/3;
    overflow: hidden;
}

.sw-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sw-card-body {
    padding: 1.5rem;
}

.sw-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.sw-card-text {
    color: var(--sw-text-light);
    margin-bottom: 1rem;
}

/* === Doctor Cards === */
.sw-doctor-card {
    text-align: center;
}

.sw-doctor-card .sw-card-image {
    aspect-ratio: 1;
    border-radius: 50%;
    width: 150px;
    height: 150px;
    margin: 1.5rem auto 0;
}

.sw-doctor-specialization {
    display: inline-block;
    background: var(--sw-accent);
    color: var(--sw-primary-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.sw-doctor-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--sw-primary);
}

/* === Forms === */
.sw-form-group {
    margin-bottom: 1.5rem;
}

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

.sw-form-input,
.sw-form-select,
.sw-form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--sw-surface);
    color: var(--sw-text);
    transition: var(--sw-transition);
}

.sw-form-input:focus,
.sw-form-select:focus,
.sw-form-textarea:focus {
    outline: none;
    border-color: var(--sw-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.sw-form-textarea {
    min-height: 120px;
    resize: vertical;
}

.sw-form-error {
    color: var(--sw-error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* === Booking System === */
.sw-booking-calendar {
    background: var(--sw-surface);
    border-radius: var(--sw-radius);
    padding: 1.5rem;
    box-shadow: var(--sw-shadow);
}

.sw-time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.sw-time-slot {
    padding: 0.75rem;
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius);
    text-align: center;
    cursor: pointer;
    transition: var(--sw-transition);
}

.sw-time-slot:hover {
    border-color: var(--sw-primary);
    background: rgba(124, 58, 237, 0.05);
}

.sw-time-slot.selected {
    background: var(--sw-primary);
    color: #fff;
    border-color: var(--sw-primary);
}

.sw-time-slot.unavailable {
    background: var(--sw-border);
    color: var(--sw-text-light);
    cursor: not-allowed;
    opacity: 0.5;
}

/* === Hero Section === */
.sw-hero {
    background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-secondary) 100%);
    color: #fff;
    padding: 6rem 0;
    text-align: center;
}

.sw-hero h1 {
    color: #fff;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.sw-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* === Footer === */
.sw-footer {
    background: var(--sw-text);
    color: #fff;
    padding: 4rem 0 2rem;
}

.sw-footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

@media (max-width: 768px) {
    .sw-footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .sw-footer-grid {
        grid-template-columns: 1fr;
    }
}

.sw-footer h4 {
    color: #fff;
    margin-bottom: 1rem;
}

.sw-footer a {
    color: rgba(255, 255, 255, 0.7);
}

.sw-footer a:hover {
    color: #fff;
}

.sw-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 3rem;
    padding-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* === Alerts === */
.sw-alert {
    padding: 1rem 1.5rem;
    border-radius: var(--sw-radius);
    margin-bottom: 1rem;
}

.sw-alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--sw-success);
    color: var(--sw-success);
}

.sw-alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--sw-error);
    color: var(--sw-error);
}

.sw-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--sw-warning);
    color: var(--sw-warning);
}

.sw-alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--sw-info);
    color: var(--sw-info);
}

/* === Cookie Consent === */
.sw-cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--sw-surface);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    z-index: 9999;
    display: none;
}

.sw-cookie-consent.active {
    display: block;
}

.sw-cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

/* === My Library === */
.sw-library-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--sw-border);
}

.sw-library-item:last-child {
    border-bottom: none;
}

.sw-library-thumbnail {
    width: 120px;
    flex-shrink: 0;
}

.sw-library-info {
    flex: 1;
}

/* === Pagination === */
.sw-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.sw-pagination a,
.sw-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--sw-radius);
    border: 1px solid var(--sw-border);
    color: var(--sw-text);
}

.sw-pagination a:hover {
    border-color: var(--sw-primary);
    color: var(--sw-primary);
}

.sw-pagination .current {
    background: var(--sw-primary);
    border-color: var(--sw-primary);
    color: #fff;
}

/* === Utilities === */
.sw-text-center { text-align: center; }
.sw-text-right { text-align: right; }
.sw-text-left { text-align: left; }

.sw-mt-1 { margin-top: 0.5rem; }
.sw-mt-2 { margin-top: 1rem; }
.sw-mt-3 { margin-top: 1.5rem; }
.sw-mt-4 { margin-top: 2rem; }

.sw-mb-1 { margin-bottom: 0.5rem; }
.sw-mb-2 { margin-bottom: 1rem; }
.sw-mb-3 { margin-bottom: 1.5rem; }
.sw-mb-4 { margin-bottom: 2rem; }

.sw-hidden { display: none; }
.sw-visible { display: block; }

/* === Authentication Pages === */
.sw-auth-section {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--sw-primary-light) 0%, var(--sw-primary) 100%);
}

.sw-auth-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.sw-auth-card {
    background: var(--sw-surface);
    border-radius: var(--sw-radius);
    box-shadow: var(--sw-shadow-lg);
}

.sw-auth-card .sw-card-body {
    padding: 2.5rem;
}

.sw-auth-header h1 {
    font-size: 1.75rem;
    color: var(--sw-text);
    margin-bottom: 0.5rem;
}

.sw-auth-header p {
    color: var(--sw-text-light);
    margin-bottom: 0;
}

.sw-auth-form .sw-form-group {
    margin-bottom: 1.25rem;
}

.sw-auth-form .sw-form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--sw-text);
}

.sw-auth-form .sw-form-label .required {
    color: var(--sw-error);
}

.sw-auth-form .sw-form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--sw-transition);
}

.sw-auth-form .sw-form-input:focus {
    outline: none;
    border-color: var(--sw-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.sw-auth-form .sw-form-hint {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--sw-text-light);
}

.sw-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.sw-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.sw-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--sw-text);
}

.sw-checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--sw-primary);
}

.sw-link {
    color: var(--sw-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--sw-transition);
}

.sw-link:hover {
    color: var(--sw-primary-dark);
    text-decoration: underline;
}

.sw-link-primary {
    font-weight: 600;
}

.sw-btn-block {
    display: block;
    width: 100%;
}

.sw-auth-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--sw-border);
}

.sw-auth-footer p {
    color: var(--sw-text-light);
    margin-bottom: 0;
}

/* Alerts */
.sw-alert {
    padding: 1rem;
    border-radius: var(--sw-radius);
    font-size: 0.875rem;
}

.sw-alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--sw-error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.sw-alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--sw-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.sw-alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--sw-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.sw-alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--sw-info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Auth Required Block */
.sw-auth-required {
    border: 2px dashed var(--sw-border);
    background: var(--sw-surface);
}

.sw-auth-required h3 {
    color: var(--sw-primary);
    margin-bottom: 0.5rem;
}

.sw-auth-required p {
    color: var(--sw-text-light);
    margin-bottom: 1rem;
}

/* Responsive Auth */
@media (max-width: 576px) {
    .sw-auth-card .sw-card-body {
        padding: 1.5rem;
    }
    
    .sw-form-row-2 {
        grid-template-columns: 1fr;
    }
    
    .sw-form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
}

/* === RTL Specific === */
[dir="rtl"] .sw-card-body,
[dir="rtl"] .sw-form-label {
    text-align: right;
}

/* === Print Styles === */
@media print {
    .sw-header,
    .sw-footer,
    .sw-cookie-consent,
    .sw-btn {
        display: none !important;
    }
}
