/* Global Dark Theme */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #16161d;
    --bg-card: #1e1e26;
    --bg-darker: #0f0f15;
    --bg-input: #0c0c12;
    --border: #2a2a35;
    --border-light: #3a3a52;
    --border-input: #3a3a52;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6a6a7a;
    --accent: #00d4ff;
    --accent-dark: #0099cc;
    --success: #00ff9d;
    --warning: #ffaa00;
    --error: #ff4757;
    --info: #5865f2;
    --shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    --shadow-light: 0 5px 15px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 12px;
    --input-height: 50px;
    --label-font-size: 14px;
    --input-font-size: 15px;
}

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

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    line-height: 1.5;
    font-size: 15px;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 212, 255, 0.05) 0%, transparent 50%);
}

/* Dark Container - More Compact */
.dark-container {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    width: 100%;
    max-width: 550px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
    backdrop-filter: blur(10px);
    margin: 10px auto;
}

/* Header - Compact */
.header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 25%;
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
    transition: var(--transition);
}

.logo-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-text h1 {
    font-size: 22px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent), #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 10px;
    font-weight: 800;
    color: var(--accent);
    background: rgba(0, 212, 255, 0.15);
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 1px;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

/* Form Sections - More Compact */
.form-section {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 15px;
    border: 1px solid var(--border-light);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent), transparent);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent);
}

.section-title i {
    color: var(--accent);
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.section-title h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Row Layout for Fields */
.row-fields {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    align-items: flex-start;
}

/* Form Groups - Compact */
.form-group {
    margin-bottom: 15px;
    position: relative;
}

.form-group.half-width {
    flex: 1;
    min-width: 0; /* يمنع تجاوز العناصر للحدود */
}

.form-group.date-field {
    flex: 1;
    min-width: 0;
}

.form-group.email-prefix {
    flex: 2;
    min-width: 0;
}

.form-group.email-domain {
    flex: 1;
    min-width: 0;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: var(--label-font-size);
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.3;
    white-space: nowrap;
}

.form-group label i {
    color: var(--accent);
    font-size: 14px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.required {
    color: var(--error);
    font-weight: bold;
    margin-left: 2px;
    font-size: 14px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    margin-left: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    line-height: 1.4;
}

/* Input Fields - Compact */
input, select, textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 2px solid var(--border-input);
    border-radius: 8px;
    font-size: var(--input-font-size);
    color: var(--text-primary);
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    height: var(--input-height);
    min-height: var(--input-height);
    line-height: 1.4;
}

input[type="password"],
input[type="text"]#emailPassword,
input[type="text"]#accountPassword {
    -webkit-text-security: none !important;
    text-security: none !important;
    letter-spacing: 0.5px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.25);
    background: var(--bg-darker);
    transform: translateY(-1px);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 400;
    opacity: 0.8;
}

/* Email At Symbol */
.email-at {
    color: var(--accent);
    font-weight: 700;
    font-size: 16px;
    align-self: flex-end;
    margin-bottom: 24px;
    padding: 0 5px;
}

/* Textarea */
textarea {
    resize: vertical;
    min-height: 60px;
    max-height: 100px;
    font-size: var(--input-font-size);
    line-height: 1.5;
    padding: 12px 14px;
}

/* Mode Toggle */
.mode-toggle-container {
    display: flex;
    justify-content: center;
    margin: 12px 0 18px;
}

#manualModeToggle {
    display: none;
}

.mode-toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px 16px;
    background: var(--bg-darker);
    border-radius: 10px;
    border: 2px solid var(--border);
    transition: var(--transition);
    min-width: 180px;
}

.toggle-track {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--bg-primary);
    border-radius: 20px;
    border: 2px solid var(--border);
    transition: var(--transition);
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#manualModeToggle:checked + .mode-toggle-label .toggle-thumb {
    transform: translateX(24px);
    background: var(--warning);
}

#manualModeToggle:checked + .mode-toggle-label .toggle-track {
    border-color: var(--warning);
}

.toggle-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.toggle-text i {
    color: var(--accent);
    font-size: 14px;
}

#manualModeToggle:checked + .mode-toggle-label .toggle-text i {
    color: var(--warning);
}

/* Buttons - Compact */
.action-buttons {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
    margin-top: 18px;
}

button {
    border: none;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 18px;
    height: 46px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    background: var(--bg-darker);
    border: 2px solid var(--border);
    color: var(--text-secondary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-primary);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* Processing Status - Compact */
.processing-status {
    background: var(--bg-darker);
    border-radius: 10px;
    padding: 15px;
    margin: 18px 0;
    border: 2px solid var(--border);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-icon {
    width: 40px;
    height: 40px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.status-text {
    flex: 1;
}

.status-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 3px;
    font-weight: 600;
}

.status-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Loading Indicator - Compact */
.loading-indicator {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 10px;
    border: 2px solid var(--border);
}

.loader {
    display: flex;
    gap: 6px;
    align-items: center;
    height: 20px;
}

.loader-bar {
    width: 4px;
    height: 20px;
    background: var(--accent);
    border-radius: 2px;
    animation: loader-wave 1.2s ease-in-out infinite;
}

@keyframes loader-wave {
    0%, 100% { height: 20px; }
    50% { height: 28px; }
}

.loading-indicator span {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

/* Footer - Compact */
.footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.footer-content i {
    color: var(--success);
    font-size: 12px;
}

.footer-separator {
    opacity: 0.5;
    font-weight: bold;
}

/* Notification - Compact */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    padding: 15px 18px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: none;
    z-index: 1000;
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 280px;
    max-width: 350px;
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--accent);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-icon {
    font-size: 18px;
}

.notification-text {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .dark-container {
        padding: 15px;
        max-width: 100%;
    }
    
    .row-fields {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .form-group.half-width,
    .form-group.date-field,
    .form-group.email-prefix,
    .form-group.email-domain {
        flex: 1 1 100%;
    }
    
    .email-at {
        display: none;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .notification {
        left: 10px;
        right: 10px;
        min-width: auto;
        top: 10px;
    }
    
    input, select, textarea {
        padding: 10px 12px;
        font-size: 14px;
        height: 44px;
    }
    
    button {
        padding: 12px 16px;
        height: 42px;
        font-size: 13px;
    }
    
    .logo {
        gap: 10px;
    }
    
    .logo-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .logo-text h1 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .dark-container {
        padding: 12px;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .section-title h2 {
        font-size: 16px;
    }
    
    .status-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .status-value {
        font-size: 14px;
    }
    
    .mode-toggle-label {
        min-width: auto;
        padding: 8px 12px;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dark);
}

/* تحسين مظهر الحقول */
select option {
    background: var(--bg-input);
    color: var(--text-primary);
    padding: 10px;
    font-size: var(--input-font-size);
}