@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

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

:root {
    --primary-color: #ff7300;
    --primary-dark: #e06600;
    --secondary-color: #333;
    --accent-color: #ffb366;
    --text-light: #ffffff;
    --text-dark: #333;
    --background-light: #f8f9fa;
    --background-dark: #2c3e50;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
    --gradient: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --primary: #c89c4c;
    --font-sans: 'Poppins', sans-serif;
}

body, html {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Touch improvements for mobile */
.gallery-item,
.service-item,
.category-item,
.btn,
.btn-view-gallery,
.mobile-nav-toggle {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Improve scrolling on mobile */
* {
    -webkit-overflow-scrolling: touch;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background: #1a1a1a;
    backdrop-filter: blur(10px);
    color: var(--text-light);
    padding: 15px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.logo-box {
    display: flex;
    align-items: center;
}

.logo-link {
    display: inline-block;
}

.logo-img {
    height: 65px;
    width: auto;
    display: block;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.desktop-nav ul {
    display: flex;
    align-items: center;
    gap: 10px;
}

.desktop-nav ul li a {
    color: var(--text-light);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
    position: relative;
    letter-spacing: 0.5px;
}

.desktop-nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient);
    transition: width 0.3s ease;
}

.desktop-nav ul li a:hover::after,
.desktop-nav ul li a.active::after {
    width: 70%;
}

.desktop-nav ul li a:hover,
.desktop-nav ul li a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.mobile-nav-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    padding: 5px;
    border-radius: 4px;
}

.mobile-nav-toggle:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

.mobile-nav-toggle.active {
    color: var(--primary-color);
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: var(--secondary-color);
    backdrop-filter: blur(10px);
    padding: 80px 20px 20px;
    transition: var(--transition);
    z-index: 999;
    box-shadow: var(--shadow);
}

.mobile-nav.active {
    right: 0;
}

/* Mobile navigation backdrop */
.mobile-nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-nav-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Prevent body scroll when mobile nav is open */
body.nav-open {
    overflow: hidden;
}

.mobile-nav ul {
    list-style: none;
}

.mobile-nav ul li {
    margin-bottom: 20px;
}

.mobile-nav ul li a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    display: block;
    transition: var(--transition);
}

.mobile-nav ul li a:hover,
.mobile-nav ul li a.active {
    background: var(--gradient);
    transform: translateX(10px);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('/assets/images/misc/background.jpg') no-repeat center center/cover;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
    color: var(--text-light);
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 115, 0, 0.1), rgba(255, 179, 102, 0.1));
}

.hero-content {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 60px 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease-out;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 15px 35px;
    background: var(--gradient);
    color: var(--text-light);
    text-decoration: none;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.btn-view-gallery {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 24px;
    background: var(--gradient);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.btn-view-gallery:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Section Styles */
.services, .other-services, .about, .contact {
    padding: 100px 0;
    position: relative;
}

.services {
    background: var(--background-light);
}

.other-services {
    background: var(--background-dark);
    color: var(--text-light);
}

.about {
    background: var(--background-dark);
    color: var(--text-light);
}

.contact {
    background: var(--background-dark);
    color: var(--text-light);
}

.services h2, .other-services h2, .about h2, .contact h2 {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    margin-bottom: 60px;
    text-align: center;
    font-weight: 700;
}

.services h2 {
    color: var(--text-dark);
}

.other-services h2, .about h2, .contact h2 {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Service Grid */
.service-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 60px;
}

.service-item--centered {
    grid-column: 2;
}

.service-item {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.service-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 4px;
    background: var(--gradient);
    transition: var(--transition);
}

.service-item:hover::before {
    left: 0;
}

.service-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.service-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    transition: var(--transition);
}

.service-item:hover img {
    transform: scale(1.05);
}

.service-item h3 {
    margin: 20px 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
}

/* Other Services */
.services-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.services-list h3 {
    font-size: 24px;
    margin: 30px 0 20px;
    color: var(--primary-color);
    font-weight: 600;
}

.services-list p {
    margin: 10px 0;
    font-size: 16px;
    opacity: 0.9;
}

/* About and Contact */
.about p {
    font-size: 18px;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    opacity: 0.9;
}

.contact {
    text-align: center;
}

.contact p {
    font-size: 20px;
    margin: 15px 0;
    font-weight: 500;
}

/* Footer */
footer {
    background: var(--secondary-color);
    color: var(--text-light);
    text-align: center;
    padding: 30px 0;
    border-top: 3px solid var(--primary-color);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    .container {
        padding: 0 15px;
    }

    .desktop-nav {
        display: none;
    }

    .mobile-nav-toggle {
        display: block;
    }

    .hero-content {
        padding: 40px 20px;
    }

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

    .hero p {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .service-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .service-item--centered {
        grid-column: 1;
    }

    .service-item {
        padding: 20px;
    }

    .services, .other-services, .about, .contact {
        padding: 60px 0;
    }

    .services h2, .other-services h2, .about h2, .contact h2 {
        font-size: 2rem;
    }

    .services-content {
        padding: 20px;
    }

    /* Gallery improvements for mobile */
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 15px;
    }

    .gallery-item {
        min-height: 280px;
    }
}

@media screen and (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .hero-content {
        padding: 30px 15px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 14px;
    }

    .service-item {
        padding: 15px;
        margin-bottom: 15px;
    }

    .service-item h3 {
        font-size: 1.2rem;
    }

    .btn, .btn-view-gallery {
        padding: 10px 20px;
        font-size: 14px;
    }

    /* Mobile navigation improvements */
    .mobile-nav {
        width: 280px;
        padding: 70px 15px 20px;
    }

    .mobile-nav ul li a {
        font-size: 16px;
        padding: 10px 15px;
    }

    /* Gallery improvements for small screens */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .gallery-item {
        min-height: 250px;
    }

    /* Typography adjustments */
    .services h2, .other-services h2, .about h2, .contact h2 {
        font-size: 1.8rem;
    }

    .about p {
        font-size: 15px;
        line-height: 1.7;
        padding: 0 10px;
    }

    .contact p {
        font-size: 18px;
        margin: 10px 0;
    }
}

/* Smooth scrolling and performance optimizations */
html {
    scroll-behavior: smooth;
}

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

/* Focus styles for accessibility */
a:focus, button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading animation */
.loading {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* =========================================
   Gallery Subpage Styles (Hardwood, etc.)
   ========================================= */

.gallery-subpage {
    padding: 120px 0 60px;
    background: var(--background-light);
    min-height: 100vh;
}

.gallery-subpage .gallery-header {
    text-align: center;
    margin-bottom: 60px;
}

.gallery-subpage .gallery-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    aspect-ratio: 1 / 1;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* =========================================
   Enhanced Modal Styles
   ========================================= */

.modal {
    display: flex;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

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

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    transition: transform 0.3s ease-out;
}

.modal-img {
    width: 100%;
    height: auto;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: auto;
    min-height: 50px;
    font-size: 16px;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: none;
    }

    .close {
        top: 10px;
        right: 15px;
        font-size: 35px;
    }

    #caption {
        width: 95%;
        font-size: 14px;
        padding: 5px 0;
        height: auto;
        min-height: 50px;
    }

    /* Touch-friendly modal controls */
    .modal-controls {
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 10px;
        background: rgba(0, 0, 0, 0.7);
        padding: 10px;
        border-radius: 25px;
    }

    .modal-btn {
        background: rgba(255, 255, 255, 0.2);
        border: none;
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        font-size: 18px;
        cursor: pointer;
        transition: var(--transition);
        display: flex;
        align-items: center;
        justify-content: center;
    }

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

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        margin: 10px auto;
    }

    .close {
        font-size: 30px;
        top: 5px;
        right: 10px;
    }

    .modal-controls {
        bottom: 10px;
        gap: 8px;
        padding: 8px;
    }

    .modal-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}