/* Ensure the body takes full height and uses flexbox */
html, body {
    position: relative;
    height: 100%;
    margin: 0;
    background-size: cover;
    display: flex;
    flex-direction: column;
}
.bg-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('img/bg8.jpg') no-repeat center center fixed;
    background-size: cover;
}

/* Background overlay with opacity */
.bg-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255, 0.8); /* Adjust opacity here */
}
/* Content on top of the background */
.container,footer {
    position: relative;
    z-index: 2;
}


/* Ensure header and footer take full width */
header, footer {
    width: 100%;
}

h1 {
    font-size: 100px;
}

/* Main content container */
.container-fluid {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

    /* Centered Login Container */
    .login-container {
        background: #fff; /* Fully visible */
        padding: 40px;
        border-radius: 10px;
        box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.9);
        max-width: 900px; 
        width: 100%;
        min-height: 480px;
        display: flex;
        flex-direction: column; /* Change to column to stack title and form */
        align-items: center;
        justify-content: center;
        position: relative; /* Keeps it above the background */
        z-index: 2;
        text-align: center;
    }
 /* Centered Title Above Image/Form */
 .login-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 30px; /* Add space below the title */
    color: #333;

}

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 30px; /* Add space between the image and form */
}

/* Image Styling */
.login-image {
    width: 100%;
    max-width: 350px;
    height: 250px;
    border-radius: 10px;
}

.login-form {
    flex: 1;
    padding-left: 30px;
}

@media (max-width: 768px) {
    .login-wrapper {
        flex-direction: column;
        text-align: center;
    }
    .login-form {
        padding-left: 0;
        margin-top: 15px;
    }
}
/* Styling for header and footer */


footer {
    background-color: black;
    color: white;
    padding: 15px 0;
    text-align: center;
    margin-top: auto;
}

       /* Ensure the header is responsive */
       header {
        background-color: #219ebc;
        color: white;
        padding: 15px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }


    /* Styling for the header text */
    header h1 {
        margin: 0;
        font-size: 1.5rem; /* Responsive font size */
    }

  
.form-label {
    font-weight: 600;
}

.form-control {
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.login-container h3 {
    margin-bottom: 20px;
    text-align: center;
}
.btn {
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
}

.alert {
    margin-top: 20px;
    font-size: 16px;
}


/* Responsive Design */
@media screen and (max-width: 576px) {  /* For small screens like mobile */
    .container {
       
        padding-top: 20px;
    }

    .login-container {
        width: 90%; /* Adjust width for small screens */
        max-width: 350px; /* Prevents it from being too wide */
        padding: 15px;
    }

    .login-image {
        width: 100px; /* Adjust size for mobile */
        height: 100px;
    }

    footer {
        position: relative; /* Prevents overlapping */
        bottom: auto;
        margin-top: 20px; /* Adds space between the form and footer */
        width: 100%;
        text-align: center;
        padding: 10px;
        
    }
}

    /* Responsive adjustments */
    @media (max-width: 768px) {
        header h1 {
            font-size: 1.2rem;
        }
    }
    @media (max-width: 576px) {
        header {
            flex-direction: column;
            align-items: center;
            text-align: center;
        }

        header h1 {
            font-size: 1.2rem;
        }
    }
/*admin header*/
    .navbar {
            background-color: #219ebc;
        }
        .navbar-nav {
            margin-left: auto;
        }
        .navbar-nav a {
            color: white;
        }
        .navbar-nav a:hover {
            color: lightblue;
        }

 /* Main content area */
 .main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
  }

 /* Dashboard Buttons Style */
.dashboard-buttons {
    display: flex;
    gap: 40px; /* Adds more space between buttons */
    justify-content: center; /* Centers buttons horizontally */
    margin-top: 30px; /* Adds space from the top (optional) */
}

.dashboard-container {
    min-height: 70vh;
}

.dashboard-button {
    width: 100%;
    max-width: 500px;
    height: 310px;
    font-size: 1.4rem;
    font-weight: 600;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #007bff, #00d2ff);
    color: white;
    border-radius: 15px;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out, background 0.3s ease-in-out;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.9);
}

.dashboard-button h4 {
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.dashboard-button p {
    color:black;
    font-size: 1.3rem;
    opacity: 0.9;
}

.dashboard-button:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #0056b3, #003580);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.9);
}

@media (max-width: 768px) {
    .dashboard-button {
        max-width: 100%;
        height: 280px;
    }
}

.dashboard-button:hover {
    transform: scale(1.1); /* Slight scale-up effect on hover */
    box-shadow: 0 8px 10px rgba(0, 0, 0, 0.9); /* Shadow effect */
}

/* Specific button colors with gradient */
.dashboard-button.survey {
    background: linear-gradient(135deg, #4a97eb, #aec3d9);; /* Blue gradient */
}

.dashboard-button.survey:hover {
    background: linear-gradient(135deg, #3879d3, #7da2c9); /* Darker blue gradient on hover */
}

.dashboard-button.poll {
    background: linear-gradient(135deg, #64bb78, #d2ebd1); /* Green gradient */
}

.dashboard-button.poll:hover {
    background: linear-gradient(135deg, #4aa860, #caefca); /* Darker green gradient on hover */
}

/* view poll*/
/* Container styles */
.container .s {
     /* Light gray background */
    border-radius: 12px; /* Rounded corners */
    padding: 20px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1); /* Soft shadow for depth */
}



/* Stylish Buttons */
.manage-btn i, .view-results-btn i, .vote-btn i {
    font-size: 1.4rem;
    transition: transform 0.2s ease-in-out;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.05);
    display: inline-flex;
    justify-content: center;
    align-items: center;
}
.fw-bold {
    font-weight: 700 !important;
}

/* Button Hover Effects */
.manage-btn:hover i {
    color: #f0ad4e;
    background: rgba(240, 173, 78, 0.2);
    transform: scale(1.3);
}
.view-results-btn:hover i {
    color: green;
    background: rgba(0, 128, 0, 0.2);
    transform: scale(1.3);
}
.manage-btn, .view-results-btn {
    border-radius: 5px;
}
.manage-btn {
    background: none;
    color: #f0ad4e;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
}

.view-results-btn {
   background: none;
    color: green;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
}
/* Vote button styling */
.vote-btn {
    background-color: none; /* Blue background */
    border: none;
    color: #007bff; /* White text */
    font-weight: bold;
    padding: 5px 10px;
    cursor: pointer;
}

.vote-btn:hover i {
    color: #007bff; /* Darker blue on hover */
    background: rgba(0, 30, 128, 0.24);
    transform: scale(1.3);
}

/* Pagination Styling */
.pagination {
    justify-content: center;
    margin-top: 10px;
}

.pagination .page-item .page-link {
    padding: 8px 14px;
    margin: 3px;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 1px solid #ccc;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* Poll History Section */
.poll-history-container {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.9);
}
.poll-card {
    margin-bottom: 20px;
}



  /* Create Poll Button Style */
  .create-poll-btn {
    font-size: 30px;
    font-weight: bold;
    color: #28a745;
    cursor: pointer;
    position: absolute;
    top: 0;
    right: 20px;
    z-index: 999;
    transition: transform 0.3s ease;
}
.create-poll-btn:hover {
    transform: scale(1.2);
}
  /* Tooltip style for Create Poll Button */
  .tooltip-text {
    visibility: hidden;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 5px;
    padding: 5px;
    position: absolute;
    bottom: 50px; /* Position above the button */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    font-size: 10px; /* Smaller text */
    transition: opacity 0.3s ease;
}
.create-poll-btn:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}
/* Center the empty message if no polls exist */
.no-polls-message {
    text-align: center;
    font-size: 18px;
    color: #777;
}
/* Increased container width for larger screens */
.container {
    max-width: 95%; /* Increases the container width */
}
/* Increase table width */
table {
    width: 100%;
}
th, td {
    text-align: center;
}

/* view survey*/
.create-survey-btn {
    font-size: 30px;
    font-weight: bold;
    color: #17a2b8;
    cursor: pointer;
    position: absolute;
    top: 0;
    right: 20px;
    z-index: 999;
    transition: transform 0.3s ease;
}
.create-survey-btn:hover {
    transform: scale(1.2);
}
.create-survey-btn:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}
/* Survey History Section Styling */
.survey-card {
    margin-bottom: 20px;
}
.survey-list {
    margin-top: 20px;
}
/* Center the empty message if no surveys exist */
.no-surveys-message {
    text-align: center;
    font-size: 18px;
    color: #777;
}
@media (max-width: 768px) {
    .create-survey-btn {
        font-size: 25px;
        top: 15px;
        right: 15px;
    }
    .survey-card {
        margin-bottom: 15px;
    }
    .card-body {
        padding: 15px;
    }
    .manage-btn {
        font-size: 14px;
        padding: 5px 8px;
    }
    .survey-list {
        margin-top: 10px;
    }
    .no-surveys-message {
        font-size: 16px;
    }
}
.error-message {
    color: red;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.length-message {
    font-size: 12px;
    color: black;
    margin-top: 5px;
    display: none;
}

.length-message.red {
    color: red;
}

/* Optional: Adjust the container width */
.custom-container {
    max-width: 55%; /* Set max-width */
}

/* pie chart */
.pie-chart-container {
    max-width: 300px;
    margin: 20px auto;
}

/* user votepoll */
.vote-container { display: none; margin-top: 20px; }
.error-message { color: red; font-size: 14px; margin-top: 5px; }
.disabled { pointer-events: none; opacity: 0.6; }

/* poll result */
.chart-container {
    width: 100%;
    max-width: 300px; /* Limits chart size */
    height: auto;
    min-height: 200px;
    margin: 15px auto; /* Centers charts */
    display: flex;
    justify-content: center;
}
.small-container {
    background: #f9fafb;
    max-width: 50%; /* Makes the container smaller */
    width: 90%; /* Keeps it responsive */
    margin: auto; /* Centers it */
    padding: 20px;
    box-shadow: none; /* Optional: Adds a soft shadow */
    border-radius: 10px; /* Optional: Rounded corners */
}

@media (max-width: 768px) { /* Adjust for small screens */
    .small-container {
        max-width: 95%;
        padding: 15px;
    }
}

@media (max-width: 576px) { /* For small screens */
    .chart-container {
        max-width: 250px;
    }
}

/* create poll icon */
.tooltip-btn i {
    font-size: 1.3rem; /* Increase the icon size */
    vertical-align: middle;
}

.tooltip-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px; /* Add spacing between icon and text */
    padding: 8px 12px;
    font-size: 1rem; 
}


.custom-tooltip {
    visibility: hidden;
    background-color: black;
    color: #fff;
    text-align: center;
    padding: 5px 8px;
    border-radius: 5px;
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    white-space: nowrap;
}

.tooltip-btn:hover .custom-tooltip {
    visibility: visible;
}

/* pie and bar chart of poll result */
.chart-container {
    width: 100%;
    max-width: 300px; /* Keeps pie chart small */
    height: auto;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#pollBarChart {
    height: 386px !important; /* Increase height of bar chart */
    max-height: 600px;
}

.small-container {
    max-width: 50%; /* Makes the container smaller */
    width: 90%; /* Keeps it responsive */
    margin: auto; /* Centers it */
    padding: 20px;
    box-shadow: none; /* Optional: Adds a soft shadow */
    border-radius: 10px; /* Optional: Rounded corners */
}

@media (max-width: 768px) { /* Adjust for small screens */
    .small-container {
        max-width: 95%;
        padding: 15px;
    }
}

@media (max-width: 576px) { /* For small screens */
    .chart-container {
        max-width: 250px;
    }
}
.chart-wrapper {
    display: flex;
    justify-content: space-around; /* Space between charts */
    align-items: center;
    flex-wrap: wrap; /* Ensures responsiveness */
}

@media (max-width: 768px) { 
    .chart-wrapper {
        flex-direction: column; /* Stack on small screens */
    }
}

.transparent-footer {
    background: transparent !important; /* No background */
    text-align: center;
    padding: 10px;
    color: #333; /* Adjust text color if needed */
    position: relative;
}

/* create poll page */
    /* Light background for the container */
.custom-container {
    background: #e9e9eb; /* Light grayish-white */
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.9); /* Soft shadow */
}

/* Card styling */
/* Card styling with border */
.card {
    background: #ffffff; /* White background */
    border: 2px solid #dee2e6; /* Light gray border */
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.05); /* Subtle shadow */
}

/* Card Header */
.card-header {
    background: #e9ecef; /* Soft gray */
    font-weight: bold;
    color: #333; /* Dark text */
    border-bottom: 2px solid #dee2e6; /* Match card border */
}


/* Input fields */
.form-control {
    border: 1px solid #ced4da;
    border-radius: 6px;
}

/* Selection dropdown */
.form-select {
    border: 1px solid #ced4da;
    border-radius: 6px;
}

/* Light error messages */
.error-message {
    color: #dc3545;
    font-size: 14px;
    display: none;
}

/* Button styles */
.btn-primary {
    background: #007bff;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #0056b3;
}

/* Adjust margin for better spacing */
.mb-3 {
    margin-bottom: 15px;
}

.btn.delete i {
    color: red;
    display: inline-block !important;
    font-size: 1.5rem;
    transition: transform 0.2s ease-in-out !important;
}

/* Hover effect: Enlarge icon */
.btn.delete:hover i {
    transform: scale(1.8) !important; /* Increase size by 1.5x */
}

@media (max-width: 768px) {
    .custom-container {
        max-width: 90%
    }
}

/* Table Wrapper */
.table-responsive {
    overflow-x: auto;
    padding: 20px;
    /* background: #dbdbdb6e; */
    border-radius: 15px;
    /* box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.5); Soft shadow */
}

/* Apply styles ONLY to the poll table */
.admin-poll-table {
    border-radius: 12px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.admin-poll-table tbody td {
    padding: 12px 16px;
    text-align: center;
    font-size: 14px;
    vertical-align: middle;
    transition: all 0.3s ease-in-out;
}

.admin-poll-table thead th {
    background-color: rgb(215 215 215) !important;
    font-weight: bold;
    color: #343a40 !important;
    padding: 14px 16px;
    text-align: center;
    font-size: 16px;
    border-bottom: 3px solid #ccc;
}

.admin-poll-table tbody tr:hover {
    background-color: #f1f3f5;
}

.admin-poll-table tbody tr:nth-of-type(odd) {
    background-color: #f9f9f9;
}

.admin-poll-table tbody tr:nth-of-type(even) {
    background-color: #ffffff;
}

/* .admin-poll-table tbody tr td:first-child,
.admin-poll-table thead th:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.admin-poll-table tbody tr td:last-child,
.admin-poll-table thead th:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
} */

/* Status Toggle */
.admin-poll-table tbody td .form-switch {
    display: flex;
    justify-content: center;
    align-items: center;
}
/* For small screens, add horizontal scroll */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
    }
}
    
/* Light background for the container */
.small-container {
    background: #e9e9eb; /* Light grayish-white */
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.9); /* Soft shadow */
}

    /* Overlay background */
    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.8);
        z-index: 10;
      }
  
      /* Voting Modal */
      .vote-container {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 400px;
        background: white;
        padding: 20px;
        box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
        z-index: 11;
        border-radius: 8px;
      }
  
      /* Close Button */
      .close-btn {
        position: absolute;
        top: 10px;
        right: 15px;
        font-size: 20px;
        cursor: pointer;
      }

      .survey-history-container {
        background: #f9f9f9;
        padding: 25px;
        border-radius: 15px;
        box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.9);
    }
    /* Table Container */
    .table-responsive {
        overflow-x: auto;
        padding: 15px;
        /* background: #ffffff; */
        border-radius: 10px;
        /* box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1); */
    }
    
    /* Table Styling */
    .table {
        border-collapse: collapse;
        width: 100%;
        background-color: #ffffff;
        border: 1px solid #ddddddf0; /* Border around the entire table */
    }
    
    /* Table Headers */
    .table thead {
        background-color: #343a40;
        color: #ffffff;
    }
    
    .table th {
        color: #212529;
        background: #d3d3d3f0;
        padding: 12px;
        text-align: center;
        border: 2px solid #ddddddf0; /* Border for table headers */
    }
    
    /* Table Cells */
    .table td {
        padding: 10px;
        text-align: center;
        border-left: 2px solid #ddddddf0; /* Left border for each column */
        border-right: 2px solid #ddddddf0; /* Right border for each column */
    }
    
    /* Row Separator */
    .table tbody tr {
        border-bottom: 2px solid #ddddddf0; /* Horizontal line after each row */
    }
    
    /* Ensure hover effect applies to the entire row */
    .table tbody tr:hover {
        background-color: #d3d3d3 !important; /* Light grey */
        transition: background-color 0.3s ease-in-out;
    }
    
    /* Override Bootstrap's striped table styles */
    .table-striped tbody tr:nth-of-type(odd):hover,
    .table-striped tbody tr:nth-of-type(even):hover {
        background-color: #d3d3d3 !important; /* Ensure hover applies on striped rows */
    }
    
    .vote-popup {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        justify-content: center;
        align-items: center;
        z-index: 9999;
    }
    
    /* Popup box */
    .popup-content {
        background: white;
        padding: 30px;
        text-align: center;
        border-radius: 10px;
        box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
        animation: fadeIn 0.3s ease-in-out;
        max-width: 400px;
    }
    .thumbs-up {
        font-size: 10rem;  /* 2x larger than text */
        text-align: center;
        margin-bottom: 10px;
        color: #28a745;
    }
    
    /* Large heading */
    .popup-content h2 {
        font-size: 2rem;
        font-weight: bold;
        margin-bottom: 10px;
    }
    
    /* Text message */
    .popup-content p {
        font-size: 1.2rem;
        color: #555;
    }
    
    /* Smooth fade-in effect */
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }   

    .btn.reset {
        background :none;
        color:green;
        border: none;
    }
    .btn.reset:hover {
        background : none;
        color: green;
    }

    .btn.btn-danger {
        font-size: 1.4rem;
        background:none;
        color:red;
        border :none;
    }

    @media (max-width: 375px) {
        .table-container {
            width: 100%;
            overflow-x: auto; /* Enables horizontal scrolling */
        }
    
        table {
            min-width: 350px; /* Ensures the table doesn't shrink too much */
            border-collapse: collapse;
        }
    
        th, td {
            padding: 8px;
            text-align: center;
            word-wrap: break-word;
        }
    } 
