:root {
    --primary-color: rgba(52, 152, 219, 0.8);
    --secondary-color: rgba(41, 128, 185, 0.8);
    --accent-color: rgba(231, 76, 60, 0.8);
    --light-color: rgba(236, 240, 241, 0.9);
    --dark-color: rgba(44, 62, 80, 0.8);
    --success-color: rgba(46, 204, 113, 0.8);
    --warning-color: rgba(243, 156, 18, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background: linear-gradient(135deg, #1a2a3a, #2c3e50);
    color: var(--light-color);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.site-banner {
    width: 100%;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    height: 200px;
}

.site-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 20px 0;
    text-align: center;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.logo img {
    max-height: 80px;
    margin-left: 15px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

nav {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 15px 0;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
}

nav ul li {
    margin: 5px 15px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 50px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

nav ul li a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.admin-panel {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--accent-color);
    color: white;
    padding: 12px 15px;
    border-radius: 50px;
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: none;
}

.admin-panel:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.form-section {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 30px;
    margin: 20px 0;
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
    transition: var(--transition);
}

.form-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

h2 {
    color: var(--light-color);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: var(--light-color);
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: var(--transition);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.camera-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

.camera-preview {
    width: 100%;
    max-width: 400px;
    height: 300px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.camera-preview img,
.camera-preview video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.fingerprint-preview {
    width: 200px;
    height: 200px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.fingerprint-preview img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    object-fit: contain;
}

.camera-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.records-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
}

.records-stats {
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.records-list {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.record-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.record-actions {
    display: flex;
    gap: 10px;
}

.backup-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

button {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

button:disabled:hover {
    transform: none;
    box-shadow: none;
}

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

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

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

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

.btn-small {
    padding: 8px 15px;
    font-size: 14px;
}

.pdf-section {
    margin-top: 30px;
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
}

.pdf-section button {
    background: var(--success-color);
    border-color: var(--success-color);
    font-size: 18px;
    padding: 15px 30px;
    margin: 0 auto;
}

.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
    margin-bottom: 20px;
}

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

.error-message {
    background: #e74c3c;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    text-align: center;
}

.success-message {
    background: #27ae60;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    text-align: center;
}

.gps-coordinates {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.gps-coordinates input {
    flex: 1;
}

.required::after {
    content: " *";
    color: var(--accent-color);
}

/* أنماط PDF الجديدة */
.pdf-template {
    position: fixed;
    top: -10000px;
    left: -10000px;
    width: 210mm;
    min-height: 297mm;
    background: white;
    color: black;
    padding: 20mm;
    font-family: 'Arial', sans-serif;
    direction: rtl;
    box-sizing: border-box;
    z-index: -1;
}

.pdf-header {
    text-align: center;
    margin-bottom: 15mm;
    border-bottom: 2px solid #1e3c72;
    padding-bottom: 5mm;
}

.pdf-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 5mm;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #c8102e;
    padding: 3px;
}

.pdf-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pdf-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 2mm;
    color: #1e3c72;
}

.pdf-subtitle {
    font-size: 16px;
    color: #666;
}

.pdf-content-section {
    margin-bottom: 8mm;
    padding: 4mm;
    border: 1px solid #ddd;
    border-radius: 3px;
    page-break-inside: avoid;
}

.pdf-section-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 4mm;
    color: #1e3c72;
    border-bottom: 1px solid #eee;
    padding-bottom: 2mm;
}

.pdf-data-row {
    display: flex;
    margin-bottom: 3mm;
    align-items: flex-start;
}

.pdf-label {
    font-weight: bold;
    width: 45mm;
    color: #333;
    font-size: 14px;
}

.pdf-value {
    flex: 1;
    color: #555;
    font-size: 14px;
    word-break: break-word;
}

.pdf-images-row {
    display: flex;
    justify-content: space-between;
    margin-top: 5mm;
    gap: 10mm;
}

.pdf-image-container {
    flex: 1;
    text-align: center;
}

.pdf-image-title {
    font-weight: bold;
    margin-bottom: 2mm;
    font-size: 14px;
    color: #333;
}

.pdf-image-frame {
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2mm;
    background: #f9f9f9;
    min-height: 50mm;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-image {
    max-width: 100%;
    max-height: 45mm;
    object-fit: contain;
}

.pdf-footer {
    margin-top: 10mm;
    text-align: center;
    font-size: 12px;
    color: #777;
    border-top: 1px solid #ddd;
    padding-top: 3mm;
}

.no-image-placeholder {
    color: #999;
    font-style: italic;
    font-size: 12px;
}

@media print {
    body * {
        visibility: hidden;
    }
    .pdf-template, .pdf-template * {
        visibility: visible;
    }
    .pdf-template {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
    }
}

/* تحسينات للاستجابة */
@media (max-width: 768px) {
    .site-banner {
        height: 150px;
    }
    
    nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    nav ul li {
        margin: 5px 0;
        width: 100%;
        text-align: center;
    }
    
    nav ul li a {
        justify-content: center;
    }
    
    .camera-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .camera-controls button {
        width: 100%;
    }
    
    .records-controls {
        flex-direction: column;
    }
    
    .records-controls button {
        width: 100%;
    }
    
    .backup-controls {
        flex-direction: column;
    }
    
    .backup-controls button {
        width: 100%;
    }
    
    .records-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .admin-panel {
        position: relative;
        top: auto;
        left: auto;
        margin-bottom: 20px;
        width: fit-content;
    }
    
    .pdf-images-row {
        flex-direction: column;
    }
    
    .record-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .record-actions {
        width: 100%;
        justify-content: space-between;
    }
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.english-numbers {
    font-family: Arial, sans-serif;
    direction: ltr;
    display: inline-block;
}

/* أنماط التحقق من الصحة */
.field-error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
}

input:invalid, select:invalid {
    border-color: #e74c3c;
}

input:valid, select:valid {
    border-color: #27ae60;
}

/* تحسينات الوصول */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* تحسينات الطباعة */
@media print {
    .admin-panel,
    .camera-controls,
    #generatePdfBtn {
        display: none !important;
    }
}

/* تحسينات إضافية للاستجابة */
@media (max-width: 480px) {
    .form-section {
        padding: 20px 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
}

/* أنماط الإشعارات */
.notification {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    background: white;
    color: #333;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 500px;
    margin: 0 auto;
}
.notification.show {
    transform: translateY(0);
    opacity: 1;
}
.notification-success {
    border-left: 4px solid #27ae60;
}
.notification-error {
    border-left: 4px solid #e74c3c;
}
.notification-warning {
    border-left: 4px solid #f39c12;
}
.notification-info {
    border-left: 4px solid #3498db;
}
.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}
.notification-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
}
@media (max-width: 768px) {
    .notification {
        left: 10px;
        right: 10px;
    }
}