/* EditReports.css - Styles for EditReports.razor page */

/* ========================================
   Main Layout & Container
   ======================================== */
.er-page-container {
    max-width: auto;
    margin: 1rem;
    min-height: 100vh;
    background-color:white;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Add responsive margins for smaller screens */
@media (max-width: 1200px) {
    .er-page-container {
        margin: 0 20px;
        max-width: calc(100vw - 40px);
    }
}

@media (max-width: 768px) {
    .er-page-container {
        margin: 0 15px;
        max-width: calc(100vw - 30px);
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .er-page-container {
        margin: 0 10px;
        max-width: calc(100vw - 20px);
        padding: 10px;
    }
    
    .er-page-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .er-page-title {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .er-refresh-btn {
        min-width: auto;
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
}

/* Background decorative elements */


@keyframes er-float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.er-page-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
}

.er-page-title {
    font-size: 2rem;
    font-weight: 800;
    color: black;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    padding: 0 20px;
    margin: 0 auto;
    text-align: center;
    flex: 1 1 auto;
}

.er-refresh-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    min-width: 120px;
    justify-content: center;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}
@media (max-width: 768px) {
  .er-page-header {
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .er-refresh-btn {
    position: static;
    transform: none;
    margin-top: 10px;
  }
}

.er-refresh-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.er-refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.er-refresh-btn svg {
    transition: transform 0.3s ease;
}

.er-refresh-btn:hover:not(:disabled) svg {
    transform: rotate(180deg);
}

/* ========================================
   Content Containers
   ======================================== */
.er-edit-form-container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin: 20px 5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.er-reports-selection {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin: 20px 5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.er-loading-state {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.er-empty-state {
    text-align: center;
    padding: 40px;
    font-size: 1.1rem;
    color: #666;
    background: rgba(249, 250, 251, 0.8);
    border-radius: 12px;
    border: 2px dashed #e5e7eb;
}

/* ========================================
   Form Header
   ======================================== */
.er-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f3f4f6;
}

.er-form-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.er-form-close {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.er-form-close:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* ========================================
   Form Elements
   ======================================== */
.er-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.er-form-field {
    display: flex;
    flex-direction: column;
}

.er-form-field-full {
    grid-column: 1 / -1;
}

.er-form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.er-form-input {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.er-form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.er-form-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.er-form-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
}

/* ========================================
   Form Buttons
   ======================================== */
.er-form-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f3f4f6;
}

.er-btn-save {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
}

.er-btn-save:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.er-btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.er-btn-cancel {
    background: #6b7280;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.er-btn-cancel:hover:not(:disabled) {
    background: #4b5563;
    transform: translateY(-2px);
}

/* ========================================
   Report Selection
   ======================================== */
.er-reports-list h3 {
    color: #1f2937;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.er-report-select-btn {
    width: 100%;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.er-report-select-btn:hover {
    border-color: #3b82f6;
    background: #f8faff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.er-report-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.er-report-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 1.1rem;
}

.er-report-date {
    color: #6b7280;
    font-size: 0.9rem;
}

.er-report-type {
    color: #3b82f6;
    font-weight: 500;
    font-size: 0.9rem;
}

/* ========================================
   Tags Section
   ======================================== */
.er-tags-section {
    margin-top: 10px;
}

.er-tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    min-height: 32px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.er-tag-item {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.er-tag-remove {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.er-tag-remove:hover {
    background: rgba(255, 255, 255, 0.3);
}

.er-custom-tag-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.er-custom-tag-input input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.er-custom-tag-input input:focus {
    outline: none;
    border-color: #3b82f6;
}

.er-add-tag-btn {
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.er-add-tag-btn:hover {
    background: #059669;
    transform: scale(1.05);
}

/* ========================================
   Map Section
   ======================================== */
.er-map-button-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.er-map-button {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1rem;
}

.er-map-button:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

.er-coordinates-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.er-coordinate-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.er-coordinate-label {
    font-size: 0.8rem;
    color: #0369a1;
    font-weight: 600;
}

.er-coordinate-value {
    font-size: 0.9rem;
    color: #1e40af;
    font-family: monospace;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e0f2fe;
}

/* ========================================
    z-index: 1;
}

/* ========================================
   Grid Layout
   ======================================== */
.er-reports-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

@media (min-width: 768px) {
    .er-reports-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1200px) {
    .er-reports-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   Report Card Components
   ======================================== */
.er-report-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    z-index: 1;
    margin-left: 0;
    margin-right: 0;
}

.er-report-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(59, 130, 246, 0.05) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.er-report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: rgba(59, 130, 246, 0.2);
}

.er-report-card:hover::before {
    opacity: 1;
}

/* ========================================
   Card Header Section
   ======================================== */
.er-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.er-card-title-section {
    flex: 1;
    min-width: 0;
}

.er-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.er-card-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.er-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

/* Status Badge Variants */
.er-status-pending {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1px solid #fbbf24;
}

.er-status-success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border: 1px solid #10b981;
}

.er-status-closed {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border: 1px solid #ef4444;
}

.er-status-default {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: #374151;
    border: 1px solid #9ca3af;
}

/* ========================================
   Card Details Grid
   ======================================== */
.er-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 1.5rem;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

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

.er-detail-label {
    font-weight: 600;
    color: #4b5563;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.er-detail-value {
    color: #1f2937;
    font-weight: 500;
    line-height: 1.4;
    word-wrap: break-word;
}

.er-detail-full-width {
    grid-column: span 2;
}

.er-detail-specifications {
    line-height: 1.5;
    max-height: 4rem;
    overflow-y: auto;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

/* ========================================
   Edit Form Styles
   ======================================== */
.er-edit-form {
    position: relative;
    z-index: 10;
}

/* Full Page Edit Mode */
.er-edit-fullpage {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.er-edit-container {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.er-edit-header {
    padding: 1.5rem 2rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 1rem 1rem 0 0;
}

.er-edit-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.er-close-btn {
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.er-close-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.er-edit-content {
    padding: 2rem;
}

.er-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 2rem;
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

/* Map Container */
.er-map-button-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.er-map-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.er-map-button:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -1px rgba(59, 130, 246, 0.4);
}

.er-coordinates-info {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    font-size: 0.875rem;
}

.er-map-container {
    grid-column: span 2;
    height: 300px;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.er-map-placeholder {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
}

.er-map-info {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    backdrop-filter: blur(8px);
}

.er-coordinates-display {
    display: flex;
    gap: 1rem;
    font-weight: 600;
}

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

.er-coordinate-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.er-coordinate-value {
    color: #1f2937;
}

.er-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.er-form-field-full {
    grid-column: span 2;
}

.er-form-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.er-form-input {
    padding: 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: white;
}

.er-form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.er-form-textarea {
    min-height: 8rem;
    resize: vertical;
    font-family: inherit;
}

.er-form-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 0.75rem;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
}

.er-form-checkbox-wrapper:hover {
    background: #f3f4f6;
}

.er-form-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: #3b82f6;
    border-radius: 0.25rem;
}

/* ========================================
   Action Buttons
   ======================================== */
.er-actions-container {
    margin-top: auto;
    display: flex !important;
    flex-direction: row !important;
    gap: 1rem;
    flex-wrap: nowrap;
    padding: 1.5rem 2rem;
    background: #f9fafb;
    border-radius: 0 0 1rem 1rem;
    border-top: 1px solid #e5e7eb;
    justify-content: center;
    align-items: center;
}

.er-btn {
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    min-width: 120px;
}

.er-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.er-btn:hover::before {
    left: 100%;
}

.er-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.er-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -1px rgba(59, 130, 246, 0.4);
}

.er-btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.er-btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -1px rgba(16, 185, 129, 0.4);
}

.er-btn-secondary {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: #374151;
    border: 1px solid #d1d5db;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.er-btn-secondary:hover {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    color: #1f2937;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px -1px rgba(0, 0, 0, 0.15);
}

.er-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.er-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ========================================
   Mobile Responsive Design
   ======================================== */
@media (max-width: 767px) {
    .er-actions-container {
        gap: 0.5rem;
        padding: 1rem;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: center;
        align-items: center;
    }

    .er-btn {
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
        flex: 1;
        min-width: 0;
        max-width: 150px;
    }

    .er-reports-grid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .er-report-card {
        padding: 1.25rem;
        margin-left: 0;
        margin-right: 0;
    }

    /* Full page edit mobile */
    .er-edit-fullpage {
        padding: 0.5rem;
    }

    .er-edit-container {
        max-height: 95vh;
    }

    .er-edit-header {
        padding: 1rem 1.5rem 0.75rem;
    }

    .er-edit-title {
        font-size: 1.25rem;
    }

    .er-edit-content {
        padding: 1.5rem;
    }

    .er-form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .er-form-field-full,
    .er-map-container {
        grid-column: span 1;
    }

    .er-map-container {
        height: 250px;
    }

    /* Remove column layout for actions container on mobile */
    /* .er-actions-container { flex-direction: column; } */

    .er-btn {
        min-width: 120px;
        justify-content: center;
    }

    .er-edit-container {
        max-height: 95vh;
    }

    .er-edit-header {
        padding: 1rem 1.5rem 0.75rem;
    }

    .er-edit-title {
        font-size: 1.25rem;
    }

    .er-edit-content {
        padding: 1.5rem;
    }

    .er-form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .er-form-field-full,
    .er-map-container {
        grid-column: span 1;
    }

    .er-map-container {
        height: 250px;
    }

    .er-actions-container {
        flex-direction: row !important;
        justify-content: flex-start;
        align-items: center;
    }

    .er-btn {
        width: 100%;
        justify-content: center;
        min-width: auto;
    }
}

@media (max-width: 480px) {

    .er-page-title {
        font-size: 1.5rem;
    }

    .er-report-card {
        padding: 1rem;
    }

    .er-card-title {
        font-size: 1rem;
    }

    .er-status-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    .er-actions-container {
        flex-direction: column;
    }

    .er-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   Animation & Transitions
   ======================================== */
@keyframes er-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.er-report-card {
    animation: er-fadeInUp 0.6s ease-out;
}

.er-report-card:nth-child(2) {
    animation-delay: 0.1s;
}

.er-report-card:nth-child(3) {
    animation-delay: 0.2s;
}

.er-report-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* ========================================
   Accessibility & Focus States
   ======================================== */
.er-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.er-form-input:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .er-report-card {
        border: 2px solid #000;
    }
    
    .er-status-badge {
        border: 2px solid currentColor;
    }
    
    .er-btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .er-report-card,
    .er-btn,
    .er-form-input {
        transition: none;
        animation: none;
    }
    
    .er-report-card:hover {
        transform: none;
    }
    
    .er-btn:hover {
        transform: none;
    }
}

/* ========================================
   Tags Management Styles
   ======================================== */
.er-tags-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.er-tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
    padding: 10px;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.er-tags-display:hover {
    border-color: #d1d5db;
    background: #f3f4f6;
}

.er-tag-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.er-tag-selected {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.er-tag-selected:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.er-tag-available {
    background: white;
    color: #374151;
    border-color: #d1d5db;
}

.er-tag-available:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.er-tag-text {
    user-select: none;
}

.er-tag-remove {
    font-weight: bold;
    margin-left: 4px;
    opacity: 0.8;
    font-size: 1rem;
    line-height: 1;
}

.er-tag-remove:hover {
    opacity: 1;
}

.er-tag-add {
    font-weight: bold;
    margin-left: 4px;
    opacity: 0.6;
    font-size: 1rem;
    line-height: 1;
}

.er-tag-add:hover {
    opacity: 0.8;
}

.er-custom-tag-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.er-custom-tag-input input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.er-custom-tag-input input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.er-add-tag-btn {
    background: #10b981;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.er-add-tag-btn:hover {
    background: #059669;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.er-add-tag-btn:active {
    transform: scale(0.95);
}

/* Empty state for tags */
.er-tags-display:empty::after {
    content: "لا توجد وسوم محددة";
    color: #9ca3af;
    font-style: italic;
    font-size: 0.9rem;
}

/* Tag animations */
@keyframes tag-added {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.er-tag-item {
    animation: tag-added 0.3s ease-out;
}

/* Display Tags for Report Cards */
.er-display-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.er-display-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid;
    background: white;
}

.er-location-tag {
    color: #059669;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-color: #a7f3d0;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.1);
}

.er-location-tag:hover {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.er-specification-tag {
    color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #93c5fd;
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.1);
}

.er-specification-tag:hover {
    background: linear-gradient(135deg, #dbeafe, #93c5fd);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

/* Responsive display tags */
@media (max-width: 768px) {
    .er-display-tags {
        gap: 0.375rem;
    }
    
    .er-display-tag {
        font-size: 0.6875rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Modal Styles */
.er-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.er-modal-content {
    background: white;
    border-radius: 1rem;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modal-appear 0.3s ease-out;
}

@keyframes modal-appear {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.er-modal-header {
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    border-radius: 1rem 1rem 0 0;
}

.er-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.er-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.er-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.er-modal-body {
    padding: 2rem;
}

/* Enhanced Button Styles */
.er-btn-edit {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.er-btn-edit:hover {
    background: linear-gradient(135deg, #047857, #059669);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -1px rgba(5, 150, 105, 0.4);
}

.er-btn-delete {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.er-btn-delete:hover {
    background: linear-gradient(135deg, #b91c1c, #dc2626);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -1px rgba(220, 38, 38, 0.4);
}

.er-btn-save {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.er-btn-save:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -1px rgba(59, 130, 246, 0.4);
}

.er-btn-cancel {
    background: #f9fafb;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.er-btn-cancel:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.er-modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

/* Button loading state */
.er-btn-loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.er-btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Responsive modal */
@media (max-width: 768px) {
    .er-modal {
        padding: 0.5rem;
    }
    
    .er-modal-content {
        max-height: 95vh;
        border-radius: 0.75rem;
    }
    
    .er-modal-header {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }
    
    .er-modal-body {
        padding: 1.5rem;
    }
    
    .er-modal-buttons {
        flex-direction: column-reverse;
    }
    
    .er-btn-save,
    .er-btn-cancel {
        width: 100%;
        justify-content: center;
    }
    
    /* Additional mobile styles for the new layout */
    .er-form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .er-coordinates-info {
        grid-template-columns: 1fr;
    }
    
    .er-edit-form-container,
    .er-reports-selection {
        padding: 20px;
        margin: 10px 0;
    }
    
    .er-page-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .er-form-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .er-edit-form-container,
    .er-reports-selection {
        padding: 15px;
    }
    
    .er-form-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .er-custom-tag-input {
        flex-direction: column;
    }
    
    .er-custom-tag-input input {
        margin-bottom: 8px;
    }
    
    .er-tags-display {
        min-height: 24px;
        padding: 8px;
    }
    
    .er-tag-item {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}

/* Enhanced animations and transitions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.er-edit-form-container,
.er-reports-selection {
    animation: fadeInUp 0.5s ease-out;
}

.er-report-select-btn {
    animation: fadeInUp 0.3s ease-out;
    animation-fill-mode: both;
}

.er-report-select-btn:nth-child(1) { animation-delay: 0.1s; }
.er-report-select-btn:nth-child(2) { animation-delay: 0.2s; }
.er-report-select-btn:nth-child(3) { animation-delay: 0.3s; }
.er-report-select-btn:nth-child(4) { animation-delay: 0.4s; }
.er-report-select-btn:nth-child(5) { animation-delay: 0.5s; }

/* Improved focus states for accessibility */
.er-form-input:focus,
.er-custom-tag-input input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

.er-report-select-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.er-btn-save:focus,
.er-btn-cancel:focus,
.er-map-button:focus,
.er-add-tag-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .er-page-container {
        background: white !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 20px !important;
    }
    
    .er-page-container::before {
        display: none !important;
    }
    
    .er-form-buttons,
    .er-map-button-container {
        display: none !important;
    }
    
    .er-edit-form-container,
    .er-reports-selection {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* Image Upload Styles */
.er-image-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.er-current-image {
    position: relative;
    display: inline-block;
    max-width: 300px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}

.er-item-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 200px;
    object-fit: cover;
}

.er-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.er-current-image:hover .er-image-overlay {
    opacity: 1;
}

.er-remove-image-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.er-remove-image-btn:hover {
    background: #dc2626;
}

.er-image-upload {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    background: #f9fafb;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
}

.er-image-upload:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.er-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.er-upload-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #6b7280;
}

.er-upload-info svg {
    color: #9ca3af;
}

.er-no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    color: #6b7280;
}

.er-no-image svg {
    color: #9ca3af;
}

.er-upload-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: #f3f4f6;
    border-radius: 8px;
}

.er-progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.er-progress-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 2px;
    animation: progress-animation 2s ease-in-out infinite;
}

@keyframes progress-animation {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Header Controls */
.er-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.er-silent-refresh-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 6px;
    color: #0369a1;
    font-size: 14px;
    font-weight: 500;
}

.er-silent-refresh-indicator svg {
    color: #0ea5e9;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .er-current-image {
        max-width: 100%;
    }
    
    .er-image-upload {
        padding: 16px;
    }
    
    .er-upload-info {
        font-size: 14px;
    }
    
    .er-header-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .er-silent-refresh-indicator {
        font-size: 12px;
        padding: 4px 8px;
    }
}
