/* Base Mobile Settings */
html, body {
    -webkit-text-size-adjust: 100%;
    width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Base Styles */
body {
    background-color: rgb(181, 214, 240);
    font-family: 'Rowdies', sans-serif;
    font-weight: 550;
    margin: 0;
    padding: 0;
}

/* Header Styles */
header {
    background-color: steelblue;
    color: rgb(196, 196, 196);
    margin: 0;
    padding: 5px;
    text-align: center;
    width: 100%;
}

.header-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

.logo {
    height: auto;
    width: 200px; /* Change from fixed height to fixed width */
    max-width: 90vw; /* Ensure it doesn't overflow on mobile */
    margin-right: 15px;
}

/* Navigation Styles */
nav {
    background-color: steelblue;
    color: rgb(196, 196, 196);
    padding: 1px;
    text-align: center;
}

nav ul {
    list-style: none;
    font-size: large;
}

nav li {
    display: inline-block;
    margin-right: 5%;
}

a {
    text-decoration: none;
}

/* Main Content Grid Layout */
.main-content {
    display: grid;
    grid-template-columns: 300px 1fr 475px;
    gap: 50px;
    margin: 20px;
}

.text-left {
    grid-column: 1 / 2;
    background-color: rgba(241, 237, 237, 0.1);
    padding: 20px;
    border-radius: 8px;
    margin-left: 0;
    font-size: 18px;
}

.about-section {
    grid-column: 2 / 3;
    text-align: left;
    font-size: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 8px;
    justify-self: center;
    width: 100%;
    max-width: 600px;
}

.about-section h3 {
    text-decoration: underline;
}

.images-right {
    grid-column: 3 / 4;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-right: 0;
}

.right-img {
    width: 475px;
    height: auto;
    border-radius: 8px;
}

/* Heading Styles */
h3, h4, h5 {
    margin-top: 0;
    font-weight: bold;
}

.text-left h4, .text-left h5 {
    text-decoration: underline;
    margin-bottom: 15px;
}

/* Services Section */
#services {
    text-align: center;
    margin: 0 auto;
    padding: 20px 20px 0;
    width: 100%;
    box-sizing: border-box;
    background-color: steelblue;
    color: white;
}

#services h3 {
    margin-bottom: 30px;
    font-size: 24px;
}

#services ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 0 0 20px 0;
    max-width: 1000px;
    margin: 0 auto;
    list-style: none;
}

#services li {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 18px;
    flex: 0 1 calc(33.333% - 20px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

#services li:hover {
    transform: translateY(-5px);
    background-color: rgba(255, 255, 255, 0.2);
}

/* Review System Styles */
.stars {
    text-align: center;
    padding: 20px;
    margin-bottom: 40px;
}

/* Add clearfix to ensure proper spacing */
.stars::after {
    content: '';
    display: table;
    clear: both;
}

.read-more-btn {
    display: block;
    margin: 10px 0;
    background: none;
    border: none;
    color: steelblue;
    cursor: pointer;
    font-family: inherit;
    text-decoration: underline;
    padding: 5px 0;
}

.read-more-btn:hover {
    color: #4682B4;
}

/* Add margin below full review when visible */
.full-review {
    margin-top: 10px;
    margin-bottom: 20px; /* Add space below expanded review */
    width: 100%;
}

.review-text {
    width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Review Container */
.review-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Static Review Images Slideshow */
.review-slideshow {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: visible;
}

.review-slides {
    display: flex;
    transition: transform 0.7s ease;
    width: 100%;
}

/* Company Reply Styles */

.company-reply + .company-reply {
    display: none;
}

.company-reply {
    margin-top: 15px;
    display: flex;
    align-items: stretch;
}

.reply-marker {
    width: 4px;
    background-color: steelblue;
    border-radius: 4px 0 0 4px;
}

.reply-content {
    flex: 1;
    background-color: #344a5f;
    color: white;
    padding: 12px 15px;
    border-radius: 0 4px 4px 0;
}

.reply-header {
    color: #D4AF37;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.reply-text {
    font-size: 0.95em;
    line-height: 1.5;
}

/* Mobile styles */
@media screen and (max-width: 768px) {
    .reply-content {
        padding: 10px;
    }
    
    .reply-header {
        font-size: 0.85em;
    }
    
    .reply-text {
        font-size: 0.9em;
    }
}

.slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
    padding: 20px 40px;
    height: auto;
    overflow: visible;
}

.fb-review img {
    max-width: 600px;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Dynamic Reviews Display */
.dynamic-reviews {
    max-width: 800px;
    margin: 20px auto;
}

.review-item {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.review-content {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    height: auto;
    overflow: visible;
    color: rgb(194, 194, 194);
    background-color: #313131;
    border-radius: 8px;
}

.review-content p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    width: 100%;
    margin: 0 auto;
    max-width: 800px;
    padding: 20px 0;
}

.review-location {
    display: block;
    margin-top: 15px;
    text-align: right;
}

.review-date {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

/* Review Form Styles */
.name-group {
    margin-bottom: 20px;
}

.review-form-container h3 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 22px;
    font-weight: bold;
    color: rgb(0, 0, 0);
}

.anonymous-option {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.anonymous-option input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

#reviewerName:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.review-form-container {
    margin: 40px auto;
    max-width: 800px;
    padding: 0 20px;
    position: relative; /* Add this */
    z-index: 1; /* Add this to ensure form stays above expanded content */
}

.review-form {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
}

/* Rating System - Consolidated Styles */
.rating-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.rating-input-group label {
    font-weight: bold;
}

.rating-input {
    display: inline-flex; /* Change to inline-flex */
    flex-direction: row-reverse;
    gap: 5px;
    margin-left: 10px; /* Add space after Rating: */
    vertical-align: middle; /* Align with the label */
}

.rating-input input[type="radio"] {
    display: none;
}

.rating-input label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.rating-input + .error-message {
    margin-top: 5px;
    clear: both;
}

.house-icon {
    width: 25px;
    height: 25px;
    fill: #484848; /* Default unfilled color */
    transition: fill 0.2s ease;
}

/* Hover and active states for input */
.rating-input label:hover .house-icon,
.rating-input label:hover ~ label .house-icon,
.rating-input input:checked ~ label .house-icon {
    fill: #D4AF37; /* Gold color when selected or hovered */
    filter: drop-shadow(0 0 2px rgba(212, 175, 55, 0.4));
}

/* Optional: Add a subtle hover glow */
.rating-input label:hover .house-icon {
    filter: drop-shadow(0 0 2px rgba(212, 175, 55, 0.4));
}

/* Display styles for showing ratings */
.rating-display {
    order: 2; /* Changed to 2 to move it to the right */
    display: flex;
    gap: 5px;
}

.rating-display .house-icon {
     width: 20px;
    height: 20px;
}

.rating-display .house-icon.filled {
    fill: #D4AF37; /* Match the input color */
}

.rating-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    justify-content: flex-end; /* Add this to align to the right */
}

.rating-label {
    font-weight: bold;
    color: #a4a4a4;
    margin-right: 5px;
}


/* Position rating in review */
.review-header {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
}

.review-meta {
    text-align: left; /* Changed to left align */
    order: 1; /* Changed to 1 to move it to the left */
}

/* Form Input Styles */
textarea, input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    font-size: 16px;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

textarea:focus, input:focus, select:focus {
    outline: none;
    border-color: steelblue;
    box-shadow: 0 0 5px rgba(70, 130, 180, 0.3);
}

/* Submit Button */
.submit-btn {
    background-color: steelblue;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
    transition: all 0.3s ease !important;
}

.submit-btn:hover {
    background-color: #4682B4 !important;
    transform: translateY(-2px) !important;
}

.submit-btn:active {
    transform: translateY(0);
}

/* Success message styling */
.success-message {
    background-color: #dff0d8;
    color: #3c763d;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    display: none;
    animation: fadeIn 0.7s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.error-message {
    display: none;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
    padding-left: 2px;
    animation: shake 0.2s ease-in-out;
}

.form-group {
    position: relative;
    margin-bottom: 20px;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #dc3545;
}

/* Shake animation for error messages */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Style for invalid form fields */


/* Success message styling */
.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    display: none;
    animation: fadeIn 0.3s ease-in;
}

/* Error message styling */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 8px;
    margin-top: 5px;
    border-radius: 4px;
    font-size: 0.875rem;
    display: none;
}

/* Fade in animation for messages */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Remove the hr before footer */
hr:last-of-type {
    display: none;
}

/* Footer */
footer {
    text-align: right;
    font-size: 6pt;
    font-weight: 550;
    background-color: steelblue;
    padding: 20pt;
    margin-top: 0; /* Ensure no gap */
    border-top: 1px solid rgba(255, 255, 255, 0.2); /* Semi-transparent white line */
}

/* Media Queries */
@media screen and (max-width: 768px) {
    /* Base Mobile Layout */
    body {
        overflow-x: hidden;
        min-width: 320px;
    }
   
    /* Main Content Mobile Layout */
    .main-content {
        display: flex;
        flex-direction: column;
        padding: 10px;
        width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    .text-left, .about-section {
        width: 100%;
        margin: 10px 0;
        padding: 15px;
        text-align: center;
        box-sizing: border-box;
    }

    .images-right {
        display: none !important;
    }

    /* Header Adjustments */
    header {
        padding: 10px 5px;
    }
   
    .logo {
        width: 150px;
        margin-right: 10px;
    }
   
    header h1 {
        font-size: 20px;
        margin: 5px 0;
    }

    header h2 {
        font-size: 16px;
        margin: 5px 0;
    }

    /* Mobile Reviews Styles */
    .review-date {
        color: rgb(194, 194, 194);
        font-size: 14px;
        margin-top: 8px;
    }
   
    .slide {
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
        height: auto !important;
        min-height: auto;
        transform: none;
        margin: 0;
    }

    .review-slideshow {
        height: auto;
        overflow: visible;
        position: relative;
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
    }

    .review-slides {
        height: auto;
        padding: 0;
    }

    .fb-review img {
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    .review-content {
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
        padding: 20px;
        height: auto;
        overflow: visible;
        color: rgb(194, 194, 194);
        background-color: #313131;
        border-radius: 8px;
    }

    .review-text {
        width: 100%;
        overflow: visible;
        font-size: 14px;
        line-height: 1.4;
        word-wrap: break-word;
        box-sizing: border-box;
    }

    .review-location {
        color: rgb(194, 194, 194);
        display: block;
        margin-top: 15px;
        text-align: right;
        line-height: 1.5;
    }

    /* Rating Styles for Mobile */
    .rating-container {
        margin: 10px 0;
        gap: 5px;
    }

    .rating-label {
        font-size: 14px;
        color: rgb(194, 194, 194);
    }

    .house-icon {
        width: 20px;
        height: 20px;
    }

    .review-header {
        flex-direction: row;
        gap: 10px;
        align-items: center;
    }

    .review-meta {
        text-align: left;
        width: auto;
    }

    /* Mobile Form Styles */
    .form-row {
        flex-direction: column;
    }

    /* Mobile Services */
    #services ul {
        gap: 15px;
    }

    #services li {
        flex: 0 1 calc(50% - 15px);
        font-size: 16px;
        padding: 12px 20px;
    }
}

/* iPhone Specific */
@media screen and (max-width: 480px) {
    body {
        min-width: 320px;
    }

    #services li {
        flex: 0 1 100%;
    }

    .review-header {
        gap: 8px;
    }
   
    .review-form-container {
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .review-text {
        font-size: 0.9em;
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .rating-display .house-icon {
        width: 18px;
        height: 18px;
    }

    .rating-container {
        margin: 5px 0;
    }

    .rating-label {
        font-size: 13px;
    }

    .review-meta {
        font-size: 0.9em;
    }

    .review-content {
        width: 100%;
        box-sizing: border-box;
        padding: 10px;
    }

    .slide {
        padding: 5px;
    }

    .review-location {
        display: block;
        margin-top: 15px;
        text-align: right;
    }
}