:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-foreground: #ffffff;
    --secondary: #f1f5f9;
    --secondary-hover: #e2e8f0;
    --secondary-foreground: #0f172a;
    --background: #ffffff;
    --foreground: #0f172a;
    --muted: #f1f5f9;
    --muted-foreground: #64748b;
    --border: #e2e8f0;
    --card: #ffffff;
    --card-foreground: #0f172a;
    --destructive: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --radius: 0.5rem;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body.dark {
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --background: #0f172a;
    --foreground: #f8fafc;
    --muted: #1e293b;
    --muted-foreground: #94a3b8;
    --border: #334155;
    --card: #1e293b;
    --card-foreground: #f8fafc;
    --secondary: #334155;
    --secondary-hover: #475569;
    --secondary-foreground: #f8fafc;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

[dir="rtl"] body {
    font-family: 'Cairo', sans-serif;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

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

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

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--foreground);
    text-decoration: none;
    border-radius: var(--radius);
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: var(--muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-name {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
}

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

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

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

.btn-outline:hover {
    background: var(--muted);
}

.btn-ghost {
    background: transparent;
    color: var(--foreground);
}

.btn-ghost:hover {
    background: var(--muted);
}

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

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

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

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

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

.hero .btn-primary:hover {
    background: #f1f5f9;
}

.hero .btn-outline {
    border-color: white;
    color: white;
}

.hero .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

.section {
    padding: 3rem 0;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
}

.categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

.category-btn {
    padding: 0.5rem 1rem;
    background: var(--muted);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--foreground);
    text-decoration: none;
    transition: all 0.2s;
}

.category-btn:hover,
.category-btn.active {
    background: var(--primary);
    color: white;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

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

.card-description {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.card-content {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

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

.processing-time {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-label .required {
    color: var(--destructive);
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.file-upload {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload:hover {
    border-color: var(--primary);
    background: var(--muted);
}

.file-upload input {
    display: none;
}

.file-upload-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--muted);
    border-radius: var(--radius);
}

.order-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .order-layout {
        grid-template-columns: 2fr 1fr;
    }
}

.order-summary {
    position: sticky;
    top: 5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-total {
    font-weight: 700;
    font-size: 1.25rem;
}

.success-page {
    text-align: center;
    padding: 4rem 0;
}

.success-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 1rem;
}

.tracking-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--muted);
    padding: 1rem 2rem;
    border-radius: var(--radius);
    display: inline-block;
    margin: 1rem 0;
}

.contact-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn-whatsapp {
    background: #25d366;
    color: white;
}

.btn-whatsapp:hover {
    background: #1ebe5a;
}

.btn-telegram {
    background: #0088cc;
    color: white;
}

.btn-telegram:hover {
    background: #0077b3;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th,
.orders-table td {
    padding: 1rem;
    text-align: start;
    border-bottom: 1px solid var(--border);
}

.orders-table th {
    font-weight: 600;
    background: var(--muted);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-processing {
    background: #dbeafe;
    color: #1e40af;
}

.status-completed {
    background: #dcfce7;
    color: #166534;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.auth-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-title {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--muted-foreground);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
}

.social-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    gap: 1rem;
}

.social-divider::before,
.social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.social-divider span {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.social-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-google {
    background: #ffffff;
    color: #444444;
    border: 1px solid var(--border);
}

.btn-google:hover {
    background: #f5f5f5;
}

.btn-google .icon-google {
    width: 20px;
    height: 20px;
    margin-left: 0.5rem;
}

[dir="rtl"] .btn-google .icon-google {
    margin-left: 0;
    margin-right: 0.5rem;
}

.telegram-login-container {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
}

.status-reviewed {
    background: #e0f2fe;
    color: #0369a1;
}

.status-payment_pending {
    background: #fef3c7;
    color: #92400e;
}

.status-finished {
    background: #dcfce7;
    color: #166534;
}

.status-shipped {
    background: #e0e7ff;
    color: #3730a3;
}

.status-delivered {
    background: #d1fae5;
    color: #065f46;
}

.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.footer {
    margin-top: auto;
    padding: 2rem 0;
    background: var(--muted);
    text-align: center;
    color: var(--muted-foreground);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--muted-foreground);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .orders-table {
        display: block;
        overflow-x: auto;
    }
}

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

.admin-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
}

.stat-card.stat-warning {
    border-color: var(--warning);
    border-width: 2px;
}

.stat-card.stat-info {
    border-color: #3b82f6;
    border-width: 2px;
}

.stat-card.stat-success {
    border-color: var(--success);
    border-width: 2px;
}

.stat-card.stat-primary {
    border-color: var(--primary);
    border-width: 2px;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--foreground);
}

.stat-label {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.order-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--muted-foreground);
    font-weight: 500;
}

.info-value {
    font-weight: 600;
}

.status-form .form-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.status-form .form-row .form-input {
    flex: 1;
    min-width: 150px;
}

.order-item-block {
    padding: 1rem;
    background: var(--muted);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.order-item-block:last-child {
    margin-bottom: 0;
}

.order-item-block h4 {
    margin-bottom: 0.5rem;
    color: var(--foreground);
}

.meta-data-list {
    margin-top: 1rem;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-top: 1px dashed var(--border);
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

[dir="rtl"] .timeline {
    padding-left: 0;
    padding-right: 2rem;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-badge {
    position: absolute;
    left: -2rem;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--muted);
    border: 2px solid var(--border);
}

[dir="rtl"] .timeline-badge {
    left: auto;
    right: -2rem;
}

.timeline-badge.badge-warning {
    background: var(--warning);
    border-color: var(--warning);
}

.timeline-badge.badge-info {
    background: #3b82f6;
    border-color: #3b82f6;
}

.timeline-badge.badge-success {
    background: var(--success);
    border-color: var(--success);
}

.timeline-badge.badge-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.timeline-content {
    background: var(--muted);
    padding: 1rem;
    border-radius: var(--radius);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.timeline-date {
    color: var(--muted-foreground);
    font-size: 0.75rem;
}

.timeline-note {
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.timeline-author {
    color: var(--muted-foreground);
    font-size: 0.75rem;
}

.filter-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-form .form-input {
    min-width: 150px;
}

.form-input-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--muted-foreground);
    background: var(--muted);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.filter-tab:hover {
    background: var(--secondary-hover);
}

.filter-tab.active {
    background: var(--primary);
    color: var(--primary-foreground);
}

.broadcast-info {
    background: var(--muted);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-checkbox input {
    width: 1.25rem;
    height: 1.25rem;
}

.form-hint {
    color: var(--muted-foreground);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}
