/* ========================================
   TopsMarket Landing Page Styles
   ======================================== */

/* CSS Variables */
:root {
    --primary: #375BE8;
    --primary-600: #2B49BA;
    --bg: #F7FAFF;
    --surface: #FFFFFF;
    --text: #0F172A;
    --muted: #64748B;
    --accent: #22D3EE;
    --ring: rgba(55, 91, 232, 0.25);
    --shadow: 0 10px 30px rgba(23, 64, 202, 0.08);
    --radius: 18px;
    --radius-sm: 12px;
    --radius-lg: 28px;
    --maxw: 1200px;
    --transition: all 0.3s ease;
}

/* Dark Mode Variables */
html.dark {
    --bg: #0F172A;
    --surface: #1E293B;
    --text: #F1F5F9;
    --muted: #94A3B8;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--transition);
}

body.no-scroll {
    overflow: hidden;
}

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

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

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: 24px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.required {
    color: #EF4444;
}

/* Section Title */
.section__title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text);
}

.section__subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 1.125rem;
    margin-bottom: 3rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-align: center;
}

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

.btn--primary:hover {
    background-color: var(--primary-600);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn--primary:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 2px;
}

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

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

.btn--large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn--small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Cards */
.card {
    background-color: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(23, 64, 202, 0.12);
}

.card__icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.card__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.card__text {
    color: var(--muted);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.card__link {
    color: var(--primary);
    font-weight: 600;
    transition: var(--transition);
}

.card__link:hover {
    color: var(--primary-600);
}

/* ========================================
   Topbar
   ======================================== */
.topbar {
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 0;
    font-size: 0.875rem;
}

.topbar__content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.topbar__text {
    margin: 0;
}

.topbar__link {
    color: white;
    text-decoration: underline;
    font-weight: 500;
}

.topbar__link:hover {
    opacity: 0.9;
}

/* ========================================
   Navbar
   ======================================== */
.nav {
    background-color: var(--surface);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.nav.scrolled {
    box-shadow: var(--shadow);
    background-color: var(--surface);
}

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

.nav__brand {
    font-size: 1.75rem;
    font-weight: 700;
}

.brand--red {
    color: #EF4444;
}

.brand--blue {
    color: #375BE8;
}

.text--red {
    color: #EF4444;
}

.text--blue {
    color: #375BE8;
}

.nav__menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav__list {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav__link {
    color: var(--text);
    font-weight: 500;
    transition: var(--transition);
}

.nav__link:hover {
    color: var(--primary);
}

.nav__cta {
    white-space: nowrap;
}

.nav__hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav__hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

.nav__hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav__hamburger.active span:nth-child(2) {
    opacity: 0;
}

.nav__hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Dark Mode Toggle */
.dark-toggle {
    background-color: var(--surface);
    border: 2px solid var(--muted);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.dark-toggle:hover {
    border-color: var(--primary);
    transform: scale(1.1);
}

.dark-toggle__icon {
    font-size: 1.25rem;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    padding: 5rem 0 3rem;
    background: linear-gradient(135deg, #EBF4FF 0%, #F7FAFF 50%, #E0F2FE 100%);
    position: relative;
    overflow: hidden;
}

html.dark .hero {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 50%, #1E3A5F 100%);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(55, 91, 232, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero__content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero__title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.hero__subtitle {
    font-size: 1.25rem;
    color: var(--muted);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero__buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero__image {
    position: relative;
    z-index: 1;
}

.hero__image img {
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(23, 64, 202, 0.15);
    width: 100%;
    height: auto;
    object-fit: contain;
    background: transparent;
    display: block;
}

.hero__image img::before {
    content: 'Hero Mockup';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--muted);
}

/* Partners Logo Bar */
.partners {
    padding: 2rem 0;
    background-color: var(--surface);
    margin-top: 3rem;
    overflow: hidden;
}

.partners__scroll {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.partners__track {
    display: flex;
    align-items: center;
    gap: 4rem;
    animation: scroll-partners 30s linear infinite;
    width: fit-content;
}

.partners__track:hover {
    animation-play-state: paused;
}

@keyframes scroll-partners {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.partners__logo {
    height: 50px;
    width: auto;
    min-width: 100px;
    object-fit: contain;
    transition: var(--transition);
    flex-shrink: 0;
}

.partners__logo:hover {
    transform: scale(1.1);
}

/* ========================================
   Highlights Section
   ======================================== */
.highlights {
    padding: 4rem 0;
}

.highlights__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

@media (min-width: 640px) {
    .highlights__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .highlights__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card--highlight {
    text-align: center;
    border: 2px solid transparent;
    transition: var(--transition);
}

.card--highlight:hover {
    border-color: var(--primary);
}

.card--highlight .card__icon {
    font-size: 4rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
}

/* ========================================
   Standards Section
   ======================================== */
.standards {
    padding: 5rem 0;
    background: linear-gradient(135deg, #EBF4FF 0%, #FFFFFF 100%);
}

html.dark .standards {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
}

.standards__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.standards__item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background-color: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.standards__item:hover {
    transform: translateX(8px);
    box-shadow: 0 10px 30px rgba(55, 91, 232, 0.15);
}

.standards__check {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

.standards__item p {
    margin: 0;
    color: var(--text);
    line-height: 1.6;
    font-size: 1rem;
}

@media (max-width: 639px) {
    .standards__list {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Services Section
   ======================================== */
.services {
    padding: 5rem 0;
    background-color: var(--bg);
}

.services__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.card--service {
    display: flex;
    flex-direction: column;
}

.card--service .card__link {
    margin-top: auto;
}

/* ========================================
   Features Section
   ======================================== */
.features {
    padding: 5rem 0;
    background-color: var(--surface);
}

.features__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.card--feature {
    text-align: center;
}

/* ========================================
   Portfolio Section
   ======================================== */
.portfolio {
    padding: 5rem 0;
    background: linear-gradient(135deg, #F0F9FF 0%, var(--bg) 50%, #EFF6FF 100%);
}

html.dark .portfolio {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #1E3A5F 100%);
}

.portfolio .container {
    max-width: 1400px;
}

.portfolio__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    margin-bottom: 4rem;
}

.portfolio__item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface);
    box-shadow: 0 4px 20px rgba(23, 64, 202, 0.08);
    border: 2px solid rgba(226, 232, 240, 0.5);
    display: flex;
    flex-direction: column;
}

.portfolio__image-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: linear-gradient(135deg, #F8FAFC 0%, #E0E7FF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.portfolio__image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: var(--transition);
    image-rendering: high-quality;
    image-rendering: -webkit-optimize-contrast;
}

.portfolio__info {
    padding: 1.5rem;
    background: var(--surface);
    border-top: 2px solid rgba(226, 232, 240, 0.5);
}

.portfolio__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.portfolio__category {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.portfolio__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(55, 91, 232, 0.95), rgba(34, 211, 238, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
}

.portfolio__item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(23, 64, 202, 0.2);
    border-color: var(--primary);
}

.portfolio__item:hover .portfolio__overlay {
    opacity: 1;
}

.portfolio__item:hover .portfolio__image-wrapper img {
    transform: scale(1.05);
}

.portfolio__more {
    text-align: center;
    padding: 2rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.portfolio__more-text {
    font-size: 1.125rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.portfolio-view-btn {
    background: white;
    color: var(--primary);
    border: 2px solid white;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.portfolio-view-btn span {
    font-size: 1.25rem;
}

.portfolio-view-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
}

/* ========================================
   Trusted Section
   ======================================== */
.trusted {
    padding: 5rem 0;
    background-color: var(--surface);
    text-align: center;
}

.trusted__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 4rem;
}

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

.trusted__label {
    font-size: 1.25rem;
    color: var(--muted);
}

.trusted__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 2rem;
    align-items: center;
    justify-items: center;
}

.trusted__grid img {
    height: 60px;
    width: auto;
    filter: grayscale(100%);
    opacity: 0.5;
    transition: var(--transition);
    background: #E2E8F0;
    padding: 12px;
    border-radius: 8px;
}

.trusted__grid img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* ========================================
   Testimonials Section
   ======================================== */
.testimonials {
    padding: 5rem 0;
    background-color: var(--bg);
}

.testimonials__carousel {
    position: relative;
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto;
}

.testimonials__track {
    display: flex;
    transition: transform 0.5s ease;
}

.testimonial__slide {
    min-width: 100%;
    padding: 1rem;
}

.testimonial__card {
    background-color: var(--surface);
    border-radius: var(--radius);
    padding: 3rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.testimonial__stars {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.testimonial__text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 2rem;
    font-style: italic;
}

.testimonial__author {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.testimonial__author img {
    width: 80px;
    height: 60px;
    object-fit: contain;
    background: #FFFFFF;
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 2px solid #E2E8F0;
}

.testimonial__logo {
    filter: grayscale(0%);
    opacity: 1;
}

.testimonial__name {
    font-weight: 600;
    color: var(--text);
}

.testimonial__company {
    color: var(--muted);
    font-size: 0.875rem;
}

.testimonials__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--surface);
    color: var(--text);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

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

.testimonials__btn--prev {
    left: -25px;
}

.testimonials__btn--next {
    right: -25px;
}

.testimonials__dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.testimonials__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--muted);
    cursor: pointer;
    transition: var(--transition);
}

.testimonials__dot.active {
    background-color: var(--primary);
    width: 32px;
    border-radius: 6px;
}

/* ========================================
   Blog Section
   ======================================== */
.blog {
    padding: 5rem 0;
    background-color: var(--surface);
}

.blog__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.card--blog {
    padding: 0;
    overflow: hidden;
}

.card--blog img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #E2E8F0;
}

.card--blog .card__content {
    padding: 2rem;
}

.card--blog .card__date {
    color: var(--muted);
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.75rem;
}

/* ========================================
   Contact Section
   ======================================== */
.contact {
    padding: 5rem 0;
    background-color: var(--bg);
}

.contact__wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
}

.contact__form {
    background-color: var(--surface);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form__group {
    display: flex;
    flex-direction: column;
}

.form__group--full {
    grid-column: 1 / -1;
}

.form__group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form__group input,
.form__group select,
.form__group textarea {
    padding: 0.875rem;
    border: 2px solid #E2E8F0;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--surface);
    color: var(--text);
    transition: var(--transition);
}

.form__group input:focus,
.form__group select:focus,
.form__group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

.form__group input.error,
.form__group select.error,
.form__group textarea.error {
    border-color: #EF4444;
}

.form__error {
    color: #EF4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.form__group.has-error .form__error {
    display: block;
}

.form__checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form__checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.contact__info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact__box {
    background-color: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.contact__box h3 {
    margin-bottom: 1.5rem;
    color: var(--text);
}

.contact__item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.contact__icon {
    font-size: 1.5rem;
}

.contact__item strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.contact__item p {
    color: var(--muted);
    margin: 0;
}

.contact__social {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.contact__social a {
    width: 50px;
    height: 50px;
    background-color: var(--surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.contact__social a:hover {
    background-color: var(--primary);
    transform: translateY(-2px);
}

.contact__map {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.contact__map iframe {
    width: 100%;
    height: 250px;
    display: block;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    background-color: var(--surface);
    padding: 4rem 0 2rem;
    border-top: 1px solid #E2E8F0;
}

.footer__top {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer__title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

.footer__links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer__links li {
    color: var(--muted);
}

.footer__links a {
    color: var(--muted);
    transition: var(--transition);
}

.footer__links a:hover {
    color: var(--primary);
}

.footer__links a[href^="tel"],
.footer__links a[href^="mailto"] {
    text-decoration: none;
    transition: var(--transition);
}

.footer__links a[href^="tel"]:hover,
.footer__links a[href^="mailto"]:hover {
    color: var(--primary);
    text-decoration: underline;
}

.footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid #E2E8F0;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer__copyright {
    color: var(--muted);
    margin: 0;
}

.footer__social {
    display: flex;
    gap: 1rem;
}

.footer__social a {
    width: 40px;
    height: 40px;
    background-color: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition);
}

.footer__social a:hover {
    background-color: var(--primary);
    transform: translateY(-2px);
}

/* ========================================
   Back to Top Button
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--primary-600);
    transform: translateY(-4px);
}

/* ========================================
   Portfolio Lightbox Modal
   ======================================== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
}

.lightbox__content {
    position: relative;
    width: 90vw;
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.lightbox__image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.lightbox__image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.lightbox__close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox__nav--prev {
    left: 2rem;
}

.lightbox__nav--next {
    right: 2rem;
}

.lightbox__counter {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.125rem;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    z-index: 10;
}

@media (max-width: 768px) {
    .lightbox__nav {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    
    .lightbox__nav--prev {
        left: 1rem;
    }
    
    .lightbox__nav--next {
        right: 1rem;
    }
    
    .lightbox__close {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }
    
    .lightbox__image-container {
        padding: 1rem;
    }
}

/* ========================================
   Toast Notification
   ======================================== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(200%);
    background-color: #10B981;
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    z-index: 10000;
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast__icon {
    font-size: 1.5rem;
    width: 30px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet (640px - 1023px) */
@media (max-width: 1023px) {
    .hero__content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero__buttons {
        justify-content: center;
    }

    .hero__image {
        order: -1;
    }

    .services__grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .features__grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .portfolio__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .portfolio__image-wrapper {
        height: 350px;
    }

    .contact__wrapper {
        grid-template-columns: 1fr;
    }

    .testimonials__btn--prev {
        left: 10px;
    }

    .testimonials__btn--next {
        right: 10px;
    }
}

/* Mobile (< 640px) */
@media (max-width: 639px) {
    /* Topbar - Hide on mobile */
    .topbar {
        display: none;
    }

    /* Navbar - Mobile Menu */
    .nav__menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background-color: var(--surface);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        overflow-y: auto;
        z-index: 999;
    }

    .nav__menu.active {
        right: 0;
    }

    .nav__list {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .nav__link {
        display: block;
        padding: 1rem;
        width: 100%;
        border-bottom: 1px solid #E2E8F0;
    }

    .nav__cta {
        width: 100%;
        margin-top: 1rem;
    }

    .dark-toggle {
        margin-top: 1rem;
    }

    .nav__hamburger {
        display: flex;
        z-index: 1000;
    }

    /* Hero */
    .hero {
        padding: 3rem 0 2rem;
    }

    .hero__title {
        font-size: 2rem;
    }

    .hero__subtitle {
        font-size: 1rem;
    }

    .hero__buttons {
        flex-direction: column;
    }

    .btn--large {
        width: 100%;
    }

    .partners__grid {
        gap: 1.5rem;
    }

    .partners__logo {
        height: 30px;
    }

    /* Sections */
    .section__title {
        font-size: 2rem;
    }

    .section__subtitle {
        font-size: 1rem;
    }

    .highlights__grid {
        grid-template-columns: 1fr;
    }

    .services__grid {
        grid-template-columns: 1fr;
    }

    .features__grid {
        grid-template-columns: 1fr;
    }

    .portfolio__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .portfolio__image-wrapper {
        height: 300px;
    }
    
    .portfolio__title {
        font-size: 1.125rem;
    }
    
    .portfolio__category {
        font-size: 0.8125rem;
    }
    
    .portfolio__more {
        padding: 1.5rem;
    }
    
    .portfolio__more-text {
        font-size: 1rem;
    }

    .trusted__number {
        font-size: 3rem;
    }

    .trusted__grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 1rem;
    }

    .blog__grid {
        grid-template-columns: 1fr;
    }

    /* Contact Form */
    .contact__form {
        grid-template-columns: 1fr;
        padding: 2rem;
    }

    .form__group {
        grid-column: 1;
    }

    /* Testimonials */
    .testimonial__card {
        padding: 2rem;
    }

    .testimonials__btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .testimonials__btn--prev {
        left: 5px;
    }

    .testimonials__btn--next {
        right: 5px;
    }

    /* Footer */
    .footer__top {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer__bottom {
        flex-direction: column;
        text-align: center;
    }

    /* Back to Top */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }

    /* Toast */
    .toast {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        transform: translateX(0) translateY(200%);
        max-width: calc(100% - 2rem);
    }

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

/* Medium screens adjustments */
@media (min-width: 640px) and (max-width: 1023px) {
    .services__grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .portfolio__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .portfolio__image-wrapper {
        height: 350px;
    }

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

    .trusted__grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Large screens adjustments */
@media (min-width: 1024px) {
    .services__grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .features__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .portfolio__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
    
    .portfolio__image-wrapper {
        height: 400px;
    }

    .trusted__grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Extra Large screens - 3 columns for portfolio */
@media (min-width: 1400px) {
    .portfolio__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
    
    .portfolio__image-wrapper {
        height: 350px;
    }
}

/* Focus Styles for Accessibility */
*:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .topbar,
    .nav,
    .back-to-top,
    .toast {
        display: none;
    }
}


