:root {
    /* ألوان محسّنة وجذابة */
    --primary-color: #16a085;
    --primary-dark: #117964;
    --primary-light: #1abc9c;
    --secondary-color: #f39c12;
    --secondary-dark: #d68910;
    --accent-color: #e74c3c;

    /* ألوان إضافية */
    --success: #27ae60;
    --info: #3498db;
    --warning: #f39c12;
    --danger: #e74c3c;

    /* Colors Neutral */
    --background-color: #f8f9fa;
    --background-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --text-muted: #95a5a6;
    --light-gray: #ecf0f1;
    --border-color: #dee2e6;

    /* تأثيرات */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 6px 20px rgba(22, 160, 133, 0.15);

    /* Border Radius */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Tajawal', 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    background: var(--card-bg);
    min-height: 100vh;
    box-shadow: var(--shadow-lg);
    position: relative;
}

/* Enhanced Header with Gradient */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 24px 20px;
    text-align: center;
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(22, 160, 133, 0.2);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 8s ease-in-out infinite;
}

@keyframes shimmer {

    0%,
    100% {
        transform: translate(-25%, -25%);
    }

    50% {
        transform: translate(0%, 0%);
    }
}

header h1 {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-size: 1.6rem;
    margin-bottom: 5px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header p {
    opacity: 0.95;
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

/* Enhanced Forms */
.form-group {
    margin-bottom: 18px;
    padding: 0 20px;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius);
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--primary-light);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(22, 160, 133, 0.1);
    transform: translateY(-2px);
}

/* Modern Button Styles */
button.btn-primary,
.btn-primary {
    width: calc(100% - 40px);
    margin: 20px;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(22, 160, 133, 0.3);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

button.btn-primary::before,
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button.btn-primary:hover::before,
.btn-primary:hover::before {
    left: 100%;
}

button.btn-primary:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

button.btn-primary:active,
.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-secondary {
    display: block;
    width: calc(100% - 40px);
    margin: 10px 20px;
    padding: 16px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

.btn-secondary:active {
    transform: scale(0.98);
}

/* Card Enhancements */
.card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.badge:hover {
    transform: scale(1.05);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 90%;
    max-width: 400px;
}

.toast {
    background: white;
    color: var(--text-color);
    padding: 16px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(-20px);
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-right: 4px solid var(--success);
}

.toast-error {
    border-right: 4px solid var(--danger);
}

.toast-info {
    border-right: 4px solid var(--info);
}

.toast i {
    font-size: 1.3rem;
}

.toast-success i {
    color: var(--success);
}

.toast-error i {
    color: var(--danger);
}

.toast-info i {
    color: var(--info);
}

/* Chat Styles Enhanced */
.message {
    margin-bottom: 12px;
    max-width: 75%;
    clear: both;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message-me {
    float: left;
    text-align: left;
}

.message-other {
    float: right;
    text-align: right;
}

.message-content {
    padding: 12px 16px;
    border-radius: var(--radius);
    display: inline-block;
    word-wrap: break-word;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.message-content:hover {
    box-shadow: var(--shadow);
}

.message-me .message-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-bottom-left-radius: 4px;
}

.message-other .message-content {
    background: white;
    color: var(--text-color);
    border-bottom-right-radius: 4px;
    border: 1px solid var(--border-color);
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Notification Cards */
.notification-card {
    background: white;
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    border-right: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.notification-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateX(-3px);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: var(--primary-light);
    color: white;
}

/* Placeholder Styles */
::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Focus Visible (Accessibility) */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

/* Responsive */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.4rem;
    }

    button.btn-primary,
    .btn-primary,
    .btn-secondary {
        font-size: 1rem;
        padding: 14px;
    }
}