/* ============================================================
   TECHBYSAM — MAIN STYLES
   ============================================================ */
@import url('variables.css');
@import url('components.css');

/* RESET */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--white);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--space-sm);
    color: var(--primary-black);
}

a { color: var(--primary-red); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--hover-red); }

img { max-width: 100%; height: auto; display: block; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.site-header {
    background: var(--primary-black);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-size: 1.35rem;
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: -0.3px;
}
.navbar-brand:hover { color: var(--primary-red); }
.navbar-brand i { color: var(--primary-red); font-size: 1.5rem; }

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 32px;
    align-items: center;
}

.nav-link {
    color: var(--white);
    font-weight: 500;
    padding: 6px 0;
    position: relative;
    transition: color 0.3s;
}
.nav-link:hover,
.nav-link.active {
    color: var(--primary-red);
}
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0; right: 0;
    height: 2px;
    background: var(--primary-red);
}

.navbar-toggler {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.6rem;
    cursor: pointer;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    background: var(--white);
    padding: var(--space-xl) 0;
    text-align: center;
    border-bottom: 1px solid var(--light-gray);
}
.hero h1 {
    font-size: 3rem;
    color: var(--primary-black);
    margin-bottom: var(--space-sm);
}
.hero .lead {
    font-size: 1.25rem;
    color: var(--dark-gray);
    max-width: 700px;
    margin: 0 auto var(--space-md);
}
.hero .availability {
    display: inline-block;
    background: var(--section-bg);
    padding: 8px 20px;
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-md);
}
.hero .availability i { color: var(--primary-red); margin-right: 6px; }
.hero-buttons {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   SECTIONS
   ============================================ */
.section { padding: var(--space-xl) 0; }
.section-alt { background: var(--section-bg); }
.section-dark {
    background: var(--primary-black);
    color: var(--white);
}
.section-dark h2,
.section-dark h3 { color: var(--white); }

.section-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}
.section-title {
    font-size: 2.25rem;
    color: var(--primary-black);
    margin-bottom: 8px;
}
.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
}
.section-accent {
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-red);
    margin: 12px auto 0;
}

/* ============================================
   STATS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-md);
    text-align: center;
}
.stat-item .stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-red);
    font-family: var(--font-heading);
    line-height: 1;
}
.stat-item .stat-label {
    color: var(--white);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 8px;
}

/* ============================================
   SKILLS
   ============================================ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-sm);
    max-width: 900px;
    margin: 0 auto;
}
.skill-item {
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    text-align: center;
    transition: all 0.3s;
}
.skill-item:hover {
    border-color: var(--primary-red);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.skill-item i {
    font-size: 1.8rem;
    color: var(--primary-red);
    margin-bottom: 8px;
}
.skill-item .skill-name {
    font-weight: 600;
    color: var(--primary-black);
    font-size: 0.9rem;
}

/* ============================================
   EXPERIENCE ITEM
   ============================================ */
.experience-item {
    background: var(--white);
    border-left: 4px solid var(--primary-red);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-md);
}
.experience-item .exp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: var(--space-xs);
}
.experience-item .job-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-black);
    margin: 0;
}
.experience-item .company {
    color: var(--primary-red);
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}
.experience-item .date {
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}
.experience-item p { color: var(--text-secondary); margin: 8px 0; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--primary-black);
    color: var(--light-gray);
    padding: var(--space-lg) 0 var(--space-sm);
    margin-top: auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}
.footer-col h4 {
    color: var(--white);
    font-size: 1.05rem;
    margin-bottom: var(--space-sm);
    padding-bottom: 8px;
    position: relative;
}
.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 35px; height: 2px;
    background: var(--primary-red);
}
.footer-col p,
.footer-col li {
    color: var(--light-gray);
    font-size: 0.9rem;
    margin-bottom: 8px;
    line-height: 1.6;
}
.footer-col ul { list-style: none; }
.footer-col a { color: var(--light-gray); }
.footer-col a:hover { color: var(--primary-red); }
.footer-bottom {
    border-top: 1px solid var(--dark-gray);
    padding-top: var(--space-sm);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .navbar-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--primary-black);
        padding: var(--space-sm);
        gap: var(--space-xs);
    }
    .navbar-nav.show { display: flex; }
    .navbar-toggler { display: block; }
    
    .hero h1 { font-size: 2rem; }
    .hero .lead { font-size: 1rem; }
    .section-title { font-size: 1.6rem; }
    .stat-item .stat-number { font-size: 2.2rem; }
}


/* ============================================
   EXPERIENCE ITEM (public page)
   ============================================ */
.experience-item {
    background: var(--white);
    border-left: 4px solid var(--primary-red);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-md);
}
.experience-item .exp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: var(--space-xs);
}
.experience-item .job-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-black);
    margin: 0;
}
.experience-item .company {
    color: var(--primary-red);
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}
.experience-item .date {
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}
.experience-item p { color: var(--text-secondary); margin: 8px 0; }

/* ============================================================
   POLISH & ANIMATIONS
   ============================================================ */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Fade-in animation for sections */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in.delay-1 { animation-delay: 0.15s; }
.fade-in.delay-2 { animation-delay: 0.3s; }
.fade-in.delay-3 { animation-delay: 0.45s; }
.fade-in.delay-4 { animation-delay: 0.6s; }

/* Hero improvements */
.hero {
    position: relative;
    overflow: hidden;
}

.hero h1 {
    animation: fadeInUp 0.8s ease forwards;
}

.hero .lead {
    animation: fadeInUp 0.8s ease 0.15s backwards;
}

.hero .availability {
    animation: fadeInUp 0.8s ease 0.3s backwards;
}

.hero-buttons {
    animation: fadeInUp 0.8s ease 0.45s backwards;
}

/* Card hover lift */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Buttons get subtle scale on hover */
.btn {
    transition: transform 0.2s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.btn:hover {
    transform: translateY(-2px);
}

/* Skill item hover */
.skill-item {
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.skill-item:hover {
    border-color: var(--primary-red);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   SCROLL-TO-TOP BUTTON
   ============================================ */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-red);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(227, 27, 35, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
}
.scroll-top:hover {
    background: var(--hover-red);
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(227, 27, 35, 0.5);
}
.scroll-top.show {
    display: flex;
}

/* ============================================
   MOBILE RESPONSIVE IMPROVEMENTS
   ============================================ */
@media (max-width: 768px) {

    /* Header — better mobile menu */
    .site-header {
        padding: 0;
    }

    .navbar {
        padding: 12px 0;
    }

    .navbar-brand {
        font-size: 1.15rem;
    }

    .navbar-brand i {
        font-size: 1.3rem;
    }

    .navbar-nav {
        gap: 4px;
        padding: 12px 0;
    }

    .navbar-nav .nav-link {
        padding: 10px 16px;
        font-size: 0.95rem;
        border-radius: 4px;
    }

    .navbar-nav .nav-link.active::after {
        display: none;
    }

    .navbar-nav .nav-link.active {
        background: rgba(227, 27, 35, 0.15);
    }

    /* Hero */
    .hero {
        padding: 40px 0;
    }

    .hero h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }

    .hero .lead {
        font-size: 1rem;
        padding: 0 10px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        padding: 0 20px;
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    /* Sections */
    .section {
        padding: 40px 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
    }

    /* Stats grid — 2 per row on mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .stat-item .stat-number {
        font-size: 2rem;
    }

    .stat-item .stat-label {
        font-size: 0.75rem;
    }

    /* Experience items */
    .experience-item {
        padding: 16px;
    }

    .experience-item .exp-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .experience-item .date {
        margin-top: 4px;
        font-size: 0.85rem;
    }

    /* Skills grid — 3 per row on mobile */
    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .skill-item {
        padding: 12px 8px;
    }

    .skill-item i {
        font-size: 1.4rem;
    }

    .skill-item .skill-name {
        font-size: 0.75rem;
    }

    /* Cards */
    .card-body {
        padding: 20px;
    }

    .card-title {
        font-size: 1.1rem;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .social-links {
        justify-content: center;
    }

    /* Page header */
    .page-header {
        padding: 30px 0;
    }

    .page-header h1 {
        font-size: 1.6rem;
    }

    .page-header p {
        font-size: 0.95rem;
    }

    /* Forms on mobile */
    .form-grid {
        grid-template-columns: 1fr;
    }

    /* Scroll-top button smaller on mobile */
    .scroll-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
}

/* Extra small phones */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.6rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .site-header,
    .site-footer,
    .scroll-top,
    .hero-buttons {
        display: none;
    }

    body {
        font-size: 12pt;
        color: #000;
    }
}

/* ============================================
   MOBILE MENU — HARDENED FIX
   ============================================ */
@media (max-width: 768px) {

    .navbar {
        position: relative;
        flex-wrap: wrap;
    }

    .navbar-toggler {
        display: block !important;
        margin-left: auto;
        padding: 6px 12px;
    }

    .navbar-nav {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        width: 100%;
        flex-direction: column !important;
        background: #000 !important;
        padding: 12px !important;
        margin: 0 !important;
        gap: 4px !important;
        display: none;
        z-index: 9999;
        border-top: 1px solid #333;
        box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    }

    .navbar-nav.show {
        display: flex !important;
    }

    .navbar-nav li {
        width: 100%;
    }

    .navbar-nav .nav-link {
        display: block;
        width: 100%;
        padding: 12px 16px !important;
        border-radius: 4px;
        text-align: left;
    }

    .navbar-nav .nav-link.active::after {
        display: none;
    }

    .navbar-nav .nav-link.active {
        background: rgba(227, 27, 35, 0.2);
    }

    .navbar-nav .nav-link[href*="login"],
    .navbar-nav .nav-link[href*="dashboard"] {
        margin-left: 0 !important;
        text-align: center;
        margin-top: 6px;
    }
}