/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

/* Global Styles */
:root {
    /* Brand Colors */
    --brand-purple: #6736FF;
    --brand-indigo: #3D5DFB;
    --brand-cyan: #00B9D9;
    --accent-amber: #FFA726;
    
    /* Ink Colors */
    --ink-dark: #0F2D46;
    --ink-light: #E8EEF4;
    
    /* Surface Colors */
    --surface-default: #F8FAFC;
    --surface-inverse: #0A1522;
    
    /* State Colors */
    --success-color: #00D36C;
    --error-color: #E53935;
    --warning-color: #FFA726;
    --info-color: #3D5DFB;
    
    /* Overlay */
    --overlay-glass: rgba(255,255,255,0.2);
    
    /* Gradients */
    --gradient-primary: linear-gradient(45deg, #6736FF 0%, #3D5DFB 50%, #00B9D9 100%);
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15,45,70,0.05);
    --shadow-sm: 0 1px 3px rgba(15,45,70,0.1);
    --shadow-md: 0 4px 6px rgba(15,45,70,0.1);
    --shadow-lg: 0 10px 15px rgba(15,45,70,0.15);
    --shadow-xl: 0 20px 25px rgba(15,45,70,0.2);
    
    /* Spacing */
    --space-0: 0px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
    --space-9: 36px;
    --space-10: 40px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms;
    --transition-normal: 300ms;
    --transition-slow: 500ms;
    --timing-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --timing-decelerate: cubic-bezier(0, 0, 0.2, 1);
    --timing-accelerate: cubic-bezier(0.4, 0, 1, 1);
    
    /* Legacy mappings for compatibility */
    --primary-color: var(--brand-purple);
    --secondary-color: var(--brand-indigo);
    --danger-color: var(--error-color);
    --light-bg: var(--surface-default);
    --dark-text: var(--ink-dark);
    --border-color: var(--ink-light);
    --shadow: var(--shadow-md);
}

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

body {
    font-family: 'Tajawal', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--surface-default);
    color: var(--ink-dark);
    line-height: 1.6;
    direction: rtl;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-5);
}

/* Mobile Container */
.mobile-container {
    max-width: 375px;
    margin: 0 auto;
    background-color: white;
    min-height: 667px;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

/* Header Styles */
header {
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-5);
    text-align: center;
    margin-bottom: var(--space-7);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.logo {
    width: 120px;
    height: auto;
    margin-bottom: var(--space-4);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Login Logo */
.login-logo-container {
    text-align: center;
    margin: var(--space-10) 0;
}

.login-logo {
    width: 100px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

header h1 {
    font-size: 30px;
    line-height: 38px;
    font-weight: 700;
    margin-bottom: var(--space-3);
}

header p {
    font-size: 16px;
    line-height: 24px;
    opacity: 0.9;
}

/* Navigation */
.main-nav {
    background-color: white;
    padding: var(--space-5);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-7);
}

.main-nav h2 {
    color: var(--brand-purple);
    margin-bottom: var(--space-5);
    font-size: 24px;
    line-height: 32px;
    font-weight: 600;
}

.main-nav ul {
    list-style: none;
}

.main-nav li {
    margin-bottom: var(--space-3);
}

.main-nav a {
    color: var(--ink-dark);
    text-decoration: none;
    display: block;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal) var(--timing-standard);
}

.main-nav a:hover {
    background-color: var(--surface-default);
    color: var(--brand-indigo);
    transform: translateX(-4px);
    box-shadow: var(--shadow-sm);
}

/* Flow Diagram */
.flow-diagram {
    background-color: white;
    padding: var(--space-5);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.flow-diagram h2 {
    color: var(--brand-purple);
    margin-bottom: var(--space-5);
    font-size: 24px;
    line-height: 32px;
    font-weight: 600;
}

.flow-description p {
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 20px;
    margin-bottom: 10px;
}

.flow-description ol {
    margin-right: 20px;
}

.flow-description li {
    margin-bottom: 8px;
}

/* Mobile Header */
.mobile-header {
    background-color: white;
    padding: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--ink-light);
    box-shadow: var(--shadow-xs);
}

.mobile-header-logo {
    width: 40px;
    height: auto;
}

.menu-icon {
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    cursor: pointer;
}

.menu-icon span {
    width: 100%;
    height: 3px;
    background-color: var(--dark-text);
    transition: all 0.3s ease;
}

.notification-icon {
    width: 30px;
    height: 30px;
    position: relative;
    cursor: pointer;
}

.notification-icon::before {
    content: '🔔';
    font-size: 24px;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger-color);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Content Area */
.content {
    padding: 20px;
    min-height: calc(100vh - 60px);
}

/* Forms */
.form-container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    font-family: 'Cairo', sans-serif;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    font-family: 'Cairo', sans-serif;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

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

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
}

.btn-outline:hover {
    background-color: var(--secondary-color);
    color: white;
}

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

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Splash Screen */
.splash-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--gradient-primary);
    color: white;
}

.logo-container {
    margin-bottom: var(--space-5);
    text-align: center;
}

.splash-logo {
    width: 150px;
    height: auto;
    margin-bottom: var(--space-5);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
    animation: fadeInScale 1s ease-out;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-dots {
    display: flex;
    gap: var(--space-3);
}

.dot {
    width: 12px;
    height: 12px;
    background-color: white;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Service Grid */
.service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.service-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.service-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.service-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

/* Search Bar */
.search-container {
    position: relative;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 16px;
}

.search-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--brand-indigo);
    font-size: 20px;
}

.search-input:focus {
    outline: none;
    border-color: var(--brand-indigo);
    box-shadow: 0 0 0 3px rgba(61, 93, 251, 0.1);
}

/* Profile Section */
.profile-section {
    text-align: center;
    padding: 20px;
}

.profile-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: var(--light-bg);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
}

/* Service List */
.service-list {
    margin-top: 20px;
}

.service-item {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.service-info h3 {
    margin-bottom: 5px;
}

.service-info p {
    color: #7f8c8d;
    font-size: 14px;
}

/* Invoice Form */
.invoice-item {
    background-color: var(--surface-default);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    border: 1px solid var(--ink-light);
}

.add-item-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 2px dashed var(--ink-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal) var(--timing-standard);
}

.add-item-btn:hover {
    border-color: var(--brand-indigo);
    color: var(--brand-indigo);
    background-color: rgba(61, 93, 251, 0.05);
}

/* Payment Options */
.payment-options {
    margin-top: var(--space-5);
}

.payment-option {
    display: flex;
    align-items: center;
    padding: var(--space-4);
    border: 1px solid var(--ink-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    cursor: pointer;
    transition: all var(--transition-normal) var(--timing-standard);
    box-shadow: var(--shadow-xs);
}

.payment-option:hover {
    border-color: var(--brand-indigo);
    background-color: rgba(61, 93, 251, 0.05);
    box-shadow: var(--shadow-sm);
}

.payment-option input[type="radio"] {
    margin-left: var(--space-3);
    accent-color: var(--brand-indigo);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--ink-light);
    border-radius: var(--radius-lg);
    padding: var(--space-10);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal) var(--timing-standard);
    background-color: var(--surface-default);
}

.upload-area:hover {
    border-color: var(--brand-indigo);
    background-color: rgba(61, 93, 251, 0.05);
    box-shadow: var(--shadow-sm) inset;
}

.upload-icon {
    font-size: 36px;
    color: var(--brand-indigo);
    margin-bottom: var(--space-3);
    opacity: 0.6;
}

/* Status Messages */
.status-message {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-5);
    text-align: center;
    font-weight: 500;
}

.status-success {
    background-color: rgba(0, 211, 108, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.status-pending {
    background-color: rgba(255, 167, 38, 0.1);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    margin: var(--space-5) 0;
}

.checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-left: var(--space-3);
    accent-color: var(--brand-indigo);
    cursor: pointer;
}

/* Link Styles */
.link {
    color: var(--brand-indigo);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast) var(--timing-standard);
}

.link:hover {
    text-decoration: underline;
    color: var(--brand-purple);
}

/* Notifications */
.notification {
    position: fixed;
    top: var(--space-5);
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background-color: white;
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    transition: transform var(--transition-normal) var(--timing-decelerate);
    min-width: 250px;
    text-align: center;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
}

.notification-info {
    border-right: 4px solid var(--info-color);
    color: var(--info-color);
}

.notification-success {
    border-right: 4px solid var(--success-color);
    color: var(--success-color);
}

.notification-error {
    border-right: 4px solid var(--error-color);
    color: var(--error-color);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(10, 21, 34, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: var(--brand-cyan);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-5);
    box-shadow: var(--shadow-md);
}

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

/* Error State */
input.error,
select.error,
textarea.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}

/* Selected State */
.payment-option.selected {
    border-color: var(--brand-indigo);
    background-color: rgba(61, 93, 251, 0.1);
    box-shadow: var(--shadow-md);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: var(--space-3);
    }
    
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .service-grid {
        grid-template-columns: 1fr;
    }
}

/* Additional Modern Touches */
.glass-effect {
    background: var(--overlay-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gradient Text Effect */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card Hover Effects */
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Focus Visible for Better Accessibility */
*:focus-visible {
    outline: 2px solid var(--brand-indigo);
    outline-offset: 2px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-default);
}

::-webkit-scrollbar-thumb {
    background: var(--ink-light);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-indigo);
}

/* Animated Gradient Background */
.gradient-bg {
    background: var(--gradient-primary);
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}