/* ==========================================================================
   Abdulrahman Albakri Portfolio - H&M Style Clean Minimalist Design
   Typography: Inter / Montserrat / Helvetica Neue (H&M Fashion Minimalist Stack)
   Features: User Profile Photo, Certifications Section, TikTok Link (iamaboody1)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Theme Variables & Tokens (Monochrome Palette)
   -------------------------------------------------------------------------- */
:root {
    --font-primary: 'Inter', 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);

    /* Radius Tokens */
    --radius-pill: 9999px;
    --radius-card: 18px;
    --radius-inner: 12px;

    /* Dark Theme Defaults (Sleek Charcoal Monochrome) */
    --bg-main: #0a0a0c;
    --bg-card: #141417;
    --bg-subtle: #1c1c20;
    --bg-hover: #27272a;
    
    --border-card: #27272a;
    --border-hover: #3f3f46;

    --text-primary: #ffffff;
    --text-muted: #a1a1aa;

    --btn-primary-bg: #ffffff;
    --btn-primary-text: #0a0a0c;

    --btn-sec-bg: #1c1c20;
    --btn-sec-text: #ffffff;
    --btn-sec-border: #27272a;

    --status-dot-bg: #22c55e;
    --navbar-bg: rgba(10, 10, 12, 0.88);
}

/* Light Theme Overrides (Pure Clean Off-White) */
[data-theme="light"] {
    --bg-main: #fafafa;
    --bg-card: #ffffff;
    --bg-subtle: #f4f4f5;
    --bg-hover: #e4e4e7;

    --border-card: #e4e4e7;
    --border-hover: #d4d4d8;

    --text-primary: #0a0a0c;
    --text-muted: #71717a;

    --btn-primary-bg: #0a0a0c;
    --btn-primary-text: #ffffff;

    --btn-sec-bg: #f4f4f5;
    --btn-sec-text: #0a0a0c;
    --btn-sec-border: #e4e4e7;

    --status-dot-bg: #16a34a;
    --navbar-bg: rgba(250, 250, 250, 0.88);
}

/* --------------------------------------------------------------------------
   2. Reset & Universal Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

ul {
    list-style: none;
}

button, input, textarea {
    font-family: var(--font-primary);
    outline: none;
    border: none;
    background: none;
}

button {
    cursor: pointer;
}

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.section {
    padding: 4.5rem 0;
}

/* Universal Center Helper Classes */
.text-center {
    text-align: center !important;
}

.center-icon {
    margin-left: auto !important;
    margin-right: auto !important;
}

.center-pills {
    justify-content: center !important;
}

.center-head {
    justify-content: center !important;
}

.center-pill {
    margin-left: auto !important;
    margin-right: auto !important;
}

.flex-center {
    display: flex;
    flex-direction: column;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

/* Card Container */
.card-smooth {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-card);
    padding: 2rem 1.75rem;
    transition: var(--transition);
    text-align: center;
}

.card-smooth:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
}

/* Section Header (Centered) */
.section-label {
    text-align: center;
    margin-bottom: 2.25rem;
}

.pill-label {
    display: inline-block;
    padding: 0.25rem 0.85rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.section-label h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    text-align: center;
}

/* Grids */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.75rem 1.625rem;
    font-size: 0.938rem;
    font-weight: 700;
    border-radius: var(--radius-pill);
    transition: var(--transition);
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--btn-sec-bg);
    color: var(--btn-sec-text);
    border: 1px solid var(--btn-sec-border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
}

/* Scroll Progress */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--text-primary);
    z-index: 2000;
    width: 0%;
}

/* --------------------------------------------------------------------------
   3. Header / Navbar (Centered Links)
   -------------------------------------------------------------------------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--navbar-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-card);
    padding: 0.875rem 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-menu {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.nav-list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-card);
    background: var(--bg-subtle);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--bg-hover);
}

.sun-icon { display: none; }
.moon-icon { display: block; }

[data-theme="light"] .sun-icon { display: block; }
[data-theme="light"] .moon-icon { display: none; }

.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
}

.hamburger-menu span {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
}

/* --------------------------------------------------------------------------
   4. Hero Section (User Avatar & Centered Layout)
   -------------------------------------------------------------------------- */
.hero-section {
    padding-top: 8rem;
    padding-bottom: 3.5rem;
}

.hero-box {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-card);
    padding: 3rem 2rem;
    text-align: center;
}

/* User Avatar Frame */
.user-avatar-frame {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    padding: 4px;
    background: var(--bg-subtle);
    border: 2px solid var(--border-card);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transition: var(--transition);
}

.user-avatar-frame:hover {
    transform: scale(1.05);
    border-color: var(--text-primary);
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-pill);
    font-size: 0.813rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--status-dot-bg);
}

.hero-name {
    font-size: 2.75rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    text-align: center;
}

.hero-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    text-align: center;
}

.hero-title .bullet {
    margin: 0 0.35rem;
}

.hero-intro {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 660px;
    margin: 0 auto 2rem;
    line-height: 1.7;
    text-align: center;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.meta-pills {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.875rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-card);
}

.meta-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.meta-pill i {
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   5. About Me, Objective, Certifications
   -------------------------------------------------------------------------- */
.card-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
}

.card-smooth h3 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.85rem;
    text-align: center;
}

.card-smooth p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 0.85rem;
    text-align: center;
}

.card-sub-block {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-card);
    text-align: center;
}

.card-sub-block h4 {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    text-align: center;
}

.pill-group {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.mono-pill {
    padding: 0.35rem 0.85rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-pill);
    font-size: 0.813rem;
    font-weight: 700;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
    gap: 0.65rem;
}

.val-item {
    padding: 0.6rem 0.75rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-inner);
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-align: center;
}

.val-item i {
    font-size: 0.75rem;
    color: var(--text-primary);
}

.objective-card {
    text-align: center;
    padding: 3rem 2rem;
}

.objective-statement {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-primary);
    font-style: italic;
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

/* --------------------------------------------------------------------------
   6. Education & Experience (Centered)
   -------------------------------------------------------------------------- */
.edu-top-row,
.exp-header-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    gap: 0.5rem;
    text-align: center;
}

.edu-title-group h3,
.exp-role {
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
}

.institution,
.exp-company {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.938rem;
    margin-top: 0.2rem;
    text-align: center;
}

.date-badge,
.mono-badge {
    font-size: 0.813rem;
    font-weight: 800;
    padding: 0.25rem 0.85rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-pill);
    display: inline-block;
}

.edu-details {
    color: var(--text-muted);
    line-height: 1.7;
    text-align: center;
}

.clean-bullet-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.clean-bullet-list li {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.938rem;
    line-height: 1.6;
    text-align: center;
}

.clean-bullet-list li i {
    color: var(--text-primary);
    font-size: 0.4rem;
}

/* --------------------------------------------------------------------------
   7. Skills Tag Badges & Languages
   -------------------------------------------------------------------------- */
.skill-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.skill-head i {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.skill-tag-badge {
    padding: 0.5rem 1rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.skill-tag-badge:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.lang-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
}

.lang-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.lang-info h3 {
    font-size: 1.15rem;
    font-weight: 800;
    text-align: center;
}

.lang-info span {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}

/* --------------------------------------------------------------------------
   8. Services & Projects (Centered)
   -------------------------------------------------------------------------- */
.service-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
}

.service-card h3 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.65rem;
    text-align: center;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.938rem;
    line-height: 1.6;
    text-align: center;
}

.project-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.project-tag-pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    text-align: center;
}

.project-description {
    color: var(--text-muted);
    font-size: 0.938rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    text-align: center;
}

/* --------------------------------------------------------------------------
   9. Contact Form & Footer (TikTok Pill Included)
   -------------------------------------------------------------------------- */
.contact-intro {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    text-align: center;
}

.contact-details-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
    align-items: center;
}

.c-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
}

.c-item i {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.c-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.social-links-block h4 {
    font-size: 0.938rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.social-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.social-pill {
    padding: 0.5rem 1rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.social-pill:hover {
    background: var(--text-primary);
    color: var(--bg-main);
    border-color: var(--text-primary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-align: center;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 700;
    text-align: center;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem 1rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-inner);
    color: var(--text-primary);
    font-size: 0.938rem;
    transition: var(--transition);
    text-align: center;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--text-primary);
}

.error-msg {
    font-size: 0.75rem;
    color: #ef4444;
    display: none;
    text-align: center;
}

.form-group.error .error-msg {
    display: block;
}

.form-group.error input,
.form-group.error textarea {
    border-color: #ef4444;
}

/* Modal & Toast */
.modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 4000;
    background: var(--bg-card);
    border: 1px solid var(--text-primary);
    padding: 0.85rem 1.35rem;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
}

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

.toast-icon {
    color: var(--text-primary);
}

/* Footer (Centered) */
.footer {
    border-top: 1px solid var(--border-card);
    padding: 1.75rem 0;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}

.back-to-top {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.back-to-top:hover {
    background: var(--text-primary);
    color: var(--bg-main);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Responsive Center Breakpoint Fixes */
@media (max-width: 768px) {
    .hero-name {
        font-size: 2rem;
        text-align: center !important;
    }

    .hero-title {
        font-size: 1rem;
        text-align: center !important;
    }

    .hero-intro {
        font-size: 0.95rem;
        text-align: center !important;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
    }

    .hamburger-menu {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-card);
        border-left: 1px solid var(--border-card);
        padding: 5rem 1.5rem 2rem;
        transition: var(--transition);
    }

    .nav-menu.open {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 1.25rem;
        text-align: center;
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .card-smooth {
        padding: 1.5rem 1.25rem;
        text-align: center !important;
    }

    .section-label h2 {
        font-size: 1.75rem;
        text-align: center !important;
    }
}
