/* ========================================================
   Tajawal Font Default & Premium Redesign (Dark Default)
   ======================================================== */

:root {
  /* --- Light Theme (Legacy "this style") --- */
  color-scheme: light;
  --bg-main: #f7f9fc;
  --bg-gradient: linear-gradient(135deg, #eef2f3 0%, #f7f9fc 100%);
  --bg-card: rgba(255, 255, 255, 0.7);
  --border-card: rgba(255, 255, 255, 0.5);
  
  --text-main: #1f2937;
  --text-muted: #4b5563;
  --primary: #14b8a6;    /* Teal */
  --primary-hover: #0d9488;
  --accent: #3b82f6;     /* Blue */
  --badge-bg: rgba(20, 184, 166, 0.1);
  
  --glass-blur: blur(16px);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

:root[data-theme="dark"] {
  /* --- Dark Theme (New Default) --- */
  color-scheme: dark;
  --bg-main: #0f172a;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --bg-card: rgba(30, 41, 59, 0.6);
  --border-card: rgba(255, 255, 255, 0.08);
  
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --primary: #2dd4bf;
  --primary-hover: #5eead4;
  --accent: #60a5fa;
  --badge-bg: rgba(45, 212, 191, 0.15);
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', sans-serif; /* TAJAWAL IS THE DEFAULT FONT */
    background: var(--bg-main);
    background-image: var(--bg-gradient);
    color: var(--text-main);
    transition: background 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
}

h1 { font-size: 3.5rem; font-weight: 900; margin-bottom: 20px;}
h2 { font-size: 2.5rem; margin-bottom: 30px;}
p { line-height: 1.8; margin-bottom: 15px;}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.highlight {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Background Animated Shapes */
.bg-shapes {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 20s infinite linear alternate;
}

.shape-1 { width: 400px; height: 400px; background: rgba(45, 212, 191, 0.3); top: -10%; right: -5%; }
.shape-2 { width: 500px; height: 500px; background: rgba(96, 165, 250, 0.2); bottom: -15%; left: -10%; animation-delay: -5s; }
.shape-3 { width: 300px; height: 300px; background: rgba(167, 139, 250, 0.2); top: 40%; left: 50%; animation-duration: 25s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Core Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Glassmorphism */
.glass-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-card);
    transition: background 0.4s ease;
}

.head-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.4rem;
    font-weight: 800;
}

.brand-logo img {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-size: 1.1rem;
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px; right: 0;
    width: 0; height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Toggle Switch UX */
.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
    cursor: pointer;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #374151; /* Dark bg for toggle */
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.slider:before {
    background-color: #fca311; /* sun color */
    bottom: 3px;
    content: "🌙";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .3s;
    width: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #e5e7eb; /* Light bg for toggle */
}

input:checked + .slider:before {
    transform: translateX(24px);
    content: "☀️";
    background-color: #facc15;
}

.slider.round {
    border-radius: 34px;
}

/* Hero Section */
.hero-section {
    display: flex;
    align-items: center;
    gap: 40px;
    min-height: calc(100vh - 80px);
    padding-top: 40px;
}

.hero-text {
    flex: 1.2;
}

.badge {
    background: var(--badge-bg);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-block;
    margin-bottom: 25px;
    border: 1px solid rgba(45, 212, 191, 0.2);
}

.hero-text .lead {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.action-btns {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    color: #000000 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.4);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.6);
}

.btn-glass {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    color: var(--text-main);
    backdrop-filter: blur(8px);
}

.btn-glass:hover {
    background: rgba(20, 184, 166, 0.1);
    transform: translateY(-2px);
}

.hero-image-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.img-border {
    position: relative;
    border-radius: 24px;
    padding: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: var(--shadow-lg);
    animation: float 6s infinite ease-in-out alternate;
}

.img-border img {
    border-radius: 16px;
    width: 320px;
    height: auto;
    display: block;
}

/* Glass Cards Component */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-card);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: -40px auto 80px auto;
    position: relative;
    z-index: 10;
}

.stat-card {
    padding: 30px 20px;
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Skills Section */
.skills-section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.skill-card {
    padding: 35px 25px;
}

.skill-card .icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.skill-card h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.skill-card p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* Gallery Section - Bento Grid */
.gallery-section {
    padding: 60px 0 100px 0;
}

.bento-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 250px);
    gap: 20px;
}

.bento-item {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 0;
}

.bento-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.bento-item:hover img {
    transform: scale(1.1);
}

.bento-item .overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 30px 20px 20px;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
}

.bento-item:hover .overlay {
    opacity: 1;
    transform: translateY(0);
}

/* Grid areas for bento */
.i1 { grid-column: span 2; grid-row: span 2; }
.i2 { grid-column: span 2; grid-row: span 1; }
.i3 { grid-column: span 1; grid-row: span 1; }
.i4 { grid-column: span 1; grid-row: span 1; }

/* Footer */
.glass-footer {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-card);
    padding: 40px 0;
    text-align: center;
    margin-top: 50px;
}

.ft-sub {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 10px;
}

/* Responsive constraints */
@media (max-width: 992px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
        padding-top: 60px;
    }
    
    h1 { font-size: 2.8rem; }
    
    .action-btns {
        justify-content: center;
    }
    
    .bento-gallery {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }
    .i1, .i2, .i3, .i4 { grid-column: span 1; }
}

@media (max-width: 768px) {
    .bento-gallery {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        display: none; /* simple mobile hide for now */
    }
}

/* Futuristic Lightbox */
.lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.lightbox.active {
    opacity: 1; visibility: visible;
}
.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.lightbox.active .lightbox-content {
    transform: scale(1);
}
.lightbox img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(45, 212, 191, 0.4), 0 0 10px rgba(96, 165, 250, 0.3);
    border: 2px solid rgba(45, 212, 191, 0.3);
    object-fit: contain;
}
.lightbox-close {
    position: absolute;
    top: 20px; right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s, transform 0.3s;
}
.lightbox-close:hover {
    color: var(--primary); transform: rotate(90deg);
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    z-index: 10000;
    padding: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    user-select: none;
}
.lightbox-nav:hover {
    background: var(--primary);
    color: #0f172a;
    box-shadow: 0 0 20px rgba(45, 212, 191, 0.6);
}
.lightbox-prev { right: 30px; }
.lightbox-next { left: 30px; }
/* Hover Effects Enhancement */
.bento-item { cursor: pointer; border: 1px solid rgba(45, 212, 191, 0.1); transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1); }
.bento-item:hover { transform: translateY(-8px) scale(1.02); border-color: var(--primary); box-shadow: 0 12px 35px rgba(45, 212, 191, 0.3), 0 0 0 1px var(--primary) inset; z-index: 10; }

