/* Base styles */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #4a4aff, #7a7aff); /* Restored blue gradient */
    min-height: 100vh;
}

.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    margin: 0 0 20px;
    font-size: 1.5em;
    color: #333;
    text-align: center;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.header h1 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

.logout-btn {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.logout-btn:hover {
    background: #c82333;
}

/* Counter Section */
.counter-section {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    background: linear-gradient(135deg, #4a4aff, #7a7aff);
    padding: 25px;
    border-radius: 12px;
    margin: 25px 0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    color: white;
    font-family: 'Poppins', sans-serif;
}

.counter-card {
    flex: 1;
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 10px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.counter-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.25);
}

.counter-card h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.counter-card p {
    margin: 8px 0 0;
    font-size: 2.2em;
    font-weight: 600;
}

/* Tabs */
.tab-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    background: #e9ecef;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.tab.active, .tab:hover {
    background: #007bff;
    color: white;
}

/* Content */
.content {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.error-message {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.success-message {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* Search Bar */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 10px;
    flex: 1;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    flex: 1;
    background: #fff; /* Ensure readability against blue background */
}

.location-filter, .category-filter {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff; /* Ensure readability */
}

.search-btn {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #0069d9;
}

.clear-search {
    color: #dc3545;
    text-decoration: none;
    font-size: 14px;
}

/* Buttons */
.download-btn, .upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.download-btn {
    background: #4CAF50;
    color: white;
}

.download-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.upload-btn {
    background: #2196F3;
    color: white;
}

.upload-btn:hover {
    background: #1e88e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.download-btn::before, .upload-btn::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    background-size: contain;
    background-repeat: no-repeat;
}

.download-btn::before {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PHBhdGggZD0iTTEyIDIwVjgiLz48cGF0aCBkPSJtNiAxNCA2IDYgNi02Ii8+PHBhdGggZD0iTTIxIDRIMyIvPjwvc3ZnPg==');
}

.upload-btn::before {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PHBhdGggZD0iTTEyIDR2MTIiLz48cGF0aCBkPSJtMTYgMTAtNi02LTYgNiIvPjxwYXRoIGQ9Ik0zIDIwSDIxIi8+PC9zdmc+');
}

.add-btn, .select-multiple-btn, .delete-selected-btn, .modify-btn, .delete-btn, .delete-btn-with-items {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 5px;
}

.add-btn {
    background: #28a745;
    color: white;
}

.add-btn:hover {
    background: #218838;
}

.select-multiple-btn {
    background: #007bff;
    color: white;
}

.select-multiple-btn:hover {
    background: #0069d9;
}

.delete-selected-btn {
    display: none;
    background: #dc3545;
    color: white;
}

.delete-selected-btn:hover {
    background: #c82333;
}

.modify-btn {
    background: #17a2b8;
    color: white;
}

.modify-btn:hover {
    background: #138496;
}

.delete-btn, .delete-btn-with-items {
    background: #dc3545;
    color: white;
}

.delete-btn:hover, .delete-btn-with-items:hover {
    background: #c82333;
}

/* Table */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

th {
    background: #f8f9fa;
    font-weight: 600;
}

.checkbox-column {
    width: 50px;
    display: none;
}

.action-column {
    width: 150px;
}

.password-text {
    display: none;
}

.eye-icon {
    cursor: pointer;
    margin-left: 5px;
}

/* Delete Confirmation */
.delete-confirmation {
    display: none;
    margin-top: 8px;
    padding: 10px;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    border-radius: 5px;
}

.delete-confirmation-message {
    color: #dc3545;
    font-size: 0.9em;
    margin-bottom: 8px;
    font-weight: 500;
}

.confirm-delete-btn, .cancel-delete-btn {
    padding: 6px 12px;
    margin-right: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.confirm-delete-btn {
    background: #dc3545;
    color: white;
}

.confirm-delete-btn:hover {
    background: #c82333;
}

.cancel-delete-btn {
    background: #6c757d;
    color: white;
}

.cancel-delete-btn:hover {
    background: #5a6268;
}

/* Popup */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.popup-content {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    margin: 50px auto;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
}

.form-grid {
    display: grid;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input, .form-group select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff; /* Ensure readability */
}

.icon-select {
    padding: 5px;
    border-radius: 3px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
}

.icon-select option {
    padding: 5px;
}

.submit-btn {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.submit-btn:hover {
    background: #218838;
}

/* Hidden Checkbox */
.hidden-checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.hidden-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Loading Bar */
.loading-container {
    display: none;
    margin-top: 10px;
    width: 100%;
    max-width: 400px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.loading-bar {
    height: 8px;
    width: 0%;
    background: linear-gradient(90deg, #4CAF50, #81C784);
    transition: width 7s linear;
    position: relative;
    overflow: hidden;
}

.loading-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
    background-size: 20px 20px;
    animation: moveStripes 1s linear infinite;
}

@keyframes moveStripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.progress-message {
    display: none;
    margin-top: 5px;
    font-size: 14px;
    color: #17a2b8;
    font-family: 'Poppins', sans-serif;
}

/* Fix for action buttons in all sections */
.action-buttons {
    display: none;
    margin-top: 10px;
    position: relative;
    z-index: 10;
}

.action-buttons.active {
    display: flex;
    flex-direction: row;
    gap: 5px;
}

.action-buttons.active .confirm-btn,
.action-buttons.active .cancel-btn {
    display: inline-block !important;
    visibility: visible !important;
}

/* Ensure consistent button styles */
.confirm-btn,
.cancel-btn {
    padding: 5px 10px !important;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em !important;
    margin: 2px !important;
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    text-align: center;
    text-transform: capitalize;
    height: 28px !important;
    line-height: 18px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

.confirm-btn {
    background-color: #5bc0de !important;
    color: white !important;
}

.confirm-btn:hover {
    background-color: #31b0d5 !important;
}

.cancel-btn {
    background-color: #6c757d !important;
    color: white !important;
}

.cancel-btn:hover {
    background-color: #5a6268 !important;
}