/* --- Global Styles & Layout --- */
body {
    /* font-family: sans-serif; */ /* Overridden by inline style, consider removing inline style */
    font-family: Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif; /* Match inline style */
    margin: 0;
    line-height: 1.6;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    min-height: 110vh; /* Adjusted slightly */
    font-size: 16px;
}

header {
    background-color: #333;
    color: #fff;
    padding: 1rem;
    text-align: center;
}

header h1 {
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

/* --- Main Content Area --- */
main {
    flex-grow: 1;
    padding: 1.5rem;
    gap: 1.5rem; /* Space between sections */
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column; /* Stack sections vertically */
}

footer {
    background-color: #333;
    color: #ccc;
    text-align: center;
    padding: 1.5rem 1rem;
    margin-top: auto;
    font-size: 0.9rem;
}
footer p {
    margin: 0.3rem 0;
}

/* --- Level Selector --- */
#level-selector {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

#level-selector button {
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    border: 1px solid #fff;
    background-color: #555;
    color: #fff;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

#level-selector button:hover {
    background-color: #777;
}

#level-selector button.active {
    background-color: #007bff;
    border-color: #007bff;
    font-weight: bold;
}

/* --- Floor Plan Area --- */
#floor-plan-area {
    width: 100%;
}

.floor-plan {
    display: none;
}

.floor-plan.active {
    display: block;
}

.plan-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.plan-container img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #ccc;
}

/* Make floor plan image clickable */
.clickable-plan {
    cursor: zoom-in;
    transition: opacity 0.2s ease;
}
.clickable-plan:hover {
    opacity: 0.85;
}


/* --- Unit Button Container --- */
#unit-button-container {
    padding: 1.5rem 0;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.unit-buttons {
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.unit-buttons.active {
    display: flex;
}

/* --- Individual Unit Selector Buttons --- */
.unit-selector-button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    border: 2px solid transparent;
}

.unit-selector-button.available {
    background-color: #28a745;
}
.unit-selector-button.available:hover {
    background-color: #5cb85c;
}

.unit-selector-button.leased {
    background-color: #dc3545;
}
.unit-selector-button.leased:hover {
    background-color: #c82333;
}

.unit-selector-button.selected {
    border-color: #333;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}


/* --- Unit Details Panel --- */
#unit-details-panel {
    width: 100%;
    background-color: #fff;
    padding: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

#unit-details-panel h2 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.4rem;
    text-align: center;
}

/* --- Details Content Grid --- */
#details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.5rem 1.5rem;
    margin-bottom: 1.5rem;
}

#details-grid p {
    margin: 0.2rem 0;
    color: #555;
    font-size: 0.95rem;
    display: flex;
    flex-wrap: wrap;
}

#details-grid strong {
    color: #333;
    min-width: 130px;
    display: inline-block;
    margin-right: 8px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Style for the initial message */
#details-content > p:first-child {
    color: #666;
    font-style: italic;
    text-align: center; /* Center initial message */
}

/* --- Download Buttons Container --- */
#download-button-container {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center; /* Center download buttons */
}

/* General Download Button Style */
.download-button {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.download-button.plan {
    background-color: #007bff;
}
.download-button.plan:hover {
    background-color: #0056b3;
}

.download-button.info {
    background-color: #17a2b8;
}
.download-button.info:hover {
    background-color: #117a8b;
}

#download-button-container p {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
    align-self: center;
}

/* --- Magnify Modal Styles --- */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  padding-top: 50px; /* Location of the box */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0,0,0,0.85); /* Black w/ opacity */
}

.modal-content {
  margin: auto;
  display: block;
  width: auto; /* Let height determine width */
  max-width: 90%;
  max-height: 85vh; /* Limit height */
  object-fit: contain; /* Ensure whole image fits */
}

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

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

/* Add Animation (Optional) */
.modal-content {
  animation-name: zoom;
  animation-duration: 0.4s;
}

@keyframes zoom {
  from {transform: scale(0.5)}
  to {transform: scale(1)}
}


/* --- Responsive Design Adjustments --- */
@media (max-width: 768px) {
     header h1 {
        font-size: 1.5rem;
     }
     #level-selector button {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
     }
     .unit-selector-button {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
     }
     #details-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
     }
     #details-grid strong {
         min-width: 110px;
     }
     .download-button {
         font-size: 0.85rem;
         padding: 0.5rem 1rem;
     }
     #download-button-container {
         gap: 0.5rem;
     }
     .modal-content {
        max-width: 95%; /* Allow slightly wider image on smaller screens */
     }
}

@media (max-width: 480px) {
    #details-grid {
        grid-template-columns: 1fr;
        gap: 0.3rem 0;
    }
     #details-grid p {
        font-size: 0.9rem;
    }
     #details-grid strong {
         min-width: 100px;
     }
}
