/* ============================================
   FlowtechDZ - Modern Design System v2.0
   TRL4 Enterprise Platform
   ============================================ */

/* Reset & Root Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    
    /* Modern Color Palette */
    --primary: #0f62fe;
    --primary-hover: #0353e9;
    --primary-dark: #0043ce;
    --accent: #00d9ff;
    --accent-dark: #00a8d1;
    --secondary: #4589ff;
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f5f5f5;
    --gray-100: #f0f0f0;
    --gray-200: #e8e8e8;
    --gray-300: #d9d9d9;
    --gray-400: #c6c6c6;
    --gray-500: #a8a8a8;
    --gray-600: #8d8d8d;
    --gray-700: #525252;
    --gray-800: #393939;
    --gray-900: #161616;
    
    /* Status Colors */
    --success: #24a148;
    --warning: #f1c21b;
    --error: #da1e28;
    --info: #0043ce;
    
    /* Surfaces */
    --surface-light: rgba(255, 255, 255, 0.95);
    --surface-glass: rgba(255, 255, 255, 0.8);
    --surface-overlay: rgba(0, 0, 0, 0.5);
    
    /* Shadows - Modern */
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 24px 56px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 40px rgba(15, 98, 254, 0.15);
    
    /* Radius */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    --radius-full: 999px;
    
    /* Transitions */
    --transition-xs: 100ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-sm: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-md: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-lg: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Typography */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    direction: rtl;
    line-height: 1.6;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--gray-900);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(15, 98, 254, 0.08), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 217, 255, 0.08), transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-50);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 5px;
    border: 2px solid var(--gray-50);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-hover), var(--accent-dark));
}

/* Base Elements */
.container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 24px;
}

img, svg {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: color var(--transition-md);
}

button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.header {
    background: var(--surface-light);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1.2rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-md);
}

.header:hover {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-md);
    flex-shrink: 0;
}

.logo:hover {
    transform: scale(1.06);
}

.logo-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 12px rgba(15, 98, 254, 0.2));
    transition: filter var(--transition-md);
}

.logo:hover .logo-icon {
    filter: drop-shadow(0 6px 20px rgba(0, 217, 255, 0.3));
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}

.nav-link {
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-lg);
    transition: all var(--transition-md);
    position: relative;
    white-space: nowrap;
}

.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 98, 254, 0.1), rgba(0, 217, 255, 0.1));
    border-radius: var(--radius-lg);
    opacity: 0;
    transition: opacity var(--transition-md);
    z-index: -1;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link:hover::before {
    opacity: 1;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    padding: 6rem 0 5rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.05), transparent 50%);
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.8s ease both;
}

.hero-title {
    font-size: clamp(3rem, 5vw, 4rem);
    font-weight: 900;
    margin-bottom: 1.2rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
    animation: fadeInUp 0.8s ease both 0.1s;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    max-width: 900px;
    margin: 1.5rem auto;
    opacity: 0.95;
    line-height: 1.7;
    animation: fadeInUp 0.8s ease both 0.2s;
}

.hero-description {
    font-size: 1.05rem;
    max-width: 800px;
    margin: 1.5rem auto 2.5rem;
    opacity: 0.9;
    line-height: 1.8;
    animation: fadeInUp 0.8s ease both 0.3s;
}

.hero-buttons {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease both 0.4s;
}

.hero-btn {
    background: white;
    color: var(--primary);
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-md);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.hero-btn:hover {
    transform: translateY(-4px);
    background: var(--gray-50);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);
}

.hero-btn:active {
    transform: translateY(-2px);
}

.hero-btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
    padding: 0.95rem 2.3rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-md);
}

.hero-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

/* ============================================
   FEATURES SECTION
   ============================================ */

.features {
    padding: 6rem 0;
    background: linear-gradient(180deg, rgba(15, 98, 254, 0.03), transparent);
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--gray-600);
    margin-bottom: 3.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--surface-light);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-2xl);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-lg);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-md);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(15, 98, 254, 0.2);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    display: block;
}

.feature-title {
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.feature-description {
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.feature-link {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-md);
}

.feature-link:hover {
    gap: 0.8rem;
    opacity: 0.8;
}

/* ============================================
   CARDS & COMPONENTS
   ============================================ */

.service-card,
.value-item,
.content-card,
.chat-card,
.history-card,
.forum-card {
    background: var(--surface-light);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-md);
}

.service-card:hover,
.value-item:hover,
.content-card:hover,
.chat-card:hover,
.history-card:hover,
.forum-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: rgba(15, 98, 254, 0.15);
}

.service-icon,
.value-icon {
    font-size: 3.2rem;
    margin-bottom: 1.2rem;
    filter: drop-shadow(0 4px 12px rgba(15, 98, 254, 0.1));
}

.service-title,
.value-title {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

.service-description {
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.6;
}

.value-item {
    text-align: center;
    padding: 2.5rem 2rem;
}

/* ============================================
   BUTTONS & CONTROLS
   ============================================ */

.btn, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-md);
    box-shadow: 0 8px 20px rgba(15, 98, 254, 0.2);
}

.btn:hover, .button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(15, 98, 254, 0.3);
}

.btn:active, .button:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(15, 98, 254, 0.1);
    color: var(--primary);
    border: 1px solid var(--primary);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(15, 98, 254, 0.15);
    box-shadow: none;
}

.logout-btn {
    background: linear-gradient(135deg, var(--error), #ff8a8a);
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-md);
}

.logout-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(218, 30, 40, 0.2);
}

/* ============================================
   FORMS & INPUTS
   ============================================ */

.input,
textarea,
select,
input[type='text'],
input[type='email'],
input[type='password'],
input[type='file'] {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: var(--surface-light);
    color: var(--gray-900);
    font-size: 0.95rem;
    transition: all var(--transition-md);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.1);
    background: white;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.95rem;
}

.form-note {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-top: 0.5rem;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: linear-gradient(135deg, #0a2a57 0%, #0d3d6b 100%);
    color: rgba(255, 255, 255, 0.8);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-section h4 {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
}

.footer-link {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    margin: 0.6rem 0;
    transition: all var(--transition-md);
    font-size: 0.95rem;
}

.footer-link:hover {
    color: #7ec8ff;
    transform: translateX(-4px);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(15, 98, 254, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 217, 255, 0.5);
    }
}

.fade-in {
    animation: fadeInUp 0.8s ease both;
}

.animated-card {
    animation: fadeInUp 0.6s ease both;
}

/* ============================================
   DASHBOARD SECTION
   ============================================ */

.dashboard-section {
    padding: 4rem 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    gap: 2rem;
}

.dashboard-title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.dashboard-subtitle {
    color: var(--gray-600);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    
    .header .container {
        gap: 1.5rem;
    }
    
    .nav {
        gap: 0.3rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        width: 100%;
        justify-content: center;
    }
    
    .hero {
        padding: 4rem 0 3rem;
    }
    
    .hero-title {
        font-size: clamp(2rem, 5vw, 2.8rem);
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-btn, .hero-btn-secondary {
        width: 100%;
        max-width: 300px;
    }
    
    .features-grid,
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
        margin-bottom: 0.8rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
