/* Custom CSS for Zarkani Website */

.nav-link {
    @apply text-gray-900 hover:text-green-600 font-medium transition-colors duration-200;
}

.nav-link:hover {
    @apply text-green-600;
}

/* Smooth animations */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

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

.slide-in {
    animation: slideIn 0.8s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #22c55e;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #16a34a;
}

/* RTL support improvements */
[dir="rtl"] .slide-in {
    animation: slideInRTL 0.8s ease-out;
}

@keyframes slideInRTL {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Button hover effects */
.btn-hover {
    transition: all 0.3s ease;
}

.btn-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.2);
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success message */
.success-message {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error message */
.error-message {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    animation: slideDown 0.3s ease-out;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
}


/* التجاوب الشامل مع جميع الأجهزة */

/* الشاشات الكبيرة جداً */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-content h1 {
        font-size: 3.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
    
    .achievements-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* الشاشات الكبيرة */
@media (max-width: 1200px) {
    .container {
        max-width: 1140px;
        padding: 0 2rem;
    }
    
    .hero-content h1 {
        font-size: 2.8rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

/* الأجهزة اللوحية الكبيرة */
@media (max-width: 992px) {
    .container {
        max-width: 960px;
        padding: 0 1.5rem;
    }
    
    .hero-content h1 {
        font-size: 2.4rem;
    }
    
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .section-content {
        padding: 3rem 0;
    }
    
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* الأجهزة اللوحية */
@media (max-width: 768px) {
    .container {
        max-width: 720px;
        padding: 0 1rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .section-content {
        padding: 2rem 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .header-top {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .header-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .language-switcher {
        justify-content: center;
    }
}

/* الهواتف الذكية */
@media (max-width: 576px) {
    .container {
        max-width: 540px;
        padding: 0 0.75rem;
    }
    
    .hero-content h1 {
        font-size: 1.6rem;
    }
    
    .hero-content p {
        font-size: 0.9rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    .achievement-card,
    .news-card {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .header-main {
        padding: 0.5rem 0;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .mobile-menu-btn {
        padding: 0.5rem;
    }
}

/* الهواتف الصغيرة */
@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .hero-content h1 {
        font-size: 1.4rem;
        line-height: 1.3;
    }
    
    .hero-content p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .section-title {
        font-size: 1.4rem;
        margin-bottom: 0.75rem;
    }
    
    .section-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }
    
    .achievement-card,
    .news-card {
        padding: 0.75rem;
    }
    
    .achievement-card h3,
    .news-card h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .achievement-card p,
    .news-card p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .mobile-menu {
        padding: 1rem;
    }
    
    .mobile-menu a {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

    .hero-content h1 {
        font-size: 1.4rem;
    }
    
    .hero-content p {
        font-size: 0.85rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

/* قائمة الهاتف المحمول */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    padding: 2rem;
}

.mobile-menu.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mobile-menu a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    margin: 1rem 0;
    transition: color 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.mobile-menu a:hover {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.mobile-menu-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* زر القائمة المحمولة */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #10b981;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.3s;
}

.mobile-menu-btn:hover {
    background: rgba(16, 185, 129, 0.1);
}

/* تحسينات للأجهزة اللوحية في الوضع الأفقي */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
    
    .achievements-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* تحسينات للهواتف في الوضع الأفقي */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-content {
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .section-content {
        padding: 1.5rem 0;
    }
}

/* تحسينات إضافية للتفاعل */
@media (hover: hover) {
    .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
    }
    
    .stat-card:hover {
        transform: translateY(-5px);
    }
    
    .achievement-card:hover,
    .news-card:hover {
        transform: translateY(-5px);
    }
}

/* للأجهزة التي لا تدعم hover */
@media (hover: none) {
    .btn:active {
        transform: scale(0.98);
    }
    
    .stat-card:active,
    .achievement-card:active,
    .news-card:active {
        transform: scale(0.98);
    }
}

/* تحسينات للطباعة */
@media print {
    .mobile-menu,
    .mobile-menu-btn,
    .header-top,
    .btn,
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        color: black;
    }
    
    .section-content {
        page-break-inside: avoid;
    }
}



/* Admin Panel Responsive Design */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 200px;
    }
    
    .admin-main {
        margin-right: 200px;
    }
    
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-table {
        font-size: 0.9rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.75rem;
    }
}

@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        order: 2;
    }
    
    .admin-main {
        margin-right: 0;
        order: 1;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .admin-stat-card {
        padding: 1rem;
    }
    
    .filters-section {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .admin-table {
        min-width: 600px;
        font-size: 0.85rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
        white-space: nowrap;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-sm {
        width: 100%;
        justify-content: center;
    }
    
    .requests-grid {
        grid-template-columns: 1fr;
    }
    
    .request-card {
        padding: 1rem;
    }
    
    .request-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .request-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .request-actions select,
    .request-actions .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .admin-container {
        padding: 0.5rem;
    }
    
    .admin-header h1 {
        font-size: 1.5rem;
    }
    
    .admin-stat-card {
        padding: 0.75rem;
    }
    
    .admin-stat-number {
        font-size: 1.5rem;
    }
    
    .admin-stat-label {
        font-size: 0.8rem;
    }
    
    .admin-table {
        font-size: 0.8rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.375rem;
    }
    
    .news-title {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    .category-badge,
    .status-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    .request-card {
        padding: 0.75rem;
    }
    
    .request-details p {
        font-size: 0.85rem;
        margin: 0.25rem 0;
    }
    
    .request-message {
        padding: 0.75rem;
    }
    
    .request-message h4 {
        font-size: 0.9rem;
    }
    
    .request-message p {
        font-size: 0.8rem;
    }
}

/* Form Responsive Design */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .news-form {
        padding: 1rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Navigation Responsive Improvements */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #374151;
        cursor: pointer;
        padding: 0.5rem;
    }
    
    .nav-menu {
        display: none;
    }
    
    .mobile-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }
    
    .mobile-menu.active {
        right: 0;
    }
    
    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .mobile-menu-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #374151;
        cursor: pointer;
    }
    
    .mobile-menu-nav {
        padding: 1rem 0;
    }
    
    .mobile-menu-nav a {
        display: block;
        padding: 1rem;
        color: #374151;
        text-decoration: none;
        border-bottom: 1px solid #f3f4f6;
        transition: background-color 0.2s;
    }
    
    .mobile-menu-nav a:hover {
        background-color: #f9fafb;
        color: #10b981;
    }
    
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* Large Screens Optimization */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .hero-content p {
        font-size: 1.2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
    
    .achievements-grid,
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .admin-stats {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .requests-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* Extra Large Screens */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-content h1 {
        font-size: 3.5rem;
    }
    
    .achievements-grid,
    .news-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .requests-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1f2937;
        --text-color: #f9fafb;
        --card-bg: #374151;
        --border-color: #4b5563;
    }
    
    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .card,
    .admin-table,
    .request-card {
        background-color: var(--card-bg);
        border-color: var(--border-color);
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .card,
    .admin-table,
    .request-card {
        border: 2px solid currentColor;
    }
}

/* Focus Improvements for Keyboard Navigation */
.btn:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* Print Styles Enhancement */
@media print {
    .admin-sidebar,
    .mobile-menu,
    .mobile-menu-btn,
    .action-buttons,
    .form-actions,
    .filters-section {
        display: none !important;
    }
    
    .admin-main {
        margin: 0 !important;
        width: 100% !important;
    }
    
    .admin-table {
        font-size: 10pt;
    }
    
    .request-card {
        break-inside: avoid;
        margin-bottom: 1rem;
        border: 1px solid #000;
    }
}
