/* Base Styles */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    transition: margin-left 0.5s;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    padding-top: 100px; /* Forced higher padding to clear header */
    padding-bottom: clamp(50px, 8vh, 60px);
    box-sizing: border-box;
}
  .dbody {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
}


.header {
    background-color: #110d3a;
    color: white;
    padding: 1rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    height: 80px; /* Fixed height to ensure clear space */
}

.header img{
    margin-left: 1rem;
    flex-shrink: 0;
}

.header  img {
    border-radius: 50%;
    width: clamp(25px, 5vw, 35px);
    height: auto;
}

.header h1 {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    margin: 0 1rem;
    text-align: center;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.back-button {
    margin-right: 20px;
    padding: 10px 15px;
    background-color: rgb(168, 9, 9);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
}
.back-button:hover {
    background-color: darkred;
}




 .bvcontainer, .cvcontainer {
    width: 80%;
    margin: 120px auto clamp(60px, 10vh, 70px); /* Forced higher margin-top */
    padding: 15px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}
.container{
    width: 80%;
    margin: 120px auto clamp(60px, 10vh, 70px); /* Forced higher margin-top */
    padding: 15px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.bvcontainer {
    max-width: 1600px;
    background-color: white;
    box-shadow: 0px 0px 10px rgb(168, 9, 9);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
}

.cvcontainer {
    padding: 5px;
    max-width: max-content;
    background-color: white;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
}

p.description {
    text-align: justify;
    font-size: 16px;
    margin-bottom: 15px;
}

.form-column {
    flex: 1;
    padding: 10px;
    box-sizing: border-box;
}

h1 {
    text-align: center;
    color: rgb(168, 9, 9);
}

h2 {
    text-align: center;
    color: rgb(168, 9, 9);
    margin-bottom: 10px;
    width: 100%;
}

h3 {
    color: rgb(168, 9, 9);
    margin-bottom: 5px;
    font-size: 18px;
}

label {
    display: block;
    margin: 5px 0;
}

input[type="text"],
input[type="date"],
input[type="tel"],
input[type="email"],
input[type="month"],
select,
textarea {
    width: calc(100% - 20px);
    padding: 6px;
    margin-bottom: 8px;
    border: 1px solid #110d3a;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: #f9f9f9;
    font-size: 14px;
}

textarea {
    height: 80px;
}

.upload-container {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.upload-container input[type="file"] {
    display: none;
}

.upload-container label {
    cursor: pointer;
    padding: 6px 10px;
    background-color: wheat;
    color: #110d3a;
    border: none;
    border-radius: 4px;
    display: inline-block;
    margin-right: 10px;
}

.upload-container img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 8px;
    display: none;
    margin-top: 5px;
}

section {
    margin-bottom: 20px;
    border: 1px solid #110d3a;
    padding: 10px;
    border-radius: 8px;
}

.add-more-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.add-more-container input[type="text"] {
    width: calc(100% - 100px);
}

.add-more-container button {
    margin-left: 10px;
    padding: 6px 10px;
    background-color: wheat;
    color: #110d3a;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.add-more-container button.done {
    background-color: #28a745;
}

.hidden {
    display: none;
}

.btn-container {
    text-align: center;
    margin: 15px 0;
}

.btn-container button,
.btn {
    padding: 8px 15px;
    background-color: #110d3a;
    color: rgb(168, 9, 9);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn:hover {
    background-color: rgb(168, 9, 9);
    color: white;
}

.undertaking {
    margin: 10px 0;
    display: flex;
    align-items: center;
}

.undertaking input[type="checkbox"] {
    margin-right: 10px;
}

.update, .delete {
    background-color: green;
    color: white;
    border: 0;
    border-radius: 5px;
    height: 23px;
    width: 90px;
    cursor: pointer;
}

.delete {
    background-color: red;
}

.tablo {
    background-color: white;
    margin: 0;
}



.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    padding: 10px;
    max-width: 1000px;
    width: 100%;
}

.grid-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.grid-container img:hover {
    transform: scale(1.05);
}

.map {
    margin: 20px auto;
    width: 100%;
    height: 400px;
    border: 4px solid rgb(168, 9, 9);
}

.no-jobs {
    text-align: center;
    padding: 50px;
    color: rgb(168, 9, 9);
    font-size: 18px;
}

.carousel-container {
    position: relative;
    max-width: 600px;
    margin: 20px auto;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.slides {
    display: none;
    width: 100%;
}

.carousel-container img {
    width: 100%;
    height: auto;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
}

.prev, .next {
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 10px;
    border-radius: 50%;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0px 0;
    font-size: 16px;
}

table, th, td {
    border: 1px solid rgb(168, 9, 9);
    padding: 12px;
    text-align: left;
}

th {
    background-color: #110d3a;
    color: wheat;
}

.footer {
    background-color: #110d3a;
    color: white;
    text-align: center;
    position: relative;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 8px 0;
    font-size: 14px;
    z-index: 1000;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 36px;
    cursor: pointer;
    color: white;
    z-index: 1001;
}

.close-btn:hover {
    color: rgb(168, 9, 9);
}

/* Media Queries */
@media (max-width: 1200px) {
    .container, .bvcontainer, .cvcontainer {
        width: 90%;
        margin: 50px auto clamp(50px, 8vh, 60px);
        padding: 10px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 90px;
    }

    .header {
        height: 75px;
        padding: 0.8rem;
    }

    .header img {
        width: clamp(20px, 4vw, 30px);
    }

    .header h1 {
        font-size: clamp(0.9rem, 2vw, 1.2rem);
    }

    
    .back-button {
        font-size: clamp(0.6rem, 1.1vw, 0.8rem);
        padding: 0.3rem 0.6rem;
        margin-left: 0.5rem;
    }

  
    .form-column {
        flex: 100%;
        max-width: 100%;
    }

    .upload-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .upload-container label {
        margin-bottom: 5px;
    }

    .carousel-nav {
        flex-direction: row;
    }

    .prev, .next {
        padding: 6px;
    }

    h1, h2, h3 {
        font-size: 16px;
    }

    .btn-container button,
    .btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    input[type="text"],
    input[type="date"],
    input[type="tel"],
    input[type="email"],
    input[type="month"],
    select,
    textarea {
        font-size: 13px;
    }

    table, th, td {
        font-size: 13px;
        padding: 8px;
    }

    .map {
        height: 200px;
    }

    .footer {
        padding: 6px 0;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 100px; /* Forced higher padding for mobile */
    }

    .header {
        flex-direction: row;
        padding: 1rem;
        height: 100px; /* Increased height to avoid overlap */
    }

    .header img {
        margin: 0.3rem 0;
        width: clamp(33px, 5.5vw, 50px);
    }

    .header h1 {
        font-size: clamp(0.9rem, 2vw, 1.2rem);
        margin: 0 0.5rem;
    }

    .back-button {
        font-size: clamp(0.8rem, 2vw, 1.4rem);
        padding: 0.3rem 0.6rem;
        margin-left: 0.5rem;
    }

   .bvcontainer {
        width: 100%;
        margin: 0px;
        padding: 8px;
    }
     .cvcontainer {
        width: 100%;
        margin: 0px;
        padding: 8px;
    }
 .container{
        width: min-content;
        margin: 0px;
        padding: 8px;
    }
    .carousel-container {
        width: 100%;
    }

    .footer {
        padding: 5px 0;
        font-size: 12px;
    }

    .undertaking {
        flex-direction: column;
        align-items: flex-start;
    }

    input[type="text"],
    input[type="date"],
    input[type="tel"],
    input[type="email"],
    input[type="month"],
    select,
    textarea {
        font-size: 12px;
        padding: 5px;
    }

    table, th, td {
        font-size: 12px;
        padding: 6px;
    }

    .btn-container button,
    .btn {
        font-size: 12px;
        padding: 6px 12px;
    }

    .upload-container img {
        max-width: 80px;
        max-height: 80px;
    }
}

@media print {
    button, .back-button, .header, .footer {
        display: none !important;
    }

    body {
        padding-top: 0;
        padding-bottom: 0;
    }

    .container, .bvcontainer, .cvcontainer {
        margin: 0 auto;
    }
}