/* General Styles */

h2 {
    text-align: center;
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
}

/* Form Styling */
form {
    width:50%;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Responsive Form Layout */
.row1,
.row2,
.row3 {
    display: grid;
    gap: 15px;
}

.row2,
.row3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

label {
    font-weight: bold;
    display: block;
    margin-bottom: 6px;
}

input,
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
}

/* Button Styling */
.button {
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}

.button:hover {
    background-color: #0056b3;
}

/* Dynamic Hold Amount Fields */
.hold-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hold-amount-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex-wrap: wrap;
}

.hold-amount-field select,
.hold-amount-field input {
    flex: 1;
    min-width: 100px;
}

.hold-amount-field button {
    background-color: red;
    color: white;
    font-size: 14px;
    padding: 8px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.hold-amount-field button:hover {
    background-color: #c0392b;
}

/* Success Alert Box */
.success-alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4CAF50;
    color: #fff;
    padding: 15px 25px;
    border-radius: 5px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    z-index: 1000;
}

.success-alert.show {
    opacity: 1;
    visibility: visible;
}

/* Table Styles */
.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    overflow-x: auto;
}

.invoice-table th,
.invoice-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    font-size: 14px;
    word-break: break-word;
}

.invoice-table th {
    background-color: #007bff;
    color: #fff;
}

.invoice-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.invoice-table tr:hover {
    background-color: #f1f1f1;
}



/* icon  */
 .icon {
        width: 20px;
        height: 20px;
        cursor: pointer;
        transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
    }

    .icon:hover {
        transform: scale(1.5);
        opacity: 0.8;
    }

    .edit-icon:hover {
        filter: drop-shadow(0 0 5px #007bff); /* Blue glow for edit */
    }

    .delete-icon:hover {
        filter: drop-shadow(0 0 5px #ff0000); /* Red glow for delete */
    }


/* Center the buttons and apply consistent styling */
.button-container {
    display: flex;
    justify-content: center; /* Center buttons horizontally */
    gap: 10px; /* Space between buttons */
    margin-top: 20px; /* Add some top margin */
}

.action-button {
    background-color: #007BFF; /* Blue background */
    color: white; /* White text */
    padding: 15px 30px; /* Larger padding for bigger buttons */
    border: none; /* Remove border */
    border-radius: 5px; /* Rounded corners */
    cursor: pointer; /* Pointer cursor on hover */
    font-size: 18px; /* Larger font size */
    text-align: center; /* Center text */
    text-decoration: none; /* Remove underline */
    transition: background-color 0.3s ease; /* Smooth hover transition */
}

.action-button:hover {
    background-color: #0056b3; /* Darker blue on hover */
}

#addStateForm, #stateTable {
    display: none; /* Initially hide both the form and the table */
}

/* Success Popup */
.success-popup {
    display: none;
    color: green;
    font-size: 1.2em;
    margin-top: 10px;
}

/* Sorting buttons */
.sortable .sort-buttons {
    margin-left: 5px;
}


.sortable {
            cursor: pointer;
            user-select: none;
        }
.sort-buttons a {
            text-decoration: none;
            color: black;
            font-weight: bold;
            margin-left: 5px;
            margin-right: 5px;
}
.sort-buttons a:hover {
            text-decoration: underline;
        }
        .back-button {
            display: inline-block;
            margin-top: 20px;
            padding: 8px 15px;
            background-color: #28a745;
            color: white;
            border-radius: 5px;
            text-decoration: none;
            font-size: 16px;
        }
        .back-button:hover {
            background-color: #218838;
        }





span .sort-desc:hover{
cursor: pointer;
}

span .sort-asc:hover{
cursor: pointer;
}


/* Responsive Design */
@media (max-width: 1024px) {
    form {
        padding: 15px;
    }

    .row2,
    .row3 {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .invoice-table th,
    .invoice-table td {
        font-size: 12px;
        padding: 8px;
    }
}

@media (max-width: 768px) {
    .row1,
    .row2,
    .row3 {
        grid-template-columns: 1fr;
    }

    .hold-amount-field {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }

    .hold-amount-field select,
    .hold-amount-field input {
        width: 100%;
    }

    .invoice-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    body {
        max-width: 100%;
        padding: 10px;
    }

    form {
        padding: 10px;
    }

    .invoice-table th,
    .invoice-table td {
        font-size: 12px;
        padding: 5px;
    }

    button {
        font-size: 16px;
        padding: 10px;
    }
}
/* Additional Media Queries */

/* For tablets and medium devices */
@media (max-width: 992px) {
    form {
        width: 90%;
    }

    .button-container {
        flex-direction: column;
        align-items: center;
    }

    .action-button {
        width: 100%;
        max-width: 300px;
    }
}

/* For smaller tablets and large phones */
@media (max-width: 600px) {
    .button-container {
        flex-direction: column;
        align-items: stretch;
    }

    .action-button {
        width: 100%;
    }

    .icon {
        width: 16px;
        height: 16px;
    }

    .success-alert {
        width: 90%;
        font-size: 14px;
        padding: 10px 15px;
    }
}

/* For very small phones */
@media (max-width: 360px) {
    h2 {
        font-size: 20px;
    }

    .back-button {
        width: 100%;
        text-align: center;
        font-size: 14px;
        padding: 8px 10px;
    }

    .sort-buttons a {
        font-size: 12px;
    }

    .invoice-table th,
    .invoice-table td {
        font-size: 10px;
        padding: 4px;
    }
}

