/* =========================================================================
   Sherif Shaaban Digital Ecosystem - Identity Portal Core CSS (style.css)
   Theme: Sleek Dark Cybernetic & Premium Glassmorphism
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&family=Inter:wght@400;500;600;700;900&display=swap');

:root {
    /* Color Tokens */
    --bg-dark: #090d16;
    --bg-card: rgba(15, 23, 42, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.18);
    
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.35);
    --secondary: #06b6d4;
    --secondary-glow: rgba(6, 182, 212, 0.35);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.15);
    
    --font-ar: 'Cairo', sans-serif;
    --font-en: 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-ar);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Glowing Orbs */
.glow-orb {
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.4;
    pointer-events: none;
    animation: pulse 8s infinite alternate;
}

.orb-purple {
    background: var(--primary);
    top: -50px;
    right: -50px;
}

.orb-cyan {
    background: var(--secondary);
    bottom: -50px;
    left: -50px;
    animation-delay: 2s;
}

@keyframes pulse {
    0% { transform: scale(1) translate(0, 0); opacity: 0.3; }
    100% { transform: scale(1.2) translate(30px, -20px); opacity: 0.5; }
}

/* Container & Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Header */
.site-header {
    border-bottom: 1px solid var(--glass-border);
    background: rgba(9, 13, 22, 0.7);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    padding: 0.5rem 1.5rem;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.brand img {
    height: 32px;
    object-fit: contain;
}

.brand-text {
    font-family: var(--font-en);
    font-weight: 900;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}

.brand-text span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Premium Glass Panel */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: var(--transition);
}

.glass-panel:hover {
    border-color: var(--glass-border-hover);
}

/* Login Wrapper & Forms */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 3rem 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    padding: 2.5rem;
    text-align: center;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.auth-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    padding: 0.35rem;
    margin-bottom: 2rem;
    border: 1px solid var(--glass-border);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.tab-btn:not(.active):hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Form Elements */
.input-group {
    margin-bottom: 1.25rem;
    text-align: right;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.input-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.input-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
    background: rgba(15, 23, 42, 0.8);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #6d28d9);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border-hover);
}

.btn-block {
    width: 100%;
}

.btn-social {
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    width: 100%;
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.btn-social:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--glass-border-hover);
    transform: translateY(-1px);
}

.btn-social img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

.auth-divider span {
    padding: 0 0.75rem;
}

/* Status Alert Message */
.status-message {
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.status-message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.status-message.info {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
    color: #38bdf8;
}

/* Spinner Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========================================================================
   DASHBOARD HUB LAYOUT & SWITCHER
   ========================================================================= */

.dashboard-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    padding: 2rem 0;
}

@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

/* Profile Sidebar */
.profile-card {
    padding: 2rem;
    text-align: center;
    position: sticky;
    top: 90px;
}

.avatar-wrapper {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin: 0 auto 1.25rem;
    border: 3px solid var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
    overflow: hidden;
    background: #1e293b;
}

.avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.profile-email {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: var(--font-en);
    margin-bottom: 1.5rem;
}

/* Sidebar Menu */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: right;
    margin-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}

.menu-item:hover, .menu-item.active {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border-left: 3px solid var(--primary);
    padding-left: calc(1rem - 3px);
}

.menu-item.pink-menu {
    color: #f472b6;
}
.menu-item.pink-menu:hover, .menu-item.pink-menu.active {
    background: rgba(244, 114, 182, 0.05);
    color: #fbcfe8;
    border-left-color: #f472b6;
}

.sub-item {
    padding-right: 2rem !important; /* Indentation for RTL */
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Dashboard Workspace & Hub Switcher */
.workspace {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    text-align: right;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    text-align: right;
}

/* Hub Grid Switcher Cards */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.hub-card {
    padding: 2rem;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 240px;
    height: auto;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.hub-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 100% 0%, var(--glow-color, var(--primary-glow)), transparent 70%);
    opacity: 0;
    transition: var(--transition);
    z-index: 0;
}

.hub-card:hover::before {
    opacity: 1;
}

.hub-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.hub-icon {
    font-size: 2.2rem;
    color: var(--icon-color, var(--primary));
    position: relative;
    z-index: 1;
}

.hub-info {
    position: relative;
    z-index: 1;
    text-align: right;
}

.hub-card-title {
    font-size: 1.3rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.hub-card-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.hub-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--icon-color, var(--primary));
    margin-top: 1rem;
}

.hub-action i {
    transition: transform 0.2s;
}

.hub-card:hover .hub-action i {
    transform: translateX(-4px); /* RTL Left arrow transition */
}

/* =========================================================================
   SUPPORT TICKETS & UPGRADES WORKSPACE
   ========================================================================= */

.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ticket-row {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border: 1px solid var(--glass-border);
}

.ticket-info {
    text-align: right;
}

.ticket-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.ticket-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
}

.badge {
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-open {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-closed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 13, 22, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    opacity: 1;
    transition: var(--transition);
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    padding: 2.25rem;
    position: relative;
    border: 1px solid var(--glass-border);
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Discussion / Chat Logs in Ticket */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
    margin: 1.5rem 0;
    padding: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.chat-bubble {
    max-width: 80%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-bubble.admin {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.2);
    align-self: flex-start;
    text-align: left;
}

.chat-bubble.user {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    align-self: flex-end;
    text-align: right;
}

.chat-time {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* RTL Helpers */
[dir="rtl"] .menu-item:hover, [dir="rtl"] .menu-item.active {
    border-left: none;
    border-right: 3px solid var(--primary);
    padding-left: 1rem;
    padding-right: calc(1rem - 3px);
}

[dir="rtl"] .hub-action i {
    transform: rotate(180deg);
}

[dir="rtl"] .hub-card:hover .hub-action i {
    transform: rotate(180deg) translateX(4px);
}

/* Hidden Class */
.hidden {
    display: none !important;
}
