/* إعدادات عامة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #223868;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    direction: rtl;
    position: relative;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* تأثيرات خلفية متحركة */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(40, 100, 235, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(40, 100, 235, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(40, 100, 235, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: backgroundMove 20s ease-in-out infinite;
}

@keyframes backgroundMove {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-20px, -20px) scale(1.1); }
}

.container {
    max-width: 600px;
    margin: 40px auto;
    position: relative;
    z-index: 1;
    background: rgba(66, 153, 225, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 25px;
    border: 1px solid rgba(40, 100, 235, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header */
header {
    background: transparent;
    color: white;
    padding: 30px 30px 20px;
    text-align: center;
    position: relative;
}

.school-logo-container {
    margin-bottom: 20px;
}

.school-link {
    display: inline-block;
    transition: transform 0.3s;
}

.school-link:hover {
    transform: scale(1.05);
}

.school-logo {
    max-height: 120px;
    max-width: 120px;
    height: 120px;
    width: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    padding: 10px;
    border: 3px solid rgba(40, 100, 235, 0.4);
    object-fit: contain;
    display: block;
    margin: 0 auto 20px;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

header p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 5px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

header .subtitle {
    font-size: 0.95rem;
    opacity: 0.85;
    font-weight: normal;
    margin-top: 8px;
}

.welcome-message {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border-right: 3px solid #2864eb;
}

.welcome-message .greeting {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.welcome-message .message-text {
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    text-align: justify;
}

.welcome-message .closing {
    font-size: 0.95rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 12px;
    text-align: left;
}

/* Form Styles */
main {
    padding: 20px 40px 40px;
    background: transparent;
}

.form-container {
    max-width: 100%;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.required {
    color: #2864eb;
    text-shadow: 0 0 5px rgba(40, 100, 235, 0.5);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2864eb;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 6px 20px rgba(40, 100, 235, 0.4), 0 0 15px rgba(40, 100, 235, 0.2);
    transform: translateY(-2px);
}

.form-group input[type="file"] {
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px dashed rgba(40, 100, 235, 0.4);
    border-radius: 12px;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.form-group input[type="file"]:hover {
    border-color: #2864eb;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 6px 20px rgba(40, 100, 235, 0.4), 0 0 15px rgba(40, 100, 235, 0.2);
    transform: translateY(-2px);
}

.file-info {
    display: block;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.error-message {
    display: block;
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 5px;
    min-height: 20px;
}

.image-preview {
    margin-top: 15px;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(40, 100, 235, 0.2);
    border: 3px solid rgba(40, 100, 235, 0.4);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.image-preview img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 30px rgba(40, 100, 235, 0.4);
    border-color: rgba(40, 100, 235, 0.7);
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: #2864eb;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(40, 100, 235, 0.4);
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.submit-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;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 100, 235, 0.6);
    background: #3d75f0;
}

.submit-btn:active {
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(40, 100, 235, 0.2);
}

.principal-info {
    text-align: center;
    margin-top: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border-top: 1px solid rgba(40, 100, 235, 0.3);
}

.principal-info p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin: 0;
}

.principal-info .principal-name {
    color: rgba(255, 255, 255, 1);
    font-weight: 600;
    font-size: 1rem;
}

/* Loader */
.loader {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Message */
.success-message {
    background: rgba(66, 153, 225, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(40, 100, 235, 0.6);
    color: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    margin-top: 20px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25), 0 0 20px rgba(40, 100, 235, 0.25);
}

.success-message h3 {
    margin-bottom: 10px;
}

.success-message a {
    color: #2864eb;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.success-message a:hover {
    color: #3d75f0;
    text-decoration: underline;
}

/* Navigation */
.navigation {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-link {
    color: #2864eb;
    text-decoration: none;
    font-weight: 600;
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(40, 100, 235, 0.5);
    border-radius: 12px;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 10px rgba(40, 100, 235, 0.1);
}

.nav-link:hover {
    background: #2864eb;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 100, 235, 0.5), 0 0 20px rgba(40, 100, 235, 0.3);
    border-color: #2864eb;
}

.nav-link-secondary {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
}

.nav-link-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Dashboard Styles */
.dashboard-controls {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.search-filter-section {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.filter-box select,
.sort-box select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

.results-count {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
}

.loading-indicator,
.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-indicator .loader {
    margin: 0 auto 20px;
    border-color: rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    width: 40px;
    height: 40px;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.results-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.results-table th {
    padding: 15px;
    text-align: right;
    font-weight: 600;
}

.results-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    text-align: right;
}

.results-table tbody tr:hover {
    background: #f8f9fa;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.view-image-btn {
    background: #2864eb;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.view-image-btn:hover {
    background: #3d75f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(40, 100, 235, 0.3);
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.delete-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #ccc;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 10px 15px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.pagination button:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button.active {
    background: #667eea;
    color: white;
}

/* Footer */
.site-footer {
    background: transparent;
    padding: 30px 20px;
    text-align: center;
    color: white;
}

.footer-content h3 {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.footer-contact {
    margin: 15px 0;
    line-height: 1.8;
}

.footer-contact p {
    margin: 8px 0;
    color: rgba(255, 255, 255, 0.9);
}

.footer-contact a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    transition: all 0.3s;
    padding: 2px 8px;
    border-radius: 6px;
}

.footer-contact a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

.footer-copyright {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    .school-logo {
        max-height: 60px;
        max-width: 150px;
    }

    main {
        padding: 20px;
    }

    .site-footer {
        padding: 20px 15px;
    }

    .footer-content h3 {
        font-size: 1.1rem;
    }

    .search-filter-section {
        grid-template-columns: 1fr;
    }

    .results-table {
        font-size: 0.9rem;
    }

    .results-table th,
    .results-table td {
        padding: 10px 8px;
    }

    .container {
        border-radius: 0;
    }

    body {
        padding: 0;
    }
}

@media (max-width: 480px) {
    .results-table {
        font-size: 0.8rem;
    }

    .view-image-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}
