/* ==========================================================================
   Noufal Ibrahim | Senior Mobile Engineer Portfolio
   Natural, Clean, Minimalist Design System
   ========================================================================== */

:root {
    color-scheme: light dark;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-subtle: rgba(37, 99, 235, 0.08);
    --primary-border: rgba(37, 99, 235, 0.2);
}

/* Light Mode Tokens (Clean, Crisp, Editorial - Default) */
html.light, html:not(.dark) {
    color-scheme: light;
    --bg-page: #fafafa;
    --bg-card: #ffffff;
    --bg-subtle: #f4f4f5;
    --bg-elevated: #ffffff;
    --border-base: #e4e4e7;
    --border-hover: #d4d4d8;
    --text-primary: #09090b;
    --text-secondary: #52525b;
    --text-muted: #71717a;
    --nav-bg: rgba(250, 250, 250, 0.85);
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
    --card-hover-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --phone-bg: #18181b;
    --phone-border: #27272a;
    --scrollbar-track: #fafafa;
    --scrollbar-thumb: #d4d4d8;
}

/* Dark Mode Tokens (Deep, Calm, Natural Zinc) */
html.dark {
    color-scheme: dark;
    --bg-page: #09090b;
    --bg-card: #121215;
    --bg-subtle: #18181b;
    --bg-elevated: #1e1e24;
    --border-base: #27272a;
    --border-hover: #3f3f46;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --nav-bg: rgba(9, 9, 11, 0.85);
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
    --card-hover-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.6);
    --phone-bg: #121215;
    --phone-border: #27272a;
    --scrollbar-track: #09090b;
    --scrollbar-thumb: #27272a;
}

/* Utility Classes for Theme Colors */
.bg-page { background-color: var(--bg-page); }
.bg-card { background-color: var(--bg-card); }
.bg-subtle { background-color: var(--bg-subtle); }
.bg-elevated { background-color: var(--bg-elevated); }
.border-base { border-color: var(--border-base); }
.border-hover { border-color: var(--border-hover); }
.text-heading { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }

/* Form Controls & Inputs */
input[type="text"],
input[type="search"],
#project-search {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-base) !important;
}

input[type="text"]::placeholder,
input[type="search"]::placeholder,
#project-search::placeholder {
    color: var(--text-muted) !important;
    opacity: 1;
}

input[type="text"]:focus,
input[type="search"]:focus,
#project-search:focus {
    border-color: var(--border-hover) !important;
    box-shadow: 0 0 0 2px var(--primary-border) !important;
}

/* Base Document Styles */
body {
    background-color: var(--bg-page);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.font-mono-code {
    font-family: var(--font-mono);
}

/* Navigation */
.nav-backdrop {
    background-color: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-base);
}

/* Clean Cards */
.clean-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-base);
    box-shadow: var(--card-shadow);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.clean-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--card-hover-shadow);
}

/* Natural Smartphone Frame */
.clean-phone-frame {
    position: relative;
    width: 290px;
    height: 580px;
    background: var(--phone-bg);
    border: 3px solid var(--phone-border);
    border-radius: 40px;
    overflow: hidden;
    margin: 0 auto;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.clean-phone-frame:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px -15px rgba(0, 0, 0, 0.45);
}

.phone-screen {
    width: 100%;
    height: 100%;
    position: relative;
    overflow-y: auto;
    background: #000000;
}

.phone-screen::-webkit-scrollbar {
    display: none;
}

.phone-notch {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 20px;
    background: #000000;
    border-radius: 12px;
    z-index: 30;
}

.phone-slide {
    display: none;
    width: 100%;
    height: 100%;
}

.phone-slide.active {
    display: block;
}

/* Interactive Pill Badges */
.badge-subtle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    background-color: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border-base);
    transition: all 0.15s ease;
}

.badge-subtle:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* Clean Button Styles */
.btn-solid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    background-color: var(--text-primary);
    color: var(--bg-page);
    transition: all 0.15s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-solid:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-base);
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-outline:hover {
    background-color: var(--bg-subtle);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

/* Authentic App Store & Google Play Badges */
.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border-radius: 12px;
    background-color: #09090b;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

html.dark .store-badge {
    background-color: #18181b;
    border-color: rgba(255, 255, 255, 0.18);
}

.store-badge:hover {
    background-color: #18181b;
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 14px -2px rgba(0, 0, 0, 0.3);
    color: #ffffff !important;
}

html.dark .store-badge:hover {
    background-color: #27272a;
    border-color: rgba(255, 255, 255, 0.38);
}

.store-badge:active {
    transform: translateY(0);
}

.store-badge-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.store-badge-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.15;
}

.store-badge-sub {
    font-size: 8.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a1a1aa;
}

.store-badge-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #ffffff;
}

/* Clean Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-base);
    border-radius: 20px;
    max-width: 720px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.4);
    transform: scale(0.97) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-card {
    transform: scale(1) translateY(0);
}

/* Minimal Toast Notification */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-base);
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.2);
    transform: translateY(12px);
    opacity: 0;
    transition: all 0.2s ease;
    pointer-events: auto;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

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

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

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

/* Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -50px;
    left: 16px;
    background: var(--primary);
    color: #ffffff;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    z-index: 200;
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 16px;
}

/* Clean status dot */
.status-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #10b981;
    display: inline-block;
}
