:root {
    --primary: #7EC646;
    --secondary: #4E8026;
    --primary-light: #a1e06c;
    --primary-dark: #5a9e24;
    --white: #ffffff;
    --light-bg: #f8f9fa;
    --dark-text: #343a40;
    --gray-light: #e9ecef;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
}

.page-container {
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(126, 198, 70, 0.1) 0%, rgba(78, 128, 38, 0.05) 100%);
    padding: 2rem 1rem;
}

.main-header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo-container {
    margin-bottom: 1rem;
}

.logo {
    max-height: 120px;
    width: auto;
}

.main-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
}

.subtitle {
    color: var(--dark-text);
    font-size: 1rem;
    opacity: 0.8;
}

.section-title {
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
    text-align: center; /* Centers the text */
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%; /* Move to the center */
    bottom: 0;
    width: 150px;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px;
    transform: translateX(-50%); /* Adjust back to center */
}

.section-title.resident::after {
    width: 110px;
}

.card-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.building-card {
    position: relative;
    background-color: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    /* flex: 1; */
    min-width: 100px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: none;
    overflow: hidden;
}

.building-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.building-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary);
    border-radius: 10px 0 0 10px;
}

.building-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--secondary);
}

.building-card:hover .building-name {
    color: var(--primary);
}

.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 95%;
    margin: 10px 0;
}

.modal-header {
    background-color: var(--primary);
    color: var(--white);
    border-radius: 15px 15px 0 0;
    border-bottom: none;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 2rem;
}

.form-label {
    font-weight: 500;
    color: var(--secondary);
}

.form-control,
.form-select {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid #ced4da;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(126, 198, 70, 0.25);
}

.image-upload-container {
    background-color: var(--gray-light);
    border: 2px dashed #ced4da;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    transition: var(--transition);
    min-height: 250px;
}

.image-upload-container:hover {
    border-color: var(--primary);
}

.upload-icon {
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.upload-text {
    color: var(--dark-text);
    margin-bottom: 1rem;
}

.captured-image {
    max-width: 100%;
    max-height: 200px;
    margin-top: 1rem;
    border-radius: 8px;
    display: none;
    box-shadow: var(--shadow);
}

.btn {
    padding: 0.65rem 1.8rem;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.btn.capture {
    padding: 0.75rem 1.5rem;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus-visible,
.btn-primary:focus-within,
.btn-primary:focus {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    box-shadow: none !important;
}

.btn-secondary {
    background-color: #9EA1AC;
    border-color: #9EA1AC;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: var(--white);
}

.thank-you-modal .modal-body {
    text-align: center;
    padding: 2rem;
}

.thank-you-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.thank-you-sub-message {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.thank-you-message {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 1.5rem;
    margin-bottom: 3rem;
    line-height: 25px;
}

.thank-you-modal .btn-primary {
    padding: 0.65rem 3rem;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    box-shadow: none !important;
    background-color: var(--secondary) !important;
    border-color: var(--secondary);
}

.image-upload-container input:focus,
.image-upload-container button:focus {
    outline: none !important;
    box-shadow: none !important;
}

.building-card:hover {
    cursor: pointer;
}

.image-upload-container {
    border: 2px dashed #ccc;
    padding: 10px;
    text-align: center;
    position: relative;
    cursor: pointer;
}

.image-upload-container img {
    max-width: 100%;
    max-height: 200px;
    display: none;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: none;
    cursor: pointer;
}

.upload-icon,
.upload-text {
    display: block;
}

.dropdown-menu {
    max-height: 200px;
    overflow-y: auto;
}

.no-towers-message {
    opacity: 0.6;
    font-weight: 700;
    color: #C0C2C9;
    font-size: 1.5rem;
}

.modal.show .modal-dialog {
    justify-content: center;
}

@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }

    .building-card {
        min-width: 80px;
        padding: 1.2rem;
    }

    .building-name {
        font-size: 1.2rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .image-upload-container {
        padding: 1.5rem;
    }

    .page-container::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: url('images/treppanWordedLogo.png') no-repeat center center;
        background-size: 80%; /* or 'cover' if you want it to stretch */
        opacity: 0.2; /* Adjust transparency */
        z-index: -1; /* Ensures it stays in the background */
    }
    
    .page-container {
        position: relative; /* Needed to ensure the pseudo-element positions correctly */
    }
}

@media (max-width: 517px) {
    .page-container::before {
        background-size: 100%; /* or 'cover' if you want it to stretch */
    }

    .main-title {
        font-size: 1.8rem;
    }

    .page-container::before {
        background-size: 100%;
    }

    .logo {
        max-height: 70px;
    }

    .modal-title {
        font-size: 1rem;
    }

    .btn-close {
        background: transparent var(--bs-btn-close-bg) center / 0.7em auto no-repeat;
    }

    .modal-body {
        padding: 1rem;
    }

    .form-label {
        font-size: 0.8rem;
        margin-bottom: .3rem;
    }

    .form-control,
    .form-select,
    .upload-text,
    .iti__selected-dial-code,
    .subtitle {
        font-size: 0.8rem;
    }

    .invalid-feedback {
        font-size: 0.6rem;
    }

    .form-control,
    .form-select {
        padding: 0.75rem 0.8rem;
    }

    .image-upload-container {
        min-height: 200px;
    }

    .upload-icon {
        font-size: 1.8rem;
    }

    .btn {
        font-size: 12px;
        padding: 0.5rem 1.5rem;
    }

    .btn.capture {
        padding: 0.5rem 1rem;
    }

    .thank-you-modal .modal-body {
        padding: 1.5rem;
    }

    .fa-check-circle {
        font-size: 50px;
    }

    .thank-you-message {
        font-size: 1.2rem;
    }

    .thank-you-modal .btn {
        padding: 0.6rem 2.7rem;
    }

    #towersContainer .btn {
        padding: 0.5rem 0.8rem !important;
    }

}

@media (max-width: 430px) {
    .main-title {
        font-size: 1.5rem;
    }

    .main-header {
        margin-bottom: 2rem;
    }

    h2 {
        font-size: calc(1rem + .9vw);
    }

    .section-title::after {
        width: 120px;
    }

    .section-title.resident::after {
        width: 70px;
    }

    .card-container {
        margin-bottom: 1.5rem;
    }

    .building-name {
        font-size: 1rem;
    }

}
