/* styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    color: #333;
}

.page {
    min-height: 100vh;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.login-container h1 {
    margin-bottom: 30px;
    text-align: center;
    color: #2c3e50;
    font-size: 28px;
}

.login-container input {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.login-container input:focus {
    outline: none;
    border-color: #3498db;
}

.login-container button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-container button:hover {
    transform: translateY(-2px);
}

.error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

/* Header */
header {
    background: white;
    padding: 20px 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #7f8c8d;
    font-size: 14px;
}

.user-info button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

#logoutBtn {
    background: #e74c3c;
    color: white;
}

#logoutBtn:hover {
    background: #c0392b;
}

#adminBtn {
    background: #27ae60;
    color: white;
}

#adminBtn:hover {
    background: #229954;
}

#backToCatalog {
    background: #95a5a6;
    color: white;
}

#backToCatalog:hover {
    background: #7f8c8d;
}

/* Filters */
.filters {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.filters select, .filters button {
    padding: 10px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.filters select:hover, .filters button:hover {
    border-color: #3498db;
}

#refreshBtn {
    margin-left: auto;
    background: #3498db;
    color: white;
    border: none;
    font-weight: 600;
}

#refreshBtn:hover {
    background: #2980b9;
}

/* Items Grid */
.items-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: #95a5a6;
    font-size: 18px;
}

.item-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    border-color: #3498db;
}

.item-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.item-card-content {
    padding: 20px;
}

.item-card h3 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.item-card .category {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 10px;
    display: inline-block;
    padding: 4px 10px;
    background: #ecf0f1;
    border-radius: 4px;
}

.item-card .status {
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
    margin: 10px 0;
}

.status-available {
    background: #d5f4e6;
    color: #27ae60;
}

.status-pending {
    background: #fff3cd;
    color: #f39c12;
}

.status-claimed {
    background: #f8d7da;
    color: #e74c3c;
}

.item-card .claimed-by {
    font-size: 13px;
    color: #7f8c8d;
    font-style: italic;
    margin-top: 8px;
}

.item-card .claim-btn {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: transform 0.2s;
}

.item-card .claim-btn:hover {
    transform: scale(1.02);
}

/* Admin Form */
.admin-form {
    max-width: 700px;
    margin: 30px auto;
    padding: 35px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.admin-form h2 {
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 24px;
}

.admin-form input,
.admin-form textarea {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.admin-form input:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: #3498db;
}

.file-upload-area {
    margin: 20px 0;
}

.file-upload-area label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.image-preview {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.image-preview img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e1e8ed;
}

.admin-form button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.admin-form button[type="submit"]:hover {
    transform: translateY(-2px);
}

.admin-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#uploadProgress {
    text-align: center;
    margin-top: 15px;
    color: #3498db;
    font-weight: 600;
}

/* All Items Section */
.all-items-section {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.all-items-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 35px;
    border-radius: 12px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #95a5a6;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    transition: color 0.3s;
}

.close:hover {
    color: #2c3e50;
}

.modal-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.modal-images img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .items-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    header {
        padding: 15px 20px;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    #refreshBtn {
        margin-left: 0;
    }
}

/* Image Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.lightbox .close-lightbox {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
}

.lightbox .close-lightbox:hover {
    color: #ccc;
}

.item-card img {
    cursor: zoom-in;
}

/* Request List Styling */
.request-list {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.request-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    margin: 8px 0;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.request-item.grandmother-override {
    border-left-color: #9b59b6;
}

.approve-btn {
    padding: 8px 16px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.approve-btn:hover {
    background: #229954;
}

.reject-btn {
    padding: 8px 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-left: 8px;
}

.reject-btn:hover {
    background: #c0392b;
}

.status-requested {
    background: #e3f2fd;
    color: #1976d2;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.admin-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #7f8c8d;
    transition: all 0.3s;
}

.admin-tab:hover {
    color: #2c3e50;
    background: #ecf0f1;
}

.admin-tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.admin-tab-content {
    display: block;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* User List Table */
.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.users-table th {
    background: #3498db;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.users-table td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

.users-table tr:last-child td {
    border-bottom: none;
}

.users-table tr:hover {
    background: #f8f9fa;
}

.user-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.user-status.confirmed {
    background: #d4edda;
    color: #155724;
}

.user-status.force-change-password {
    background: #fff3cd;
    color: #856404;
}

.user-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.user-group-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #e3f2fd;
    color: #1976d2;
}

.user-group-badge.grandmother {
    background: #f3e5f5;
    color: #7b1fa2;
}

.user-group-badge.admin {
    background: #fff3e0;
    color: #e65100;
}

.user-actions {
    display: flex;
    gap: 8px;
}

.user-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-edit {
    background: #3498db;
    color: white;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-reset {
    background: #f39c12;
    color: white;
}

.btn-reset:hover {
    background: #e67e22;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background: #c0392b;
}

/* Image Carousel Styles */
.modal-image-carousel {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
}

.carousel-main-image {
    width: 100%;
    height: 400px;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: zoom-in;
}

.carousel-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
}

.carousel-btn {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding: 10px 0;
}

.carousel-thumbnail {
    min-width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.3s;
}

.carousel-thumbnail:hover {
    border-color: #3498db;
}

.carousel-thumbnail.active {
    border-color: #2ecc71;
}

.carousel-indicator {
    text-align: center;
    margin-top: 10px;
    color: #7f8c8d;
    font-size: 14px;
}

/* Image Manager for Edit Mode */
.image-manager {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.image-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.image-manager-item {
    position: relative;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.image-manager-item.default-image {
    border-color: #2ecc71;
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
}

.image-manager-preview {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.image-manager-controls {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 5px;
}

.image-manager-btn {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-manager-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.default-badge {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: #2ecc71;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.image-upload-zone {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background: #f8f9fa;
    margin: 10px 0;
    cursor: pointer;
    transition: background 0.3s;
}

.image-upload-zone:hover {
    background: #e8f4f8;
}

.image-upload-zone.dragover {
    background: #d4edff;
    border-color: #2980b9;
}

/* Back to Catalog Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.back-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.back-btn::before {
    content: '←';
    font-size: 20px;
    font-weight: bold;
}

/* Enhanced Request Button in Modal */
.modal-request-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    display: inline-block;
    text-align: center;
    margin: 20px 0 10px 0;
}

.modal-request-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.modal-request-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

/* Priority Selector Container in Modal */
.priority-selector-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border: 2px solid #dee2e6;
}

.priority-selector-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 16px;
    color: #495057;
}

.priority-selector-container select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.priority-selector-container select:hover {
    border-color: #667eea;
}

.priority-selector-container select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Help Modal Styles */
.help-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.help-section h2 {
    margin: 0 0 15px 0;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-section-content {
    background: white;
    color: #2c3e50;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
}

.help-role-card {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
}

.help-role-card h3 {
    margin: 0 0 15px 0;
    color: #667eea;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-role-card ul {
    margin: 10px 0;
    padding-left: 20px;
}

.help-role-card li {
    margin: 8px 0;
    line-height: 1.6;
}

.help-workflow {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border: 2px solid #dee2e6;
}

.help-workflow h3 {
    color: #495057;
    margin: 0 0 15px 0;
    font-size: 20px;
}

.help-step {
    background: white;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    display: flex;
    gap: 15px;
    align-items: start;
}

.help-step-number {
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.help-step-content {
    flex: 1;
}

.help-step-content strong {
    color: #667eea;
    display: block;
    margin-bottom: 5px;
}

.help-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
}

.help-badge.grandchild {
    background: #e3f2fd;
    color: #1976d2;
}

.help-badge.parent {
    background: #f3e5f5;
    color: #7b1fa2;
}

.help-badge.grandmother {
    background: #fff3e0;
    color: #e65100;
}

.location-badge {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #16a085 0%, #27ae60 100%);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.location-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(22, 160, 133, 0.3);
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 10px 15px;
    margin: 5px 0;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

.config-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(2px);
}

.config-item span {
    font-weight: 500;
    color: #2c3e50;
}

.config-remove-btn {
    background: #e74c3c;
    color: white;
    padding: 5px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

.config-remove-btn:hover {
    background: #c0392b;
}

.config-add-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.config-add-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.config-add-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.config-save-btn {
    background: #3498db;
    color: white;
    padding: 10px 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.config-save-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.config-list-container {
    margin: 15px 0;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.status-not-available {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.status-trash {
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
    color: white;
}

.status-donate {
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    color: white;
}

.status-sell {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
}

.status-archived {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    color: white;
    opacity: 0.7;
}

/* Item Card Status Classes */
.item-card.status-not_available {
    border-left: 4px solid #e67e22;
}

.item-card.status-trash {
    border-left: 4px solid #95a5a6;
    opacity: 0.8;
}

.item-card.status-donate {
    border-left: 4px solid #16a085;
}

.item-card.status-sell {
    border-left: 4px solid #8e44ad;
}

/* Archived item styling in admin view */
.item-card.status-archived {
    opacity: 0.6;
    border-left: 4px solid #2c3e50;
}

.item-card.status-archived::after {
    content: '📦 ARCHIVED';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #2c3e50;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* Hidden Item Indicator */
.item-card.hidden-from-grandchildren {
    border: 2px dashed #e67e22;
    background: repeating-linear-gradient(
        45deg,
        #ffffff,
        #ffffff 10px,
        #fff3e0 10px,
        #fff3e0 20px
    );
}

.hidden-badge {
    background: #e67e22;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    display: inline-block;
}

/* Admin Controls Section */
.admin-controls-section {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.admin-controls-section h4 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 16px;
}

.admin-controls-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
}

.admin-controls-section select {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.admin-controls-section button {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 5px;
}

.admin-controls-section button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.admin-controls-section hr {
    margin: 15px 0;
    border: none;
    border-top: 1px solid #dee2e6;
}

/* Checkbox Labels */
.admin-controls-section label.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.admin-controls-section label.checkbox-label:hover {
    background: #e9ecef;
}

.admin-controls-section input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Manual Assignment Section */
.manual-assignment-section {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #9b59b6;
    margin-top: 15px;
}

/* Status Change Buttons */
.status-update-btn {
    background: #3498db;
    color: white;
}

.status-update-btn:hover {
    background: #2980b9;
}

.visibility-btn {
    background: #e67e22;
    color: white;
}

.visibility-btn:hover {
    background: #d35400;
}

.archive-btn {
    background: #95a5a6;
    color: white;
}

.archive-btn:hover {
    background: #7f8c8d;
}

.assign-btn {
    background: #9b59b6;
    color: white;
}

.assign-btn:hover {
    background: #8e44ad;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .admin-controls-section {
        padding: 10px;
    }
    
    .admin-controls-section h4 {
        font-size: 14px;
    }
}

/* Auto Logout Warning Modal Styling */
#inactivityWarningModal .modal-content {
    animation: shake 0.5s;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

#countdownDisplay {
    font-family: 'Courier New', monospace;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    transition: color 0.3s ease;
}

#inactivityWarningModal button {
    transition: all 0.3s ease;
}

#inactivityWarningModal button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#inactivityWarningModal button:active {
    transform: translateY(0);
}

/* NEW Badge - Sparkly gold/yellow gradient */
.new-badge {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.new-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(243, 156, 18, 0.4);
}

/* CHANGED Badge - Blue gradient */
.changed-badge {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.changed-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(52, 152, 219, 0.4);
}

/* Badge container alignment */
.item-card-content .category,
.item-card-content .location-badge,
.item-card-content .new-badge,
.item-card-content .changed-badge {
    vertical-align: middle;
}

/* Responsive: Stack badges on mobile */
@media (max-width: 480px) {
    .new-badge,
    .changed-badge {
        display: block;
        margin: 5px 0;
        width: fit-content;
    }
}

/* Private Comment Badge */
.private-comment-badge {
    display: inline-block;
    padding: 3px 8px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3);
    vertical-align: middle;
}

/* Private Comment Container */
.comments-section [style*="background: #fff3cd"] {
    position: relative;
}

/* Private Comment Checkbox */
#privateCommentCheckbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

#privateCommentCheckbox:checked {
    accent-color: #f39c12;
}

/* Private Comment Label */
.comments-section label[style*="cursor: pointer"] {
    user-select: none;
    font-size: 14px;
    color: #7f8c8d;
    transition: color 0.3s ease;
}

.comments-section label[style*="cursor: pointer"]:hover {
    color: #2c3e50;
}

/* Improved Mobile Layout */
@media (max-width: 768px) {
    /* Larger touch targets for buttons */
    button {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 12px 20px !important;
        font-size: 16px !important;
    }
    
    /* Better item card layout on mobile */
    .items-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding: 10px !important;
    }
    
    .item-card {
        padding: 15px !important;
    }
    
    .item-image {
        max-height: 200px !important;
    }
    
    /* Modal improvements for mobile */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px auto !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
    
    .modal-body {
        padding: 15px !important;
    }
    
    /* Stack modal buttons vertically on mobile */
    .modal-content button {
        display: block !important;
        width: 100% !important;
        margin: 5px 0 !important;
    }
    
    /* Better form inputs on mobile */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 12px !important;
        width: 100% !important;
    }
    
    /* Priority selector on cards */
    .priority-select {
        font-size: 14px !important;
        padding: 8px !important;
        min-height: 40px !important;
    }
    
    /* Request button on cards */
    .claim-btn {
        width: 100% !important;
        margin-top: 10px !important;
    }
    
    /* Comment section improvements */
    .comments-section {
        padding: 10px !important;
    }
    
    #newComment {
        font-size: 16px !important;
        padding: 10px !important;
    }
    
    /* Badge spacing on mobile */
    .new-badge,
    .changed-badge,
    .location-badge {
        display: block !important;
        margin: 5px 0 !important;
        width: fit-content !important;
    }
    
    /* Navigation improvements */
    nav button {
        margin: 5px !important;
        padding: 10px 15px !important;
    }
    
    /* User name display */
    #userName {
        font-size: 14px !important;
    }
    
    /* Admin panel on mobile */
    #adminPanel button {
        width: 100% !important;
        margin: 5px 0 !important;
    }
    
    /* Image upload preview */
    .image-preview {
        max-width: 100% !important;
    }
    
    /* Settings page on mobile */
    .settings-section {
        padding: 10px !important;
    }
    
    .settings-section input {
        width: 100% !important;
    }
}

/* Tablet-specific adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .items-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .modal-content {
        width: 80% !important;
    }
}

/* Touch-friendly improvements for all devices */
.item-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

button:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Improve scrolling on mobile */
body {
    -webkit-overflow-scrolling: touch;
}

/* Better tap highlighting */
button, a, .item-card {
    -webkit-tap-highlight-color: rgba(52, 152, 219, 0.2);
}

/* Prevent text selection on double-tap */
.item-card, button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection in inputs and textareas */
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Loading indicator improvements */
.loading {
    font-size: 18px !important;
    padding: 20px !important;
}

/* Auto-logout modal mobile improvements */
@media (max-width: 768px) {
    #inactivityWarningModal {
        width: 90% !important;
        padding: 20px !important;
    }
    
    #countdownDisplay {
        font-size: 48px !important;
    }
}

.btn-verify {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-verify:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
}

.btn-verify:active {
    transform: translateY(0);
}

/* Email Verified Badge Styles */
.email-verified-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.email-verified-badge.verified {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.email-verified-badge.unverified {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffeaa7;
}