        :root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --border-radius: 12px;
    --box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
    --android-elevation: 0 2px 4px rgba(0,0,0,0.1);
}
/* تحسين واجهة الفلترة */
.history-filters {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

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

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

.filter-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
}

.filter-group input,
.filter-group select {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 0.9rem;
}

.checkbox-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.filters-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* تحسين Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.pagination {
    display: flex;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #007bff;
    background: white;
    color: #007bff;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: #007bff;
    color: white;
}

.pagination-btn.active {
    background: #007bff;
    color: white;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.9rem;
}

/* تحسين عرض البيانات */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 1rem;
    align-items: center;
    transition: all 0.3s ease;
}

.history-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.history-item.has-location {
    border-left: 4px solid #28a745;
}

.loading-history {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
    background: #f8d7da;
    border-radius: 5px;
}

/* الإحصائيات */
.stats-info {
    background: #e7f3ff;
    color: #0066cc;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.loading-history {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    font-size: 1.1rem;
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
    background: #f8d7da;
    border-radius: 8px;
    margin: 1rem 0;
}

/* تحسينات للهواتف */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        text-align: center;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .filters-actions {
        justify-content: center;
    }
}
.institution-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid #bbdefb;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.institution-badge i {
    font-size: 0.7rem;
}

/* تحسينات للهواتف */
@media (max-width: 768px) {
    .institution-badge {
        max-width: 100px;
        font-size: 0.7rem;
    }
}
/* Loading Overlay لكامل الصفحة */
.fullpage-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    color: white;
    font-size: 1.2rem;
}

.fullpage-loading .spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

.fullpage-loading .loading-text {
    text-align: center;
    margin-top: 1rem;
}

/* تحسينات للإشعارات */
.modern-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 5px solid var(--primary-color);
    max-width: 400px;
    min-width: 300px;
}

.modern-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.modern-notification.success {
    border-left-color: var(--success-color);
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
}

.modern-notification.error {
    border-left-color: var(--danger-color);
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
}

.modern-notification.warning {
    border-left-color: var(--warning-color);
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
}

.modern-notification.info {
    border-left-color: var(--info-color);
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.notification-icon {
    font-size: 1.5rem;
}

.notification-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

.notification-message {
    margin: 0;
    line-height: 1.5;
    color: #333;
}

.notification-progress {
    height: 4px;
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
    margin-top: 1rem;
    overflow: hidden;
}

.notification-progress-bar {
    height: 100%;
    background: currentColor;
    width: 100%;
    animation: progressBar 3s linear forwards;
}

@keyframes progressBar {
    from { width: 100%; }
    to { width: 0%; }
}

/* تحسينات للقراءة المحاكاة */
.simulation-warning {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
    animation: pulse 2s infinite;
}

.simulation-warning i {
    color: #856404;
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

/* تحسينات للأزرار أثناء التحميل */
.android-btn.loading {
    position: relative;
    color: transparent;
}

.android-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

/* تصميم أندرويد */
.android-body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    direction: rtl;
}

.android-app {
    max-width: 100%;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: var(--box-shadow);
    position: relative;
}

/* الهيدر */
.android-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1.5rem 1rem;
    box-shadow: var(--android-elevation);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.app-title {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
}

.meter-number-badge {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

/* المحتوى الرئيسي */
.android-main {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.android-card {
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--android-elevation);
    border: 1px solid #e9ecef;
    overflow: hidden;
    transition: var(--transition);
}

.android-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.card-header {
    background: var(--light-color);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--dark-color);
    font-weight: 500;
}

.card-content {
    padding: 1.5rem;
}

/* شبكة المعلومات */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.info-label {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.85rem;
}

.info-value {
    color: #555;
    font-size: 1rem;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
}

.status-active {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* عرض القراءة */
.reading-display {
    text-align: center;
    padding: 2rem 1rem;
}

.reading-value {
    font-size: 3.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 1rem 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.reading-unit {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 1rem;
}

.reading-date {
    color: #888;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.no-reading {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

/* قسم الكاميرا */
.camera-wrapper {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

/* تحديد منطقة الرقم في الكاميرا */

/* تحسينات كاملة لعرض الموقع */
.location-info {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 2px solid #90caf9;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    display: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.location-info.active {
    display: block;
    animation: fadeInUp 0.5s ease;
}

.location-info.error {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border-color: #ef5350;
}

.location-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255,255,255,0.5);
}

.location-header h4 {
    margin: 0;
    color: #1976d2;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.location-status {
    background: rgba(255,255,255,0.9);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.location-status.active {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.location-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
}

.location-card-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.location-card-header h5 {
    margin: 0;
    color: #333;
    font-size: 1rem;
}

.location-card-header i {
    color: #1976d2;
    font-size: 1.1rem;
}

.location-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.coordinate-item, .info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.coordinate-label, .info-label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.coordinate-value, .info-value {
    color: #333;
    font-weight: 500;
    text-align: left;
    direction: ltr;
}

/* عرض الدقة */
.accuracy-display {
    text-align: center;
    padding: 0.5rem 0;
}

.accuracy-value {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.accuracy-level {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.accuracy-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.accuracy-progress {
    height: 100%;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* أزرار الإجراءات */
.location-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.5);
}

.android-btn.outline {
    background: transparent;
    border: 2px solid #1976d2;
    color: #1976d2;
}

.android-btn.outline:hover {
    background: #1976d2;
    color: white;
}

/* محتوى الخطأ */
.location-error-content {
    text-align: center;
    padding: 1rem;
}

.location-error-content p {
    margin-bottom: 1rem;
    color: #721c24;
    font-size: 1rem;
}

/* تحسينات للهواتف */
@media (max-width: 768px) {
    .location-grid {
        grid-template-columns: 1fr;
    }
    
    .location-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .location-actions {
        flex-direction: column;
    }
    
    .android-btn.small {
        width: 100%;
        justify-content: center;
    }
    
    .coordinate-item, .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    
    .coordinate-value, .info-value {
        text-align: right;
        width: 100%;
    }
}

/* الرسوم المتحركة */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* تحميل الموقع */
.location-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.location-loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #1976d2;
}

/* تحديث CSS لمعلومات الجلسة */
.session-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    font-size: 0.9rem;
}

.session-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.8rem;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    border-left: 4px solid #7b1fa2;
}

.session-label {
    font-weight: 600;
    color: #333;
    font-size: 0.85rem;
}

.session-value {
    color: #555;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
}

/* بيانات الجلسة */
.session-info {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    border: 1px solid #ce93d8;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.session-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    font-size: 0.9rem;
}

.session-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.session-label {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.8rem;
}

.session-value {
    color: #555;
}
#cameraVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.55);
    color: white;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.camera-overlay.active {
    opacity: 1;
}

/* أزرار الأندرويد */
.android-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
}

.android-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.android-btn:active {
    transform: scale(0.98);
}

.android-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.android-btn.primary {
    background: var(--primary-color);
}

.android-btn.secondary {
    background: #6c757d;
}

.android-btn.success {
    background: var(--success-color);
}

.android-btn.danger {
    background: var(--danger-color);
}

.android-btn.warning {
    background: var(--warning-color);
    color: var(--dark-color);
}

.camera-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

/* دليل الالتقاط */
.capture-guide {
    background: #fff8e1;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.capture-guide h4 {
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: right;
}

.guide-list {
    margin: 0;
    padding-right: 1.5rem;
    text-align: right;
}

.guide-list li {
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

/* نموذج التصحيح اليدوي */
.manual-correction-form {
    animation: fadeIn 0.3s ease-in-out;
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed var(--primary-color);
}

.manual-input-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: end;
}

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

.input-field label {
    font-weight: bold;
    color: #333;
}

.input-field input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 1.2rem;
    text-align: center;
    background: white;
}

.manual-buttons {
    display: flex;
    gap: 0.5rem;
}

.manual-help {
    margin-top: 1rem;
    padding: 0.8rem;
    background: #fff3cd;
    border-radius: 6px;
    border: 1px solid #ffeaa7;
    font-size: 0.9rem;
    color: #856404;
}

/* نتيجة القراءة */
.reading-result {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 1rem;
    text-align: center;
    display: none;
    transition: all 0.3s ease;
}

.reading-result.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.reading-result.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.detected-reading {
    font-size: 2.2rem;
    font-weight: bold;
    margin: 1rem 0;
    color: var(--success-color);
}

.result-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

/* سجل القراءات */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* تحسينات لعرض الصور في السجل */
.history-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 2fr auto;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--info-color);
    transition: var(--transition);
    align-items: center;
}

.history-image {
    text-align: center;
}

.android-btn.small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    min-width: auto;
}

.no-image {
    color: #6c757d;
    font-size: 0.8rem;
}

/* تحسينات لعرض الموقع في سجل القراءات */
.history-item.has-location {
    border-left: 4px solid #28a745;
    background: linear-gradient(135deg, #f8fff8, #e8f5e8);
}

/* أنماط عرض الموقع الجغرافي */
.history-location {
    grid-column: 1 / -1;
    margin-top: 0.8rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #28a745;
}

.history-item.has-location {
    border-left: 4px solid #28a745;
    background: linear-gradient(135deg, #f8fff8, #e8f5e8);
}

.location-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.location-coordinates {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #333;
    font-weight: 500;
}

.location-coordinates i {
    color: #28a745;
}

.coord {
    background: #e8f5e8;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.coord-separator {
    color: #6c757d;
}

.location-accuracy,
.location-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #555;
    font-size: 0.8rem;
}

.location-accuracy i,
.location-time i {
    font-size: 0.7rem;
}

/* مستويات دقة الموقع */
.high-accuracy { color: #28a745; }
.medium-accuracy { color: #ffc107; }
.low-accuracy { color: #fd7e14; }
.very-low-accuracy { color: #dc3545; }

.accuracy-level {
    font-size: 0.75rem;
    opacity: 0.8;
}

.no-location-badge {
    background: #6c757d;
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    opacity: 0.7;
}

/* تحسينات للهواتف */
@media (max-width: 768px) {
    .location-coordinates {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    
    .coord-separator {
        display: none;
    }
    
    .history-location {
        grid-column: 1;
    }
}

.location-badge {
    background: #28a745;
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.no-location-badge {
    background: #6c757d;
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    opacity: 0.6;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* مودال عرض الموقع */
.location-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.location-modal.active {
    opacity: 1;
    visibility: visible;
}

.location-modal-content {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.location-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.location-modal-header h3 {
    margin: 0;
    color: #1976d2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.location-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.location-modal-close:hover {
    background: #f8f9fa;
    color: #dc3545;
}

.stored-location-info {
    margin: 1rem 0;
}

.no-location-data {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* مودال عرض الصورة */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-modal.active {
    opacity: 1;
    visibility: visible;
}

.image-modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
    position: relative;
}

.image-modal img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.image-modal-info {
    margin-top: 1rem;
    color: #333;
}

.image-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.image-modal-close:hover {
    color: #dc3545;
}

@media (max-width: 768px) {
    .history-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .image-modal-content {
        padding: 1rem;
        margin: 1rem;
    }
}

.history-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.history-date, .history-value, .history-reader, .history-notes {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
}

.history-value {
    font-weight: bold;
    color: var(--primary-color);
}

.no-data {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

/* الفوتر */
.android-footer {
    background: var(--dark-color);
    color: white;
    padding: 1.5rem;
    text-align: center;
    margin-top: 2rem;
}

/* تحسينات للهواتف */
@media (max-width: 768px) {
    .android-main {
        padding: 0.5rem;
    }
    
    .app-title {
        font-size: 1.3rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .reading-value {
        font-size: 2.5rem;
    }
    
    .camera-container {
        aspect-ratio: 3 / 4;
    }
    
    .camera-controls {
        gap: 0.5rem;
    }
    
    .android-btn {
        min-width: 120px;
        font-size: 0.9rem;
        padding: 0.7rem 1rem;
    }
    
    .manual-input-group {
        grid-template-columns: 1fr;
    }
    
    .history-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .result-controls {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .android-header {
        padding: 1rem 0.5rem;
    }
    
    .app-title {
        font-size: 1.1rem;
    }
    
    .meter-number-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .reading-value {
        font-size: 2rem;
    }
    
    .camera-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .android-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* الرسوم المتحركة */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

.pulse {
    animation: pulse 2s infinite;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* حالات التقدم */
.progress-status {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    margin: 10px 0;
    font-size: 0.9rem;
    text-align: center;
}

.progress-status.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.progress-status.success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.progress-status.warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.android-error {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    text-align: center;
    margin: 1rem;
}

/* الإشعارات */
.android-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    left: 20px;
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.android-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.android-notification.success {
    border-left-color: var(--success-color);
    background: #d4edda;
}

.android-notification.error {
    border-left-color: var(--danger-color);
    background: #f8d7da;
}

.android-notification.warning {
    border-left-color: var(--warning-color);
    background: #fff3cd;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.android-notification.success .notification-content {
    color: #155724;
}

.android-notification.error .notification-content {
    color: #721c24;
}

.android-notification.warning .notification-content {
    color: #856404;
}

@media (min-width: 768px) {
    .android-notification {
        left: auto;
        max-width: 400px;
    }
}

/* تحديد منطقة الرقم */
/* أنماط منطقة تحديد الأرقام */
.digit-selection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: all;
}

.selection-area {
    position: absolute;
    border: 2px dashed #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
    cursor: move;
    z-index: 11;
}

.selection-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #4CAF50;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
}

.selection-handle.nw {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.selection-handle.ne {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.selection-handle.sw {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.selection-handle.se {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

.selection-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

.selection-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    z-index: 12;
    max-width: 300px;
}

.selection-guide i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.area-selection-btn.active {
    background: #4CAF50;
    color: white;
}

/* أنماط الكاميرا */
.camera-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.camera-container video {
    width: 100%;
    height: auto;
    display: block;
}



.camera-overlay i {
    margin-bottom: 10px;
}

/* النظام الذكي للكاميرا */
.smart-camera-guide {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.5s ease;
}

.guide-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.guide-header i {
    font-size: 1.5rem;
}

.guide-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.step-icon {
    width: 25px;
    height: 25px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.auto-capture-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.1);
    padding: 0.7rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* إطار الالتقاط التلقائي */
.auto-capture-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.frame-border {
    position: absolute;
    top: 15%;
    left: 10%;
    width: 80%;
    height: 30%;
    border: 3px solid rgba(255,255,255,0.8);
    border-radius: 12px;
    box-shadow: 0 0 0 10000px rgba(0,0,0,0.4);
}

.frame-text {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* الإشعارات المحسنة */
.minimal-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.minimal-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.minimal-notification.success {
    background: rgba(40, 167, 69, 0.9);
}

.minimal-notification.error {
    background: rgba(220, 53, 69, 0.9);
}

.important-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid #007bff;
    max-width: 350px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.important-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.important-notification.success {
    border-left-color: #28a745;
}

.important-notification.error {
    border-left-color: #dc3545;
}

.important-notification.info {
    border-left-color: #17a2b8;
}

.notification-icon {
    font-size: 1.5rem;
}

.important-notification.success .notification-icon {
    color: #28a745;
}

.important-notification.error .notification-icon {
    color: #dc3545;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin: 0 0 0.3rem 0;
    font-size: 1rem;
}

.notification-message {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

/* اقتراح الالتقاط */
.capture-suggestion {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    z-index: 10;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.suggestion-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.suggestion-capture-btn {
    background: #007bff;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggestion-capture-btn:hover {
    background: #0056b3;
    transform: scale(1.1);
}

/* تحسينات الواجهة الرئيسية */
.camera-section {
    order: -1; /* جعلها أول قسم */
}

.camera-wrapper {
    max-width: 800px; /* زيادة العرض */
    margin: 0 auto;
}



.camera-controls {
    margin-top: 2rem;
    gap: 1rem;
}

/* تحسينات للهواتف */
@media (max-width: 768px) {
    .smart-camera-guide {
        margin: 1rem;
        border-radius: 12px;
    }
    
    .guide-steps {
        gap: 0.6rem;
    }
    
    .important-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .camera-wrapper {
        margin: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .smart-camera-guide {
        padding: 1rem;
    }
    
    .guide-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .camera-controls {
        flex-direction: column;
    }
    
    .android-btn {
        width: 100%;
    }
}


/* الزر العائم لقراءة جديدة */
.floating-scan-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

.floating-scan-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.6);
}

.floating-scan-btn:active {
    transform: scale(0.95);
}

.floating-scan-btn.pulse {
    animation: pulse-floating 2s infinite;
}

.floating-scan-label {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.floating-scan-btn:hover .floating-scan-label {
    opacity: 1;
    bottom: 85px;
}

/* زر عائم للهواتف */
.mobile-scan-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
    cursor: pointer;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

/* رسوم متحركة للزر العائم */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-floating {
    0% { box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4); }
    50% { box-shadow: 0 6px 30px rgba(0, 123, 255, 0.8); }
    100% { box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4); }
}

/* تحسينات للهواتف */
@media (max-width: 768px) {
    .floating-scan-btn {
        width: 65px;
        height: 65px;
        bottom: 25px;
        left: 25px;
        font-size: 1.4rem;
    }
    
    .mobile-scan-btn {
        display: flex;
    }
    
    .floating-scan-label {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .floating-scan-btn {
        width: 60px;
        height: 60px;
        bottom: 20px;
        left: 20px;
        font-size: 1.3rem;
    }
    
    .mobile-scan-btn {
        width: 55px;
        height: 55px;
        bottom: 20px;
        right: 20px;
        font-size: 1.2rem;
    }
}
   