/* عبير AI - التصميم الجديد */
:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #252542;
    --purple-primary: #8B5CF6;
    --purple-secondary: #7C3AED;
    --purple-light: #A78BFA;
    --teal-primary: #10B981;
    --teal-secondary: #059669;
    --teal-light: #34D399;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b80;
    --border-color: #2d2d4a;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
}

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

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* شاشة تسجيل الدخول */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    padding: 20px;
}

.login-container {
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-header {
    margin-bottom: 30px;
}

.login-avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 48px;
    font-weight: 700;
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.4);
}

.login-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--purple-light);
}

.login-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.login-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid var(--border-color);
}

.login-content h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.login-content > p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.login-features {
    margin-bottom: 25px;
}

.feature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.feature-icon {
    font-size: 20px;
}

.g_id_signin {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.guest-btn {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
}

.guest-btn:hover {
    border-color: var(--purple-primary);
    color: var(--purple-light);
}

.terms {
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

.terms a {
    color: var(--purple-light);
    text-decoration: none;
}

/* الواجهة الرئيسية */
.main-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* الشريط العلوي */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

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

.avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
}

.logo-text h1 {
    font-size: 20px;
    color: var(--purple-light);
    margin-bottom: 2px;
}

.status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.icon-btn:hover {
    background: var(--purple-primary);
    color: white;
}

.user-menu {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--purple-primary);
}

.user-dropdown {
    position: absolute;
    top: 50px;
    left: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    min-width: 200px;
    z-index: 100;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.user-info span:first-child {
    font-weight: 600;
}

.user-info span:last-child {
    font-size: 12px;
    color: var(--text-muted);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 10px 0;
}

.user-dropdown button {
    width: 100%;
    padding: 10px;
    background: var(--error);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-family: inherit;
}

/* المحتوى الرئيسي */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* قسم الدردشة */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    max-width: 50%;
}

/* اختصارات سريعة */
.quick-actions {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.quick-label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn.purple {
    background: linear-gradient(135deg, var(--purple-primary), #6366F1);
}

.action-btn.teal {
    background: linear-gradient(135deg, var(--teal-primary), #06B6D4);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

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

/* منطقة الرسائل */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
}

.message.assistant {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--teal-primary);
}

.message-content {
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.message.user .message-content {
    background: var(--purple-primary);
    border-color: var(--purple-primary);
}

.message-content p {
    margin-bottom: 6px;
    line-height: 1.6;
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
}

.message.user .message-time {
    color: rgba(255, 255, 255, 0.7);
}

/* شريط الإدخال */
.input-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.input-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.input-btn:hover {
    color: var(--purple-light);
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
}

#messageInput:focus {
    border-color: var(--purple-primary);
}

#messageInput::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-secondary));
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.send-btn:hover {
    transform: scale(1.05);
}

/* قسم مساحة العمل */
.workspace-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

/* التبويبات */
.workspace-tabs {
    display: flex;
    padding: 10px 15px;
    gap: 5px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: var(--bg-tertiary);
}

.tab-btn.active {
    background: var(--purple-primary);
    color: white;
}

.tab-icon {
    font-size: 16px;
}

/* محتوى التبويبات */
.workspace-content {
    flex: 1;
    padding: 15px;
    overflow: hidden;
}

.tab-content {
    display: none;
    height: 100%;
}

.tab-content.active {
    display: block;
}

/* نافذة المتصفح */
.browser-window {
    height: 100%;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.browser-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.browser-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #EF4444; }
.dot.yellow { background: #F59E0B; }
.dot.green { background: #10B981; }

.browser-url {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.url-icon {
    font-size: 16px;
}

.browser-url input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    outline: none;
}

.browser-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.browser-placeholder {
    text-align: center;
}

.placeholder-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
}

.browser-placeholder p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, var(--purple-primary), var(--teal-primary));
    border-radius: 2px;
    animation: loading 2s ease-in-out infinite;
}

@keyframes loading {
    0% { width: 0%; margin-right: 100%; }
    50% { width: 50%; margin-right: 25%; }
    100% { width: 0%; margin-right: 0%; }
}

/* Terminal */
.terminal-window {
    height: 100%;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    font-family: 'Fira Code', monospace;
}

.terminal-header {
    padding: 10px 15px;
    background: #2d2d2d;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-secondary);
}

.terminal-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    font-size: 13px;
}

.terminal-line {
    margin-bottom: 8px;
}

.prompt {
    color: var(--teal-primary);
    margin-left: 8px;
}

.command {
    color: var(--text-primary);
}

.terminal-input {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #2d2d2d;
    border-top: 1px solid var(--border-color);
}

.terminal-input input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

/* نافذة الكود */
.code-window {
    height: 100%;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.file-name {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: var(--text-secondary);
}

.code-actions {
    display: flex;
    gap: 8px;
}

.code-btn {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.code-btn:hover {
    opacity: 1;
}

.code-body {
    flex: 1;
    padding: 15px;
    overflow: auto;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    background: #1e1e2e;
}

.code-body pre {
    margin: 0;
}

.code-body code {
    color: var(--text-secondary);
}

/* نافذة المراقبة */
.monitor-window {
    height: 100%;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.monitor-header {
    padding: 12px 15px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.monitor-body {
    padding: 15px;
}

.monitor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 10px;
}

.monitor-label {
    color: var(--text-secondary);
}

.monitor-value {
    font-weight: 500;
}

.monitor-value.online {
    color: var(--success);
}

/* Responsive */
@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }
    
    .chat-section {
        max-width: 100%;
        border-left: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .workspace-section {
        height: 50vh;
    }
    
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .top-bar {
        padding: 10px 15px;
    }
    
    .logo-text h1 {
        font-size: 16px;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .action-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .workspace-tabs {
        overflow-x: auto;
    }
    
    .tab-btn span:last-child {
        display: none;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--purple-primary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--purple-secondary);
}
