/* ═══════════════════════════════════════════════════════════════
   Safa Inks – CMYK Industrial Theme
   Complete Production-Ready Stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ────────────────────────────────────── */
:root {
    --cmyk-cyan: #00AEEF;
    --cmyk-magenta: #EC008C;
    --cmyk-yellow: #FFF200;
    --cmyk-black: #231F20;
    --cmyk-dark: #1a1a1a;
    --cmyk-light: #f8f9fa;
    --cmyk-cyan-dark: #0097a7;
    --cmyk-magenta-dark: #c2185b;
    --gradient-primary: linear-gradient(135deg, var(--cmyk-cyan) 0%, var(--cmyk-magenta) 100%);
    --gradient-dark: linear-gradient(135deg, var(--cmyk-dark) 0%, #2c2c2c 100%);
    --shadow-sm: 0 2px 8px rgba(0,0,0,.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,.12);
    --shadow-lg: 0 8px 40px rgba(0,0,0,.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(.4,0,.2,1);
}

/* ── Global Resets ────────────────────────────────────────────── */
body {
    font-family: 'Tajawal', sans-serif;
    color: var(--cmyk-black);
    background-color: var(--cmyk-light);
    padding-top: 72px; /* Fixed navbar height */
    overflow-x: hidden;
}

::selection {
    background-color: var(--cmyk-cyan);
    color: white;
}

/* ── Utility Classes ──────────────────────────────────────────── */
.bg-cmyk-cyan { background-color: var(--cmyk-cyan) !important; color: white !important; }
.bg-cmyk-magenta { background-color: var(--cmyk-magenta) !important; color: white !important; }
.bg-cmyk-yellow { background-color: var(--cmyk-yellow) !important; color: var(--cmyk-black) !important; }
.bg-cmyk-black { background-color: var(--cmyk-black) !important; color: white !important; }
.text-cmyk-cyan { color: var(--cmyk-cyan) !important; }
.text-cmyk-magenta { color: var(--cmyk-magenta) !important; }

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════ */
.navbar-custom {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(to left, var(--cmyk-cyan), var(--cmyk-magenta), var(--cmyk-yellow)) 1;
    padding: 10px 0;
    transition: var(--transition);
}

.navbar-custom .navbar-brand {
    color: white;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}
.brand-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.navbar-custom .nav-link {
    color: rgba(255,255,255,.8) !important;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}
.navbar-custom .nav-link:hover {
    color: white !important;
    background: rgba(255,255,255,.08);
}
.navbar-custom .nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 50%;
    transform: translateX(50%);
    width: 0;
    height: 2px;
    background: var(--cmyk-cyan);
    transition: width 0.3s ease;
}
.navbar-custom .nav-link:hover::after {
    width: 60%;
}
.nav-admin-link {
    color: var(--cmyk-yellow) !important;
}
.btn-outline-cyan {
    color: var(--cmyk-cyan);
    border-color: var(--cmyk-cyan);
}
.btn-outline-cyan:hover {
    background-color: var(--cmyk-cyan);
    color: white;
}
.btn-outline-magenta {
    color: var(--cmyk-magenta);
    border-color: var(--cmyk-magenta);
}
.btn-outline-magenta:hover {
    background-color: var(--cmyk-magenta);
    color: white;
}

/* ═══════════════════════════════════════════════════════════════
   HERO SLIDER
   ═══════════════════════════════════════════════════════════════ */
.hero-slider-item {
    min-height: 550px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
}
.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(26,26,26,.85) 0%, rgba(0,174,239,.3) 100%);
}
.hero-content {
    position: relative;
    z-index: 2;
    color: white;
    padding: 40px;
    border-right: 5px solid var(--cmyk-magenta);
    animation: fadeInRight 0.8s ease;
}
.hero-content h1 {
    text-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.hero-content .lead {
    color: rgba(255,255,255,.8);
}

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

/* ═══════════════════════════════════════════════════════════════
   ABOUT SECTION
   ═══════════════════════════════════════════════════════════════ */
.about-section {
    background-color: white;
}
.about-badge {
    display: inline-block;
    padding: 6px 18px;
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    border-radius: 50px;
    font-size: 0.85rem;
    letter-spacing: 1px;
}
.section-title {
    font-size: 2rem;
    color: var(--cmyk-dark);
    position: relative;
}
.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.cmyk-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.cmyk-card {
    border-radius: var(--radius-md);
    padding: 40px 25px;
    text-align: center;
    color: white;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.cmyk-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}
.cmyk-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,.1);
    border-radius: 50%;
    transition: var(--transition);
}
.cmyk-card:hover::before {
    transform: scale(2);
}
.cmyk-label {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
}
.cmyk-value {
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   STATS SECTION
   ═══════════════════════════════════════════════════════════════ */
.stats-section {
    background: var(--gradient-dark);
}
.stat-card {
    padding: 30px 20px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    transition: var(--transition);
}
.stat-card:hover {
    background: rgba(255,255,255,.1);
    transform: translateY(-5px);
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
}
.stat-label {
    color: rgba(255,255,255,.6);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   CTA SECTION
   ═══════════════════════════════════════════════════════════════ */
.cta-section {
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -25%;
    width: 60%;
    height: 200%;
    background: rgba(255,255,255,.05);
    transform: rotate(30deg);
}

/* ═══════════════════════════════════════════════════════════════
   PRODUCT TREE
   ═══════════════════════════════════════════════════════════════ */
.product-tree-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 30px;
}

/* Products Page Hero */
.products-hero, .contact-hero {
    background: var(--gradient-dark);
    padding: 80px 0 60px;
    color: white;
    text-align: center;
}
.hero-divider {
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
    margin-top: 20px;
}

/* Product Tree Items */
.product-tree-wrapper {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-md);
}
.product-tree-item {
    margin-bottom: 8px;
}
.tree-node-card {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    background: var(--cmyk-light);
    border-right: 4px solid var(--cmyk-cyan);
    transition: var(--transition);
    cursor: default;
}
.tree-node-card:hover {
    background: #f0f0f0;
    transform: translateX(-4px);
    box-shadow: var(--shadow-sm);
}
.node-name { color: var(--cmyk-dark); }
.tree-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.toggle-icon {
    transition: transform 0.3s ease;
    transform: rotate(180deg); /* RTL: point left by default */
}
.toggle-icon.rotated {
    transform: rotate(90deg);
}
.tree-leaf-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.tree-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(.4,0,.2,1);
    padding-right: 24px;
    border-right: 2px solid rgba(0,174,239,.2);
    margin-right: 10px;
    margin-top: 4px;
}
.tree-children.show {
    max-height: none;
}
.tree-node-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}
.level-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 50px;
    white-space: nowrap;
}

/* Level-specific indentation and colors */
.level-1 > .tree-node-card { border-right-color: var(--cmyk-cyan); }
.level-2 > .tree-node-card { border-right-color: var(--cmyk-magenta); }
.level-3 > .tree-node-card { border-right-color: var(--cmyk-yellow); }
.level-4 > .tree-node-card { border-right-color: var(--cmyk-dark); }

/* ═══════════════════════════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════════════════════════ */
.auth-section {
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e8ecf1 100%);
    padding: 60px 0;
}
.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border-top: 4px solid transparent;
    border-image: var(--gradient-primary) 1;
}
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}
.auth-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
}
.auth-header h2 {
    font-weight: 800;
    color: var(--cmyk-dark);
}
.btn-auth {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 12px;
    font-weight: 700;
    font-size: 1.05rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}
.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,174,239,.3);
    color: white;
}
.auth-link {
    color: var(--cmyk-cyan);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}
.auth-link:hover {
    color: var(--cmyk-magenta);
}

/* Form overrides */
.auth-card .form-control, .contact-form-card .form-control {
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.auth-card .form-control:focus, .contact-form-card .form-control:focus {
    border-color: var(--cmyk-cyan);
    box-shadow: 0 0 0 0.2rem rgba(0,174,239,.15);
}

/* ═══════════════════════════════════════════════════════════════
   CONTACT PAGE
   ═══════════════════════════════════════════════════════════════ */
.contact-form-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border-top: 4px solid transparent;
    border-image: var(--gradient-primary) 1;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn-gradient {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 12px 30px;
    font-weight: 700;
    border-radius: 50px;
    transition: var(--transition);
}
.btn-gradient:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,174,239,.35);
    color: white;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.site-footer {
    position: relative;
    margin-top: 0;
}
.footer-wave {
    position: relative;
    margin-bottom: -2px;
}
.footer-wave svg {
    display: block;
    width: 100%;
    height: 80px;
}
.footer-content {
    background-color: var(--cmyk-dark);
    color: rgba(255,255,255,.85);
    padding: 40px 0 20px;
}
.footer-title {
    color: white;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-brand-dot {
    width: 8px;
    height: 8px;
    background: var(--cmyk-cyan);
    border-radius: 50%;
    display: inline-block;
}
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links li { margin-bottom: 10px; }
.footer-links a {
    color: rgba(255,255,255,.6);
    text-decoration: none;
    transition: var(--transition);
}
.footer-links a:hover {
    color: var(--cmyk-cyan);
    padding-right: 5px;
}
.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-contact li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,.6);
}
.footer-contact i {
    color: var(--cmyk-cyan);
    font-size: 1rem;
}
.footer-hr {
    border-color: rgba(255,255,255,.1);
    margin: 25px 0 15px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 992px) {
    .hero-slider-item { min-height: 400px; }
    .hero-content { padding: 25px; }
    .hero-content h1 { font-size: 1.8rem; }
    .cmyk-grid { gap: 12px; }
    .cmyk-card { padding: 25px 15px; }
    .cmyk-label { font-size: 2rem; }
    .stat-number { font-size: 2rem; }
}

@media (max-width: 768px) {
    body { padding-top: 60px; }
    .hero-slider-item { min-height: 350px; }
    .hero-content h1 { font-size: 1.5rem; }
    .hero-content .lead { font-size: 1rem; }
    .auth-card { padding: 25px; margin: 0 10px; }
    .contact-form-card { padding: 25px; }
    .product-tree-wrapper { padding: 15px; }
    .about-section .row { flex-direction: column-reverse; }
    .navbar-custom .navbar-brand { font-size: 1.1rem; }
    .products-hero, .contact-hero { padding: 50px 0 40px; }
}

@media (max-width: 576px) {
    .cmyk-grid { grid-template-columns: 1fr; }
    .stat-card { padding: 20px 10px; }
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS & MICRO-INTERACTIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.about-section, .stats-section, .cta-section {
    animation: slideUp 0.6s ease;
}

/* Smooth scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--cmyk-light); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--cmyk-cyan), var(--cmyk-magenta));
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--cmyk-cyan-dark); }

/* Alert animations */
.alert { animation: slideUp 0.4s ease; }

/* Empty state styling */
.empty-state svg { opacity: 0.3; }