/* Admin Panel Styles */

/* Login Screen */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.login-header h2 {
    margin: 0.5rem 0;
    color: #333;
    font-size: 1.8rem;
}

.login-header p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

.login-form {
    margin-bottom: 1.5rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
}

.login-form label i {
    margin-right: 0.5rem;
    color: #667eea;
}

.login-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 4px solid #c33;
}

.btn-block {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
}

.login-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

/* Admin Dashboard */
body.admin-page {
    overflow: auto !important;
    height: auto !important;
}

body:has(.admin-dashboard) {
    overflow: auto !important;
    height: auto !important;
}

.admin-dashboard {
    min-height: 100vh;
    background: #f5f7fa;
    overflow-y: auto;
    height: auto;
}

.admin-header {
    background: white;
    padding: 1.25rem 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-header-left h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-header-left h1 i {
    color: #667eea;
}

.admin-subtitle {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f5f7fa;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #333;
}

.admin-user-info i {
    color: #667eea;
}

/* Admin Content */
.admin-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
}

.stat-icon.critical {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.stat-icon.urgent {
    background: linear-gradient(135deg, #fd7e14 0%, #e8590c 100%);
}

.stat-icon.moderate {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

.stat-icon.total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-info h3 {
    margin: 0;
    font-size: 2rem;
    color: #333;
    font-weight: 700;
}

.stat-info p {
    margin: 0.25rem 0 0 0;
    color: #666;
    font-size: 0.9rem;
}

/* Admin Controls */
.admin-controls {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.search-container {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-container i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-container input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-container input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-container label {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
}

.filter-container select {
    padding: 0.625rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-container select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Pins Table */
.pins-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.pins-table {
    width: 100%;
    border-collapse: collapse;
}

.pins-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.pins-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pins-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

.pins-table tbody tr:hover {
    background: #f8f9fa;
}

.pins-table td {
    padding: 1rem;
    vertical-align: top;
    font-size: 0.9rem;
}

.pins-table td strong {
    color: #333;
    font-size: 1rem;
}

.text-muted {
    color: #999;
}

.urgency-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.source-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: #e7f3ff;
    color: #0066cc;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.relief-needs-cell {
    max-width: 250px;
    line-height: 1.5;
}

.actions-cell {
    white-space: nowrap;
}

.btn-icon {
    padding: 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 1rem;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon.btn-info {
    color: #17a2b8;
    background: #e7f7f9;
}

.btn-icon.btn-info:hover {
    background: #17a2b8;
    color: white;
}

.btn-icon.btn-danger {
    color: #dc3545;
    background: #fee;
}

.btn-icon.btn-danger:hover {
    background: #dc3545;
    color: white;
}

.loading-row {
    text-align: center;
    padding: 3rem !important;
    color: #999;
    font-size: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #999;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 1rem 0 0.5rem 0;
    color: #666;
}

.empty-state p {
    margin: 0;
    font-size: 0.95rem;
}

/* Modal Enhancements */
.modal-large {
    max-width: 800px;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.modal-footer .btn {
    min-width: 120px;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.delete-location-preview {
    background: #f8f9fa;
    padding: 1.25rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.delete-location-preview p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.warning-text {
    background: #fff3cd;
    color: #856404;
    padding: 0.875rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-size: 0.9rem;
    border-left: 4px solid #ffc107;
}

.warning-text i {
    margin-right: 0.5rem;
}

/* Location Details */
.location-details-content {
    max-height: 70vh;
    overflow-y: auto;
}

.detail-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-section h4 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-section h4 i {
    color: #667eea;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item label {
    font-weight: 600;
    color: #666;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    color: #333;
    font-size: 0.95rem;
}

.relief-needs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.relief-need-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #e7f3ff;
    color: #0066cc;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.additional-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    line-height: 1.6;
    margin: 0;
    color: #333;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-success i {
    color: #28a745;
    font-size: 1.25rem;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-error i {
    color: #dc3545;
    font-size: 1.25rem;
}

.toast span {
    color: #333;
    font-size: 0.95rem;
}

/* Download Excel Button */
#downloadExcelBtn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

#downloadExcelBtn:hover {
    background: #229954;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

#downloadExcelBtn:active {
    transform: translateY(0);
}

#downloadExcelBtn i {
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .admin-content {
        padding: 1.5rem;
    }

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

    .pins-table {
        font-size: 0.85rem;
    }

    .pins-table th,
    .pins-table td {
        padding: 0.75rem;
    }
}

@media (max-width: 768px) {
    .admin-header {
        padding: 1rem;
    }

    .admin-header-left h1 {
        font-size: 1.25rem;
    }

    .admin-header-right {
        width: 100%;
        justify-content: space-between;
    }

    .admin-content {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-container {
        width: 100%;
    }

    .filter-container {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .filter-container label {
        font-size: 0.85rem;
    }

    .filter-container select {
        width: 100%;
    }

    /* Make table scrollable on mobile */
    .pins-table-container {
        overflow-x: auto;
    }

    .pins-table {
        min-width: 800px;
    }

    .toast {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }

    .modal-content {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 1.5rem;
    }

    .login-header h2 {
        font-size: 1.5rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .stat-info h3 {
        font-size: 1.5rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Checkbox for marking reached */
.checkbox-container {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.checkbox-container:hover {
    background: #f8f9fa;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #28a745;
}

.checkbox-label {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark + .checkbox-label {
    color: #28a745;
    font-weight: 600;
}

/* Reached badge */
.reached-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #d4edda;
    color: #155724;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.reached-badge i {
    margin-right: 0.25rem;
}

/* Reached location row styling */
.reached-location {
    background: #f8fff9 !important;
    opacity: 0.85;
}

.reached-location:hover {
    background: #e7f7e9 !important;
    opacity: 1;
}

/* Print Styles */
@media print {
    .admin-header,
    .admin-controls,
    .actions-cell,
    .toast {
        display: none !important;
    }

    .admin-content {
        padding: 0;
    }

    .pins-table-container {
        box-shadow: none;
    }

    .pins-table tbody tr:hover {
        background: transparent;
    }
}

/* Password Toggle Styles */
.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #5568d3;
}

.password-input-wrapper input {
    padding-right: 3rem;
}
