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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 20px; /* Adjusted padding */
}

.header-logo {
    height: 60px; /* Increased size */
    margin-right: 10px;
    /* Add styles for single color/vazado look if needed, e.g., filter */
    /* filter: invert(30%) sepia(30%) saturate(2000%) hue-rotate(240deg) brightness(80%) contrast(100%); /* Example filter for color */
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #764ba2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center; /* Align items vertically */
    flex-wrap: wrap;
}

.logo .by-rafael {
    font-size: 1em; /* Keep it relative */
    font-weight: 700;
    color: #764ba2;
    margin-left: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap; /* Prevent breaking "by Rafael Sรก" */
}

/* Navigation */
.nav {
    position: relative;
}

.hamburger {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #764ba2;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

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

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

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

.nav-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 200px;
    list-style: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 0;
}

.nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.nav-menu li {
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
    opacity: 1;
    max-height: 100px;
    overflow: hidden;
}

.nav-menu li:last-child {
    border-bottom: none;
}

/* Hide category links by default */
/* This rule is no longer needed as category links are removed from nav */
/*
.nav-menu:not(.show-categories) li.nav-category-link {
    opacity: 0;
    max-height: 0;
    pointer-events: none;
    border-bottom: none;
    padding-top: 0;
    padding-bottom: 0;
}
*/

.nav-menu li a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-menu li a:hover {
    background: #f8f9fa;
    color: #764ba2;
    padding-left: 30px;
}

.nav-menu li.nav-category-link a {
    padding-left: 30px;
    font-size: 0.95rem;
    color: #555;
}

.nav-menu li.nav-category-link a:hover {
    padding-left: 40px;
    color: #764ba2;
}

/* Main Content */
.main {
    margin-top: 80px; /* Adjusted margin to clear the slightly taller header */
    padding: 0; /* Removed padding to control space with section padding */
}

/* Hero Section */
.hero {
    padding: 2rem 0 3rem 0; /* Adjusted padding-top and padding-bottom */
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column; /* Stack children vertically */
    align-items: center;
}

.hero .container {
    width: 100%;
    text-align: center; /* Center content within container */
}

.hero-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem; /* Less space below title */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-top: 0; /* Ensure no extra top margin */
}

/* New Hero Subtitle */
.hero-subtitle {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem; /* Space before the categories grid */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 0; /* Remove margin bottom, use padding on hero/main if needed */
}

.category-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: #764ba2;
}

.category-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #764ba2;
    margin-bottom: 1rem;
}

.category-card p {
    color: #666;
    font-size: 1rem;
}

/* New "Other Services" Styles */
.other-services-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    margin-top: 3rem; /* Space above this section */
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.other-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem; /* Space before the footer/end of main */
}

/* Reuse category card styles for service cards */
.service-card {
     background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: #667eea; /* Slightly different hover color */
}

.service-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #764ba2;
    margin-bottom: 1rem;
}

.service-card p {
    color: #666;
    font-size: 1rem;
}

/* Placeholder Section Styles (for About, Contact) */
#contato-section {
    padding: 0; /* Removed padding, relies on adjacent elements' margins/padding */
    min-height: auto; /* Removed min-height */
}

/* Popup Styles (Budget and Contact) */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    transform: scale(0.7);
    transition: all 0.3s ease;
    color: white;
}

.popup-overlay.active .popup-content {
    transform: scale(1);
}

/* Styles for both Close and Back buttons */
.popup-close,
.popup-back {
    position: absolute;
    top: 1.2rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: bold;
    color: #764ba2;
    cursor: pointer;
    display: flex; /* Use flex to center icon/text */
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.popup-close {
     right: 1.2rem; /* Position close button on the right */
     /* For the 'X' character */
     font-weight: normal;
  top: 90px;
}

.popup-back {
     left: 1.2rem; /* Position back button on the left */
     /* For the Font Awesome icon */
     font-size: 1.1rem; /* Adjust size for icon */
     padding-top: 2px; /* Slight adjustment if needed */
}

.popup-close:hover,
.popup-back:hover {
    background: white;
    transform: scale(1.1);
}

.popup-back i {
    /* Ensure the icon inherits color */
    color: #764ba2;
}

.popup-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-top: 1rem; /* Add top margin to leave space for buttons */
}

/* Popup Step Sections (Budget) */
.popup-step {
    margin-bottom: 2rem;
}

.popup-step h3 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1.5rem;
}

/* Modality Options Grid (Budget) */
.modality-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.modality-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    color: #333;
}

.modality-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: #764ba2;
}

.modality-card h4 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #764ba2;
}

/* Choice Options Grid (Budget) */
.choice-options-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.choice-button {
    display: block;
    width: 100%;
    max-width: 300px;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #764ba2;
    border: 2px solid #764ba2;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.choice-button:hover {
    background: #764ba2;
    color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* Pricing Section (used within budget popup for predefined) */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.pricing-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.pricing-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #764ba2;
    margin-bottom: 1.5rem;
    text-align: center;
}

.price-group {
    margin-bottom: 1rem;
    color: #333;
}

.price-group h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.8rem;
}

.price-item {
    background: rgba(118, 75, 162, 0.2); /* Lilac-ish color */
    padding: 0.8rem 1.2rem;
    margin-bottom: 0.5rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    color: #333;
    border: 1px solid rgba(118, 75, 162, 0.3);
    transition: all 0.2s ease;
}

.price-item:hover {
    background: rgba(118, 75, 162, 0.3);
    border-color: rgba(118, 75, 162, 0.5);
}

.price-item .price-text {
    flex-grow: 1;
    margin-right: 1rem;
    font-weight: 500;
    color: #333;
}

.price-item .buy-button {
    background: #764ba2;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.price-item .buy-button:hover {
    background: #667eea;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.price-group p {
    display: none;
}

/* Notice (used within popup) */
.notice {
    text-align: center;
    margin: 2rem 0;
}

.notice p {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #764ba2;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    display: inline-block;
    animation: pulse 2s infinite;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 2px dashed #764ba2;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* Calculator (used within budget popup for manual) */
/* No specific calculator class, styles applied to elements within step-manual-calculator */

#step-manual-calculator label,
#step-manual-calculator h3 {
    color: white; /* Ensure labels and section title are white */
}

#step-manual-calculator .total-price h4 {
    color: white; /* Ensure "Total to pay" title is white */
    margin-bottom: 0.5rem; /* Add space below the title */
    font-size: 1.5rem; /* Match h4 style */
}

#step-manual-calculator .total-price span {
     color: white;
     font-weight: 700;
     font-size: 2.5rem;
     text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
     display: block; /* Make it a block element */
     margin-top: 0.5rem; /* Space above the amount */
     text-align: center; /* Center the amount */
}

#step-manual-calculator .form-group select {
    padding: 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    color: #333;
    transition: all 0.3s ease;
}

.calculator-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.form-group label {
    font-weight: 500;
    color: white;
    margin-bottom: 0.5rem;
}

.form-group select,
.form-group input[type="password"],
.form-group input[type="text"],
.form-group textarea {
    padding: 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    color: #333;
    transition: all 0.3s ease;
}

.form-group select:focus,
.form-group input[type="password"]:focus,
.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1);
}

.total-price {
    text-align: center;
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.total-price h4 {
    font-size: 1.5rem;
    color: white;
    margin-bottom: 0.5rem;
}

.total-price span {
    color: white;
    font-weight: 700;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.cta-button {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 1rem 2rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* Style for the pulsating WhatsApp link in chat */
.whatsapp-link {
    color: #25d366; /* WhatsApp green */
    font-weight: bold;
    text-decoration: none;
    animation: pulse-whatsapp 1.5s infinite ease-in-out;
    display: inline-block; /* Needed for animation */
}

.whatsapp-link:hover {
    text-decoration: underline;
}

@keyframes pulse-whatsapp {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- Services Popup Styles --- */
#services-popup-overlay .popup-content {
     max-width: 1000px; /* Adjust max width if needed */
     padding: 2rem;
}

/* Style the categories grid when inside the popup */
.popup-categories-grid {
    /* Inherits from .categories-grid */
    /* Can add specific styles here if needed, e.g., slightly smaller gap or minmax */
}

/* --- Contact Popup Styles --- */
#contact-popup-overlay .popup-content {
    /* Specific styles for contact popup content if needed, inherits from .popup-content */
    max-width: 800px; /* Maybe slightly smaller max-width for contact icons */
    text-align: center; /* Center title and icons */
}

.contact-icons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* Responsive grid for icons */
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 0 1rem; /* Add some padding */
    justify-items: center; /* Center the items within their grid cells */
}

.contact-icon-link {
    display: flex; /* Use flexbox */
    flex-direction: column; /* Stack circle and text */
    align-items: center; /* Center horizontally */
    text-decoration: none;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    transition: transform 0.3s ease, opacity 0.3s ease;
    gap: 0.5rem; /* Space between circle and text */
    width: 100%; /* Allow links to take full grid cell width */
    max-width: 120px; /* Limit max width of the link container */
}

.contact-icon-link:hover {
    transform: translateY(-5px);
    opacity: 0.9;
}

.contact-icon-circle {
     display: flex;
     align-items: center;
     justify-content: center;
     width: 90px; /* Size of the circle */
     height: 90px; /* Size of the circle */
     border-radius: 50%;
     background: rgba(255, 255, 255, 0.2); /* Subtle transparent white background */
     transition: background 0.3s ease;
}

.contact-icon-link:hover .contact-icon-circle {
    background: rgba(255, 255, 255, 0.3); /* Slightly more visible on hover */
}

.contact-icon-circle img {
    width: 60px; /* Icon size */
    height: 60px;
    /* margin-bottom: 0.5rem; /* Removed margin-bottom */
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3)); /* Keep shadow */
    transition: transform 0.3s ease;
    filter: none; /* Ensure no color filter is applied by CSS */
}

/* Add styles for Font Awesome icons */
.contact-icon-circle i {
    font-size: 40px; /* Adjust font size to match img size */
    color: rgba(255, 255, 255, 0.9); /* Set icon color to white with some transparency */
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3)); /* Add shadow to icons */
    transition: transform 0.3s ease, color 0.3s ease;
}

.contact-icon-link:hover .contact-icon-circle i {
    transform: scale(1.1); /* Grow icon on hover */
    color: white; /* Make color fully white on hover */
}

.contact-icon-link span {
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

/* --- SรกBot Chatbot Styles --- */
.sabot-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1500; /* Below popups but above content */
}

.sabot-icon:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

#sabot-chat-overlay .popup-content {
    /* Increased width and height */
    width: 90vw; /* Use viewport width */
    max-width: 95vw; /* Max width */
    height: 90vh; /* Use viewport height */
    max-height: 95vh; /* Max height */
    display: flex;
    flex-direction: column;
    padding: 1.5rem; /* Adjust padding */
}

.sabot-title {
     font-size: 1.8rem; /* Smaller title for chat */
     margin-top: 0; /* Remove top margin */
     margin-bottom: 1rem; /* Space below title */
}

.chat-messages {
    flex-grow: 1; /* Take available space */
    overflow-y: auto; /* Enable scrolling */
    padding-right: 10px; /* Space for scrollbar */
     scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    border: 2px solid transparent;
}

.message {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
    max-width: 85%;
    position: relative; /* Needed for sender name */
    color: #333; /* Default text color */
    word-wrap: break-word; /* Prevent overflow */
    font-size: 1rem; /* Default message font size */
}

.message .sender-name {
    font-weight: bold;
    margin-right: 5px;
    color: #764ba2; /* Color for sender name */
}

.bot-message {
    background: rgba(255, 255, 255, 0.95);
    align-self: flex-start; /* Align to the left */
    border-bottom-left-radius: 2px;
}

.user-message {
    background: #e0e0e0; /* Lighter background for user */
    align-self: flex-end; /* Align to the right */
    border-bottom-right-radius: 2px;
    color: #333;
}

.chat-input {
    /* If using text input */
    /* display: flex;
    gap: 10px; */
}

.predefined-questions {
    display: grid; /* Use grid for columns */
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 10px; /* Space between buttons */
}

.question-button {
    width: 100%; /* Ensure buttons fill grid column */
    padding: 8px 12px; /* Reduced padding */
    background: rgba(255, 255, 255, 0.9);
    color: #764ba2;
    border: 1px solid rgba(118, 75, 162, 0.3);
    border-radius: 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem; /* Reduced font size */
    word-wrap: break-word; /* Allow text wrapping */
    white-space: normal; /* Ensure text wraps */
}

.question-button:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #764ba2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* --- Students Popup Styles --- */
#students-popup-overlay .popup-content {
    max-width: 800px; /* Set a max width, can adjust */
    text-align: center;
}

.students-list-grid {
    display: flex; /* Changed to flexbox */
    flex-wrap: wrap; /* Allow items to wrap */
    gap: 1rem; /* Space between items */
    margin-top: 2rem;
    justify-content: center; /* Center the flex items */
}

.student-name {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    font-size: 1rem; /* Decreased font size */
    font-weight: 500;
    color: #764ba2;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    text-transform: uppercase; /* Make names uppercase */
    flex: 0 1 auto; /* Allow items to shrink/grow based on content */
}

.student-name:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
}

/* --- Password Popup Styles (Generic for Student and Level Test) --- */
/* .password-popup-content is used by both password popups */
.password-popup-content {
    max-width: 400px; /* Smaller max width for password popup */
    padding: 1.5rem; /* Adjusted padding */
    /* Inherits background, border-radius, etc. from .popup-content */
    text-align: center;
}

.password-popup-title {
    font-size: 1.5rem; /* Smaller title for password popup */
    margin-bottom: 1.5rem;
    margin-top: 0; /* Remove top margin */
    color: white; /* Ensure title is white */
}

.password-form {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* Space between form elements */
}

.password-form .form-group {
    /* Styles inherited */
}

.password-form .form-group label {
    /* Styles inherited */
     color: white; /* Ensure label is white */
}

.password-form .form-group input[type="password"] {
     width: 100%; /* Input fills container */
     /* Other styles inherited */
}

.password-form .cta-button {
     max-width: 200px; /* Smaller button */
     padding: 0.8rem 1.5rem;
     font-size: 1rem;
}

.error-message {
    color: red; /* Default error color */
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-align: center;
}

/* --- New: Other Service Info Popup Styles --- */
#other-service-info-overlay .other-service-info-content {
    max-width: 600px; /* Adjust size as needed */
    padding: 2rem;
    text-align: center;
    display: flex; /* Use flexbox for layout */
    flex-direction: column; /* Stack items */
    align-items: center; /* Center items horizontally */
}

#other-service-info-overlay .popup-title {
     font-size: 2rem; /* Match other popup titles */
     margin-bottom: 1.5rem;
     margin-top: 1rem; /* Add top margin */
}

.service-info-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

#other-service-info-overlay .cta-button {
    /* Inherits from .cta-button */
     max-width: 250px; /* Adjust button size */
     /* Added border style */
    border: 2px solid white;
}

/* --- New: Level Test Popup Styles --- */
#level-test-popup-overlay .popup-content {
    max-width: 900px; /* Adjust max width for the test content */
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

#level-test-popup-overlay .popup-title {
    margin-top: 1rem; /* Add top margin */
    margin-bottom: 1.5rem; /* Space below title */
}

.level-test-form {
    display: flex;
    flex-direction: column;
    gap: 2rem; /* Space between questions */
}

.test-question {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    color: #333;
}

.test-question p strong {
    color: #764ba2; /* Highlight question number/title */
    font-size: 1.1rem;
}

.test-question p {
    margin-bottom: 1rem;
    line-height: 1.5;
}

.test-question label {
    display: block; /* Stack radio/checkbox options */
    margin-bottom: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
}

.test-question input[type="radio"],
.test-question input[type="checkbox"] {
    margin-right: 0.5rem;
}

.test-question input[type="text"],
.test-question textarea {
     display: block; /* Take full width */
     width: 100%;
     margin-top: 1rem;
     /* Inherits styles from .form-group input/textarea */
}

.test-question .reading-text {
    background: rgba(118, 75, 162, 0.1); /* Subtle background for reading text */
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 1px dashed rgba(118, 75, 162, 0.3);
    font-style: italic;
    color: #555;
    line-height: 1.6;
}

/* Style for the Audio Player (Question 8) */
#question-8 audio {
     display: block; /* Make audio player a block element */
     width: 100%; /* Make audio player fill the width */
     margin: 1rem 0; /* Add space above and below */
     /* Add minimal styling to make it fit in the card */
     border-radius: 5px;
     box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Style for the Audio Controls (Speed) */
.audio-controls {
     display: flex;
     justify-content: center; /* Center controls */
     align-items: center;
     gap: 1rem; /* Space between buttons and speed display */
     margin-top: 0.5rem; /* Space below the audio player */
     margin-bottom: 1rem; /* Space above the textarea */
     font-size: 1rem;
     color: #333; /* Text color */
}

.audio-controls button {
     padding: 0.5rem 1rem;
     background: rgba(118, 75, 162, 0.8); /* Lilac-ish background */
     color: white;
     border: none;
     border-radius: 20px;
     cursor: pointer;
     transition: background 0.2s ease, transform 0.1s ease;
     font-size: 0.9rem;
     font-weight: 500;
}

.audio-controls button:hover {
    background: #764ba2; /* Darker lilac on hover */
    transform: translateY(-1px);
}

.audio-controls button:active {
     transform: translateY(0);
}

#current-speed {
    font-weight: bold;
    color: #764ba2; /* Highlight speed display */
    min-width: 40px; /* Ensure consistent width */
    text-align: center;
}

/* Style for the "Ouรงa o รกudio" link in question 8 */
/*
.test-question a {
     color: #764ba2; /* Link color */
     text-decoration: underline;
     font-weight: 500;
     transition: color 0.2s ease;
}

.test-question a:hover {
    color: #667eea; /* Hover color */
}
*/

/* Style for the Send Answers button */
#send-test-answers-button {
    margin-top: 2rem; /* Space above the button */
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
     .header .container {
        padding: 0.7rem 15px; /* Adjusted header padding */
    }
    .header-logo {
        height: 55px; /* Adjusted size */
         margin-right: 8px;
    }
    .logo {
        font-size: 1.2rem;
        align-items: center;
    }

    .logo .by-rafael {
        font-size: 1em; /* Keep it relative */
        margin-left: 3px;
    }

    .main {
         margin-top: 70px; /* Adjust margin top for slightly shorter header */
    }

    .hero {
        padding: 1.5rem 0 2rem 0; /* Adjusted padding */
        min-height: calc(100vh - 70px); /* Adjusted min-height */
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.5rem; /* Adjust spacing */
    }

    .hero-subtitle {
        font-size: 1.2rem;
        margin-bottom: 2rem; /* Adjust spacing */
    }

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

    .categories-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Ensure popup categories also become 1 column on small mobile */
    .popup-categories-grid {
         grid-template-columns: 1fr;
         gap: 1.5rem;
    }

    /* Other Services Mobile */
     .other-services-title {
         font-size: 1.8rem;
         margin-top: 2.5rem;
         margin-bottom: 1.5rem;
     }
     .other-services-grid {
         grid-template-columns: 1fr;
         gap: 1.5rem;
     }
    .service-card {
         padding: 1.5rem;
     }
     .service-card h3 {
         font-size: 1.2rem;
     }
     .service-card p {
         font-size: 0.9rem;
     }

    .modality-options-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .calculator-form {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .container {
        padding: 0 15px;
    }

    .category-card {
        padding: 1.5rem;
    }

    .pricing-card {
        padding: 1.5rem;
    }


    .popup-content {
        padding: 1.5rem;
        max-height: 95vh;
    }

    /* Adjusted popup button sizes and positions for mobile */
    .popup-close,
    .popup-back {
         width: 30px;
         height: 30px;
         top: 1rem;
         font-size: 1.2rem;
     }

     .popup-close {
         right: 1rem;
     }
     .popup-back {
         left: 1rem; /* Position on the left */
         font-size: 1rem; /* Adjusted icon size for mobile */
     }


    .popup-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .popup-step h3 {
        font-size: 1.5rem;
    }

    .modality-card {
        padding: 1rem;
    }

    .modality-card h4 {
        font-size: 1.1rem;
    }

    .price-item {
        padding: 0.7rem 1rem;
    }

    .price-item .buy-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .total-price span {
        font-size: 2rem;
    }


     /* Contact Icons Mobile */
    .contact-icons-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); /* Smaller min width for mobile */
        gap: 1rem; /* Adjusted gap */
    }

    .contact-icon-link {
         max-width: 100px; /* Adjust max width */
         gap: 0.4rem; /* Adjusted gap */
    }

    .contact-icon-circle {
         width: 70px; /* Smaller circle */
         height: 70px; /* Smaller circle */
    }

    .contact-icon-circle img {
        width: 40px; /* Smaller icons on mobile */
        height: 40px;
    }
    /* Adjust Font Awesome icon size for mobile */
    .contact-icon-circle i {
        font-size: 30px; /* Adjust size */
    }
     .contact-icon-link span {
         font-size: 0.9rem;
     }

     /* SรกBot Mobile */
    .sabot-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        bottom: 15px;
        right: 15px;
    }

    #sabot-chat-overlay .popup-content {
        /* Adjusted for mobile */
        width: 95vw; /* Even more width */
        max-width: 95vw;
        height: 90vh; /* Can be taller on mobile */
        max-height: 95vh;
        padding: 1rem;
    }

     .sabot-title {
         font-size: 1.5rem;
     }

     .message {
        padding: 8px;
        font-size: 0.9rem;
     }

    .message .sender-name {
        font-size: 0.85rem;
    }

    /* SรกBot Questions Mobile - two columns still */
    .predefined-questions {
         grid-template-columns: 1fr 1fr; /* Still two columns on medium mobile */
         gap: 8px;
    }

    .question-button {
        padding: 8px 12px;
        font-size: 0.9rem;
        word-wrap: break-word; /* Allow text wrapping */
         white-space: normal; /* Ensure text wraps */
    }

    /* Students list Mobile */
    .students-list-grid {
        /* Flexbox handles responsiveness naturally */
        grid-template-columns: none; /* Ensure no grid columns */
        grid-auto-flow: row;
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
        gap: 0.8rem; /* Adjusted gap */
    }
    .student-name {
        padding: 0.8rem;
        font-size: 0.95rem; /* Adjusted font size for mobile */
        flex: 0 1 auto; /* Maintain flex property */
        /* Remove explicit width overrides if they exist */
    }

     /* Password Popup Mobile (Generic) */
     .password-popup-content {
        max-width: 90%; /* Take up more width */
        padding: 1rem;
    }
    .password-popup-title {
        font-size: 1.3rem;
    }
     .password-form .cta-button {
         max-width: 150px;
         padding: 0.7rem 1rem;
         font-size: 0.9rem;
     }
     .error-message {
         font-size: 0.8rem;
     }

     /* Other Service Info Popup Mobile */
    #other-service-info-overlay .other-service-info-content {
        max-width: 90%;
        padding: 1.5rem;
    }

    #other-service-info-overlay .popup-title {
         font-size: 1.8rem;
         margin-top: 0.8rem; /* Adjust top margin */
    }

    .service-info-text {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    #other-service-info-overlay .cta-button {
         max-width: 200px;
         font-size: 1.1rem;
     }

     /* Level Test Popup Mobile */
    #level-test-popup-overlay .popup-content {
         max-width: 95%;
         padding: 1.5rem;
    }
     #level-test-popup-overlay .popup-title {
         font-size: 1.8rem;
         margin-bottom: 1.5rem;
          margin-top: 0.8rem; /* Adjust top margin */
     }
     .test-question {
         padding: 1rem;
         gap: 1.5rem;
     }
     .test-question p strong {
         font-size: 1rem;
     }
     .test-question p {
         font-size: 0.95rem;
     }
      .test-question label {
         font-size: 0.9rem;
     }
     .test-question input[type="text"],
     .test-question textarea {
         font-size: 0.95rem;
     }
      /* Style for the Audio Player (Question 8) on mobile */
     #question-8 audio {
         width: 100%; /* Ensure it fits */
          margin: 0.8rem 0 1rem 0; /* Adjust margins */
     }
      /* Style for the Audio Controls (Speed) on mobile */
     .audio-controls {
         gap: 0.8rem; /* Smaller gap */
         font-size: 0.9rem; /* Smaller font size */
     }
     .audio-controls button {
         padding: 0.4rem 0.8rem; /* Smaller padding */
         font-size: 0.85rem; /* Smaller font size */
     }
      #current-speed {
         min-width: 35px; /* Adjust min-width */
     }


     #send-test-answers-button {
         margin-top: 1.5rem; /* Adjust margin */
         padding: 0.8rem 1.5rem;
         font-size: 1.1rem;
     }


}

@media (max-width: 480px) {
     .header .container {
        padding: 0.6rem 10px; /* Adjusted header padding */
    }
    .header-logo {
        height: 50px; /* Adjusted size */
        margin-right: 5px;
    }
    .logo {
        font-size: 1rem;
    }
     .logo .by-rafael {
        font-size: 0.9em; /* Even smaller relative size */
        margin-left: 2px;
     }

     .main {
         margin-top: 60px; /* Adjust margin top for even shorter header */
     }

    .hero {
        padding: 1rem 0 1.5rem 0; /* Adjusted padding */
        min-height: calc(100vh - 60px); /* Adjusted min-height */
    }

    .hero-title {
        font-size: 1.5rem;
         margin-bottom: 0.3rem; /* Adjust spacing */
    }
     .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem; /* Adjust spacing */
    }

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

    .category-card {
        padding: 1.5rem;
    }

    .category-card h3 {
        font-size: 1.2rem;
    }

    /* Ensure popup categories also become 1 column on very small mobile */
    .popup-categories-grid {
         grid-template-columns: 1fr;
         gap: 1rem;
    }

    /* Other Services Very Small Mobile */
     .other-services-title {
         font-size: 1.5rem;
         margin-top: 2rem;
         margin-bottom: 1rem;
     }
     .other-services-grid {
         grid-template-columns: 1fr;
         gap: 1rem;
     }
     .service-card {
         padding: 1.2rem;
     }
      .service-card h3 {
         font-size: 1.1rem;
     }
     .service-card p {
         font-size: 0.85rem;
     }

    .pricing-card h3 {
        font-size: 1.2rem;
    }

    /* Calculator h3 within step-manual-calculator */
     #step-manual-calculator h3 {
        font-size: 1.4rem;
    }

    .notice p {
        font-size: 0.9rem;
        padding: 0.7rem 1.2rem;
    }

    .popup-overlay {
        padding: 10px;
    }

    .popup-content {
        padding: 1rem;
    }
     /* Adjusted popup button sizes and positions for very small mobile */
     .popup-close,
     .popup-back {
         width: 28px;
         height: 28px;
         font-size: 1rem;
         top: 0.8rem;
     }
      .popup-close {
         right: 0.8rem;
      }
     .popup-back {
         left: 0.8rem; /* Position on the left */
         font-size: 0.9rem; /* Adjusted icon size for very small mobile */
     }

    .popup-title {
        font-size: 1.5rem;
    }

    .popup-step h3 {
        font-size: 1.3rem;
    }

    .modality-card {
        padding: 1rem;
    }

    .modality-card h4 {
        font-size: 1rem;
    }

    .price-item {
        padding: 0.7rem 1rem;
    }

    .price-item .buy-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }


     /* Contact Icons smaller on very small screens */
    .contact-icons-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 0.8rem; /* Adjusted gap */
    }

    .contact-icon-link {
        max-width: 90px; /* Adjust max width */
        gap: 0.3rem; /* Adjusted gap */
    }

    .contact-icon-circle {
         width: 60px; /* Smaller circle */
         height: 60px; /* Smaller circle */
    }

    .contact-icon-circle img {
        width: 30px; /* Smaller icons on very small mobile */
        height: 30px;
    }
     /* Adjust Font Awesome icon size for very small mobile */
    .contact-icon-circle i {
        font-size: 25px; /* Adjust size */
    }
     .contact-icon-link span {
         font-size: 0.85rem;
     }

    /* SรกBot Very Small Mobile */
    .sabot-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        bottom: 10px;
        right: 10px;
    }

    #sabot-chat-overlay .popup-content {
        /* Adjusted for very small mobile */
        width: 95vw;
        max-width: 95vw;
        height: 90vh;
        max-height: 95vh;
        padding: 0.8rem;
    }

     .sabot-title {
         font-size: 1.4rem;
     }

     .message {
        padding: 6px;
        font-size: 0.85rem;
     }
     .message .sender-name {
        font-size: 0.8rem;
     }

     /* SรกBot Questions Very Small Mobile - Stack vertically */
    .predefined-questions {
         grid-template-columns: 1fr; /* Stack columns */
         gap: 6px;
    }
     .question-button {
        padding: 6px 10px;
        font-size: 0.85rem;
        text-align: center; /* Center text when stacked */
     }

     /* Students List Very Small Mobile - Stack vertically */
     .students-list-grid {
        /* Flexbox handles responsiveness naturally */
        grid-template-columns: none; /* Ensure no grid columns */
        grid-auto-flow: row; /* Explicitly row flow for single column */
        max-height: none; /* Remove height constraint */
        overflow-y: visible; /* Allow content to push container height */
        padding-right: 0; /* Remove padding right */
        gap: 0.6rem; /* Adjusted gap */
    }
    .student-name {
        padding: 0.7rem;
        font-size: 0.9rem; /* Adjusted font size for very small mobile */
        flex: 0 1 auto; /* Maintain flex property */
        /* Remove explicit width overrides if they exist */
    }

     /* Password Popup Very Small Mobile (Generic) */
     .password-popup-content {
        max-width: 95%;
        padding: 0.8rem;
    }
    .password-popup-title {
        font-size: 1.2rem;
    }
     .password-form .cta-button {
         max-width: 120px;
         padding: 0.6rem 0.8rem;
         font-size: 0.8rem;
     }
     .error-message {
         font-size: 0.8rem;
     }

     /* Other Service Info Popup Very Small Mobile */
     #other-service-info-overlay .other-service-info-content {
        max-width: 95%;
        padding: 1rem;
     }
    #other-service-info-overlay .popup-title {
         font-size: 1.5rem;
          margin-top: 0.5rem; /* Adjust top margin */
    }
     .service-info-text {
         font-size: 0.95rem;
         margin-bottom: 1.5rem;
     }
      #other-service-info-overlay .cta-button {
         max-width: 180px;
         font-size: 1rem;
     }

     /* Level Test Popup Very Small Mobile */
     #level-test-popup-overlay .popup-content {
         max-width: 98%; /* Take up slightly more width */
         padding: 1rem;
    }
    #level-test-popup-overlay .popup-title {
         font-size: 1.5rem;
         margin-bottom: 1rem;
         margin-top: 0.5rem; /* Adjust top margin */
    }
     .test-question {
         padding: 0.8rem;
         gap: 1.5rem;
     }
     .test-question p strong {
         font-size: 0.95rem;
     }
     .test-question p {
         font-size: 0.9rem;
     }
      .test-question label {
         font-size: 0.85rem;
     }
     .test-question input[type="text"],
     .test-question textarea {
         font-size: 0.9rem;
     }
      /* Style for the Audio Player (Question 8) on very small mobile */
     #question-8 audio {
         width: 100%; /* Ensure it fits */
         margin: 0.8rem 0 1rem 0; /* Adjust margins */
     }
      /* Style for the Audio Controls (Speed) on very small mobile */
     .audio-controls {
         gap: 0.6rem; /* Smaller gap */
         font-size: 0.8rem; /* Smaller font size */
     }
     .audio-controls button {
         padding: 0.3rem 0.6rem; /* Smaller padding */
         font-size: 0.8rem; /* Smaller font size */
     }
      #current-speed {
         min-width: 30px; /* Adjust min-width */
     }

     #send-test-answers-button {
         margin-top: 1rem; /* Adjust margin */
         padding: 0.8rem 1.5rem;
         font-size: 1.1rem;
     }
}