:root {
    --bg-dark: #0f111a;
    --bg-panel: #1a1d2d;
    --primary: #fe2c55;
    --text-main: #ffffff;
    --text-muted: #8b92a5;
    --border: #2a2e45;
    --success: #00e676;
    --danger: #ff1744;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden; /* لمنع التمرير العام */
}

/* --- Layout Structure --- */
.container {
    padding: 20px;
    padding-bottom: 80px; /* مساحة للبار السفلي */
    max-width: 600px;
    margin: 0 auto;
}

.page {
    display: none;
    height: 100%;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 20px;
}

.header h2 {
    margin: 0;
    font-size: 24px;
    background: linear-gradient(45deg, #fe2c55, #ff0050);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 5px;
}

/* --- Steps System --- */
.step-container {
    display: none;
    animation: slideIn 0.3s ease;
}

.step-container.active-step {
    display: block;
}

.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.step-header h3 {
    margin: 0;
    font-size: 18px;
}

.back-btn {
    background: var(--bg-panel);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Grid Menu (Platforms) --- */
.grid-menu {
    display: grid;
    grid-template-columns: 1fr 1fr; /* عمودين */
    gap: 15px;
}

.grid-item {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.grid-item:active {
    transform: scale(0.98);
}

.grid-item i {
    font-size: 32px;
    margin-bottom: 5px;
}

.grid-item span {
    font-weight: 600;
    font-size: 14px;
}

/* Disabled State */
.grid-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.8);
}

.badge-soon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #333;
    color: #fff;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
}

/* --- List Menu (Services) --- */
.list-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.icon-box {
    width: 40px;
    height: 40px;
    background: rgba(254, 44, 85, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 18px;
}

.text-box {
    flex: 1;
}

.text-box h4 {
    margin: 0;
    font-size: 15px;
}

.text-box p {
    margin: 3px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

.arrow {
    color: var(--text-muted);
    font-size: 14px;
}

/* --- Input Area --- */
.input-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    padding: 16px 16px 16px 45px;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    box-sizing: border-box; /* مهم جداً */
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary);
}

#submitBtn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#submitBtn:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* --- Orders Page --- */
.orders-container {
    padding-top: 20px;
}

.orders-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.refresh-icon-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 18px;
    cursor: pointer;
}

.order-card {
    background: var(--bg-panel);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    border-left: 4px solid #f1c40f; /* Default processing */
}

.status-Completed { border-left-color: var(--success); }
.status-Canceled { border-left-color: var(--danger); }

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
}

/* --- Bottom Nav --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #161925;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    width: 60px;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.nav-item.active {
    color: var(--primary);
}

/* --- Utils --- */
.hidden { display: none !important; }
.status {
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}
.status.error { background: rgba(255, 23, 68, 0.1); color: #ff1744; }
.status.success { background: rgba(0, 230, 118, 0.1); color: #00e676; }
.spinner {
    border: 3px solid rgba(255,255,255,0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fa-spin-fast { animation: spin 0.5s linear infinite; }