/**
 * Ely Property Services - Main Stylesheet
 * Mobile-responsive, SEO-optimized, fast-loading
 */

/* ============================================
   CSS Variables & Reset
   ============================================ */

:root {
    --primary-color: #2C3E50;
    --accent-color: #F28C28;
    --secondary-accent: #1E3A5F;
    --text-color: #FFFFFF;
    --text-dark: #333333;
    --bg-light: #F5F5F5;
    --bg-dark: #1A1A1A;
    --border-color: #E0E0E0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 5px 20px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --container-max-width: 1200px;
    --section-padding: 80px 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #FFFFFF;
    overflow-x: hidden;
}

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

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

ul {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* ============================================
   Container & Layout
   ============================================ */

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: var(--section-padding);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   Navigation
   ============================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--primary-color);
    z-index: 1000;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo-text {
    color: #FFFFFF !important;
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase !important;
    letter-spacing: 1px;
    transition: var(--transition);
}

.logo-text:hover {
    color: var(--accent-color);
}

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

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: var(--transition);
}

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

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: var(--transition);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

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

/* ============================================
   Hero Section
   ============================================ */

.hero {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-accent) 100%);
    color: var(--text-color);
    text-align: center;
    overflow: hidden;
    padding-top: 80px;
    padding-bottom: 40px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 1rem 2rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero-tagline {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-description {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 5px;
    transition: var(--transition);
    cursor: pointer;
}

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

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

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

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

/* ============================================
   Services Section
   ============================================ */

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

.services-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-top: 3rem;
    grid-auto-flow: row;
}

.service-card {
    background-color: #FFFFFF;
    padding: 0;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.service-image {
    width: 150px;
    height: 150px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-image img {
    width: 75%;
    height: 75%;
    object-fit: contain;
    transition: var(--transition);
}

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

.service-card h3 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding: 0 0.75rem;
    padding-bottom: 1rem;
    line-height: 1.3;
}

/* ============================================
   Gallery Section
   ============================================ */

.gallery {
    background-color: #FFFFFF;
}

.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    margin-top: 2rem;
}

.gallery-filter-btn {
    padding: 0.75rem 1.5rem;
    background-color: #FFFFFF;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: capitalize;
}

.gallery-filter-btn:hover {
    background-color: var(--primary-color);
    color: var(--text-color);
    transform: translateY(-2px);
}

.gallery-filter-btn.active {
    background-color: var(--accent-color);
    color: var(--text-color);
    border-color: var(--accent-color);
}

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

.gallery-item {
    opacity: 1;
    transform: scale(1);
    transition: var(--transition);
}

.gallery-item.hidden {
    display: none;
}

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

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(44, 62, 80, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-view {
    width: 60px;
    height: 60px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: var(--transition);
}

.gallery-view:hover {
    transform: scale(1.1);
    background-color: #E67E22;
}

.gallery-view svg {
    width: 30px;
    height: 30px;
}

/* ============================================
   Reviews Section
   ============================================ */

.reviews {
    background-color: var(--bg-light);
}

.reviews-carousel-container {
    position: relative;
    max-width: 900px;
    margin: 3rem auto 0;
    padding: 0 70px;
}

.reviews-carousel {
    position: relative;
    width: 100%;
    min-height: 200px;
}

.review-card {
    background-color: #FFFFFF;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 300px;
    min-height: 300px;
    max-height: 300px;
    transition: height 0.3s ease, max-height 0.3s ease;
}

.review-card.expanded {
    height: auto;
    max-height: none;
    min-height: 300px;
}

.review-stars {
    color: var(--accent-color);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.review-text-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
    min-height: 0;
    overflow: hidden;
}

.review-card.expanded .review-text-wrapper {
    overflow: visible;
}

.review-text {
    font-style: italic;
    color: #666;
    line-height: 1.8;
    font-size: 1.1rem;
    overflow: visible;
    word-break: normal;
    word-wrap: break-word;
    hyphens: none;
    display: block;
}

.review-card:not(.expanded) .review-text {
    overflow: hidden;
    max-height: calc(1.8em * 5); /* 5 lines - button is now outside text area */
}

.review-card.expanded .review-text {
    display: block !important;
    -webkit-line-clamp: none !important;
    max-height: none !important;
    overflow: visible !important;
}

.review-see-more {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0;
    margin: 0;
    margin-left: 1rem;
    text-align: right;
    align-self: flex-end;
    transition: color 0.3s ease;
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
}

.review-see-more:hover {
    color: var(--accent-color);
    text-decoration-thickness: 2px;
}

.review-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    width: 100%;
}

.review-author {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
    margin: 0;
    flex: 1;
}

.review-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--accent-color);
    color: #FFFFFF;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.review-nav-btn:hover {
    background-color: #E67E22;
    transform: translateY(-50%) scale(1.1);
}

.review-prev {
    left: 0;
}

.review-next {
    right: 0;
}

@media (max-width: 768px) {
    .reviews-carousel-container {
        padding: 0 60px;
    }
    
    .review-card {
        padding: 2rem;
    }
    
    .review-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* ============================================
   Contact Section
   ============================================ */

.contact {
    background-color: #FFFFFF;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

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

.contact-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    flex-shrink: 0;
}

.contact-icon svg {
    width: 24px;
    height: 24px;
}

.contact-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.contact-item p {
    color: #666;
    line-height: 1.6;
}

.contact-item a {
    color: var(--accent-color);
}

.contact-item a:hover {
    text-decoration: underline;
}

.contact-form-wrapper {
    background-color: var(--bg-light);
    padding: 2rem;
    border-radius: 10px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--primary-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.service-areas {
    margin-top: 3rem;
    text-align: center;
    padding: 2rem;
    background-color: var(--bg-light);
    border-radius: 10px;
}

.service-areas h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.service-areas p {
    color: #666;
    font-size: 1.1rem;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    background-color: var(--primary-color);
    color: var(--text-color);
    padding: 2rem 0;
    text-align: center;
}

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

.footer-info {
    text-align: center;
    width: 100%;
}

.footer-info p {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.footer-info a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer-info a:hover {
    color: #E67E22;
    text-decoration: underline;
}

.footer-admin-link {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ============================================
   Lightbox
   ============================================ */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    color: var(--text-color);
    font-size: 2rem;
    background-color: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: var(--accent-color);
}

.lightbox-close {
    top: 20px;
    right: 20px;
    font-size: 3rem;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

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

@media (max-width: 768px) {
    :root {
        --section-padding: 60px 15px;
    }

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

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

    .hero-tagline {
        font-size: 1.2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        background-color: var(--primary-color);
        flex-direction: column;
        padding: 2rem;
        transition: var(--transition);
        box-shadow: var(--shadow);
    }

    .nav-menu.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    
    
    .hero {
        min-height: 350px;
    }
    

    .contact-wrapper {
        grid-template-columns: 1fr;
    }

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

    .footer-info {
        text-align: center;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-filters {
        gap: 0.5rem;
    }
    
    .gallery-filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.75rem;
    }
    
    .service-card h3 {
        font-size: 0.95rem;
    }
}

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

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

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

    .service-card h3 {
        font-size: 0.9rem;
        padding: 0 0.5rem;
        padding-bottom: 0.75rem;
    }
    
    .service-image {
        width: 120px;
        height: 120px;
    }
    
    .service-image img {
        width: 75%;
        height: 75%;
    }


    .contact-form-wrapper {
        padding: 1.5rem;
    }
}

/* ============================================
   Performance Optimizations
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .hero-buttons,
    .contact-form-wrapper,
    .footer {
        display: none;
    }
}

