/* Hala Hamdan Portfolio - Mobile-First Styles */

/* ===== CSS RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1e293b;
    background: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ===== CSS VARIABLES ===== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --accent: #0891b2;
    --text: #1e293b;
    --text-light: #64748b;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --border: #e2e8f0;
    --success: #22c55e;

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;

    --nav-height: 60px;
    --touch-target: 44px;
}

/* ===== CONTAINER ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

/* ===== NAVIGATION (Mobile First) ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--touch-target);
    height: var(--touch-target);
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
}

/* Mobile Navigation */
.nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    list-style: none;
    padding: var(--space-sm);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.nav-links.active {
    display: block;
}

.nav-links li {
    margin: 0;
}

.nav-links a {
    display: block;
    padding: var(--space-sm);
    min-height: var(--touch-target);
    display: flex;
    align-items: center;
    font-weight: 500;
    color: var(--text);
    border-radius: 8px;
    transition: background 0.2s;
}

.nav-links a:hover,
.nav-links a:active {
    background: var(--bg-alt);
    color: var(--primary);
}

/* ===== HERO SECTION (Mobile First) ===== */
.hero {
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    display: flex;
    align-items: center;
    padding: calc(var(--nav-height) + var(--space-lg)) var(--space-sm) var(--space-lg);
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
}

.hero .container {
    text-align: center;
}

.hero-image {
    margin-bottom: var(--space-lg);
}

.hero-image img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.hero-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    color: var(--text);
}

.hero-content h1 span {
    color: var(--primary);
}

.tagline {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: var(--space-sm);
}

.hero-content > p {
    color: var(--secondary);
    margin-bottom: var(--space-lg);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--touch-target);
    padding: var(--space-sm) var(--space-lg);
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

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

.btn-primary:hover,
.btn-primary:active {
    background: var(--primary-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-secondary:hover,
.btn-secondary:active {
    background: var(--primary);
    color: white;
}

/* ===== SECTIONS ===== */
section {
    padding: var(--space-xl) 0;
}

.section-title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: var(--space-lg);
    color: var(--text);
}

.section-title span {
    color: var(--primary);
}

/* ===== ABOUT SECTION ===== */
.about {
    background: var(--bg-alt);
}

.about-content {
    text-align: center;
}

.about-image {
    margin-bottom: var(--space-lg);
}

.about-image img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 15px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.about-text h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
    color: var(--primary);
}

.about-text p {
    margin-bottom: var(--space-md);
    color: var(--secondary);
    text-align: left;
}

.education-list {
    list-style: none;
    text-align: left;
    margin-top: var(--space-md);
}

.education-list li {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.education-list li:last-child {
    border-bottom: none;
}

.education-list .year {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.875rem;
}

/* ===== TOOLS SECTION ===== */
.tools-intro {
    text-align: center;
    color: var(--text-light);
    margin-bottom: var(--space-lg);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.tools-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.tool-card {
    display: block;
    background: white;
    border-radius: 15px;
    padding: var(--space-lg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.tool-card:hover,
.tool-card:active {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-color: var(--primary);
}

.tool-card .icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.tool-card h3 {
    font-size: 1.125rem;
    margin-bottom: var(--space-xs);
    color: var(--text);
}

.tool-card p {
    color: var(--text-light);
    font-size: 0.9375rem;
    margin-bottom: var(--space-sm);
}

.tool-card .badge {
    display: inline-block;
    background: var(--bg-alt);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.tool-card.coming-soon {
    opacity: 0.6;
    cursor: default;
}

.tool-card.coming-soon:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-color: var(--border);
}

/* ===== CONTACT SECTION ===== */
.contact {
    background: var(--bg-alt);
}

.contact-content {
    text-align: center;
}

.contact-content > p {
    color: var(--secondary);
    margin-bottom: var(--space-lg);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    align-items: center;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    min-height: var(--touch-target);
    padding: var(--space-sm) var(--space-lg);
    background: white;
    border-radius: 10px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    width: 100%;
    max-width: 280px;
}

.contact-link:hover,
.contact-link:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.contact-link.linkedin {
    background: #0077b5;
    color: white;
}

.contact-link svg {
    flex-shrink: 0;
}

/* ===== FOOTER ===== */
footer {
    background: var(--text);
    color: white;
    padding: var(--space-lg) 0;
    text-align: center;
}

footer p {
    opacity: 0.8;
    font-size: 0.875rem;
}

footer a {
    color: var(--accent);
}

/* ===== TABLET BREAKPOINT (481px+) ===== */
@media (min-width: 481px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-buttons {
        flex-direction: row;
        justify-content: center;
    }

    .education-list li {
        flex-direction: row;
        gap: var(--space-sm);
    }

    .education-list .year {
        min-width: 80px;
    }

    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-links {
        flex-direction: row;
        justify-content: center;
    }

    .contact-link {
        width: auto;
    }
}

/* ===== DESKTOP BREAKPOINT (769px+) ===== */
@media (min-width: 769px) {
    :root {
        --nav-height: 70px;
    }

    .container {
        padding: 0 var(--space-lg);
    }

    /* Desktop Navigation */
    .menu-toggle {
        display: none;
    }

    .nav-links {
        display: flex;
        position: static;
        background: none;
        border: none;
        padding: 0;
        box-shadow: none;
        gap: var(--space-xs);
    }

    .nav-links a {
        padding: var(--space-xs) var(--space-sm);
    }

    /* Hero Desktop */
    .hero .container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xl);
        text-align: left;
        align-items: center;
    }

    .hero-image {
        order: 2;
        margin-bottom: 0;
    }

    .hero-image img {
        width: 350px;
        height: 350px;
        margin: 0 0 0 auto;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content > p {
        margin-left: 0;
    }

    .hero-buttons {
        justify-content: flex-start;
    }

    /* About Desktop */
    .about-content {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: var(--space-xl);
        text-align: left;
    }

    .about-image {
        margin-bottom: 0;
    }

    .about-image img {
        width: 250px;
        height: 250px;
    }

    .section-title {
        font-size: 2rem;
    }

    /* Tools Desktop */
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== LARGE DESKTOP (1024px+) ===== */
@media (min-width: 1024px) {
    .hero-image img {
        width: 400px;
        height: 400px;
    }

    .hero-content h1 {
        font-size: 3rem;
    }
}

/* ===== iOS SAFE AREAS ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    footer {
        padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom));
    }
}

/* ===== WORD OF THE DAY SECTION ===== */
.word-of-day {
    background: linear-gradient(135deg, var(--bg) 0%, #e0f2fe 100%);
    padding: var(--space-xl) 0;
}

.wotd-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(37, 99, 235, 0.1);
    border: 2px solid var(--border);
    max-width: 640px;
    margin: 0 auto var(--space-md);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.wotd-loading {
    text-align: center;
    color: var(--text-light);
    padding: var(--space-lg);
}

.wotd-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: var(--space-xs);
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Video embed — responsive 16:9 */
.wotd-video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
}

.wotd-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.wotd-video-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-xs);
    background: var(--bg-alt);
    color: var(--text-light);
    font-size: 0.875rem;
    text-align: center;
    padding: var(--space-sm);
}

.wotd-video-fallback a {
    color: var(--primary);
    text-decoration: underline;
    min-height: var(--touch-target);
    display: inline-flex;
    align-items: center;
}

/* Word info below video */
.wotd-info {
    padding: var(--space-md) var(--space-lg);
    text-align: center;
}

.wotd-series {
    display: block;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-bottom: var(--space-sm);
    font-style: italic;
}

.wotd-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.wotd-word {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    text-transform: capitalize;
}

.wotd-audio-btn {
    background: var(--bg-alt);
    border: none;
    border-radius: 50%;
    width: var(--touch-target);
    height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary);
    transition: all 0.2s ease;
}

.wotd-audio-btn:hover,
.wotd-audio-btn:active {
    background: var(--primary);
    color: white;
}

.wotd-pos {
    display: block;
    text-align: center;
    margin-bottom: var(--space-xs);
}

.wotd-pos:not(:empty) {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    margin: 0 auto var(--space-xs);
}

.wotd-definition {
    font-size: 1rem;
    color: var(--text);
    text-align: center;
    line-height: 1.7;
}

.wotd-error {
    text-align: center;
    color: var(--secondary);
    padding: var(--space-lg);
}

.wotd-footer {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9375rem;
}

/* Tablet+ Word of Day */
@media (min-width: 481px) {
    .wotd-word {
        font-size: 2rem;
    }
}

/* Desktop Word of Day */
@media (min-width: 769px) {
    .wotd-info {
        padding: var(--space-md) var(--space-xl);
    }

    .wotd-word {
        font-size: 2.5rem;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
