* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Cairo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* iPhone 16 Pro Max Mockup */
.device-container {
    perspective: 1000px;
}

.iphone-mockup {
    width: 430px;
    height: 932px;
    background: #1a1a1a;
    border-radius: 55px;
    padding: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    position: relative;
}

.notch {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 35px;
    background: #1a1a1a;
    border-radius: 0 0 20px 20px;
    z-index: 10;
}

.screen {
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 45px;
    overflow: hidden;
    position: relative;
}

/* App Container */
.app-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.screen-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    transition: transform 0.3s ease;
}

.screen-view.hidden {
    transform: translateX(100%);
    pointer-events: none;
}

[dir="rtl"] .screen-view.hidden {
    transform: translateX(-100%);
}

/* Splash Screen */
#splash-screen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.splash-content {
    text-align: center;
    color: white;
}

.app-logo {
    margin-bottom: 30px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.app-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
}

.app-subtitle {
    font-size: 18px;
    opacity: 0.9;
}

.app-location {
    font-size: 16px;
    margin-top: 10px;
    opacity: 0.85;
}

/* Login Screen */
.login-container {
    padding: 60px 30px 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.login-header {
    text-align: center;
    margin-bottom: 50px;
}

.login-header h2 {
    font-size: 32px;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 16px;
    color: #666;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
    background: #f9fafb;
}

.form-input:focus {
    outline: none;
    border-color: #4F46E5;
    background: white;
}

.btn-primary {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 10px;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    background: #f3f4f6;
    color: #4F46E5;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:active {
    transform: scale(0.98);
}

.forgot-password {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #4F46E5;
    text-decoration: none;
    font-size: 14px;
}

/* Role Selection */
.role-container {
    padding: 60px 30px 30px;
    height: 100%;
}

.screen-title {
    font-size: 28px;
    text-align: center;
    margin-bottom: 40px;
    color: #1a1a1a;
}

.role-card {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid transparent;
}

.role-card:active {
    transform: scale(0.98);
    border-color: #4F46E5;
}

.role-icon {
    margin-bottom: 20px;
}

.role-card h3 {
    font-size: 24px;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.role-card p {
    font-size: 16px;
    color: #666;
}

/* Header */
.header {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    padding: 50px 20px 20px;
    color: white;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title h2 {
    font-size: 24px;
    margin-bottom: 4px;
}

.header-title p {
    font-size: 14px;
    opacity: 0.9;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

/* Content */
.content {
    padding: 20px;
    height: calc(100% - 170px);
    overflow-y: auto;
    padding-bottom: 100px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.stats-grid-admin {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #4F46E5;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.stat-label-en {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Section */
.section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 15px;
}

/* Order List */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.order-item:active {
    border-color: #4F46E5;
}

.order-customer {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.order-customer-en {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.order-time {
    font-size: 12px;
    color: #999;
}

.order-status {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-completed {
    background: #D1FAE5;
    color: #065F46;
}

/* Bottom Navigation */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-around;
    padding: 10px 0 25px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 8px 12px;
    transition: all 0.2s;
    position: relative;
}

.nav-item.active {
    color: #4F46E5;
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
}

.fab-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    margin-top: -20px;
}

/* Customer List */
.search-bar {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    background: #f9fafb;
}

.search-input:focus {
    outline: none;
    border-color: #4F46E5;
    background: white;
}

.customer-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.customer-card {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.customer-card:active {
    border-color: #4F46E5;
}

.customer-avatar {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.customer-info {
    flex: 1;
}

.customer-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.customer-name-en {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.customer-address {
    font-size: 12px;
    color: #999;
}

.customer-stats {
    text-align: center;
}

.stat-small {
    font-size: 13px;
    font-weight: 600;
    color: #4F46E5;
    background: #EEF2FF;
    padding: 6px 12px;
    border-radius: 8px;
}

/* Product List */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.product-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-info {
    flex: 1;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.product-name-en {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.product-price {
    font-size: 14px;
    color: #4F46E5;
    font-weight: 600;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #4F46E5;
    color: white;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-input {
    width: 50px;
    text-align: center;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px;
    font-size: 16px;
    font-weight: 600;
}

/* Order Summary */
.order-summary {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 15px;
    color: #666;
}

.summary-row.total {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    padding-top: 12px;
    border-top: 2px solid #e5e7eb;
    margin-bottom: 0;
}

/* Admin Dashboard */
.rep-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.rep-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rep-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rep-avatar {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.rep-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.rep-name-en {
    font-size: 13px;
    color: #666;
}

.rep-stats {
    text-align: right;
}

[dir="rtl"] .rep-stats {
    text-align: left;
}

.rep-orders {
    font-size: 13px;
    font-weight: 600;
    color: #4F46E5;
    margin-bottom: 4px;
}

.rep-sales {
    font-size: 14px;
    font-weight: 700;
    color: #10B981;
}

.admin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.action-card {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    border: 3px solid transparent;
}

.action-card:active {
    transform: scale(0.98);
    border-color: #4F46E5;
}

.action-card svg {
    color: #4F46E5;
    margin-bottom: 12px;
}

.action-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.action-title-en {
    font-size: 12px;
    color: #666;
}

/* Scrollbar */
.content::-webkit-scrollbar {
    width: 6px;
}

.content::-webkit-scrollbar-track {
    background: transparent;
}

.content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .iphone-mockup {
        width: 100%;
        max-width: 430px;
        height: auto;
        aspect-ratio: 430 / 932;
    }
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .header-top {
    flex-direction: row-reverse;
}

[dir="rtl"] .customer-card,
[dir="rtl"] .order-item,
[dir="rtl"] .rep-item,
[dir="rtl"] .product-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .rep-info {
    flex-direction: row-reverse;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen-view {
    animation: slideIn 0.3s ease;
}
