/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f3f4f6;
    direction: rtl;
}

/* Animations */
@keyframes bounce {
    0%, 100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.animate-bounce {
    animation: bounce 1s infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Calendar specific styles */
.calendar-table {
    min-width: 100%;
}

.calendar-cell {
    min-width: 40px;
    min-height: 40px;
    transition: all 0.2s ease;
}

.calendar-cell:hover {
    transform: scale(1.05);
}

/* Login/Register Form Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Button Styles */
.btn {
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

/* Barrier Notification */
.barrier-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Calendar optimizations */
    .calendar-table {
        font-size: 11px;
    }

    .calendar-cell {
        min-width: 35px;
        min-height: 35px;
        padding: 4px 2px;
        font-size: 11px;
    }

    /* Touch-friendly buttons - minimum 44px tap target */
    .btn, button {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 14px;
    }

    /* Form inputs */
    input, select, textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 10px 12px;
    }

    /* Header adjustments */
    .header-title {
        font-size: 16px;
    }

    /* Reduce padding on mobile for more space */
    .p-8 {
        padding: 1.5rem !important;
    }

    .p-6 {
        padding: 1rem !important;
    }

    /* Stack tables horizontally scrollable */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }

    /* Larger modal/form containers */
    .max-w-md {
        max-width: 95% !important;
        margin: 1rem;
    }

    /* Better spacing for mobile forms */
    .space-y-4 > * + * {
        margin-top: 1.25rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .calendar-table {
        font-size: 10px;
    }

    .calendar-cell {
        min-width: 28px;
        min-height: 28px;
        padding: 2px 1px;
        font-size: 10px;
    }

    /* Even more compact spacing */
    .p-8 {
        padding: 1rem !important;
    }

    .p-6 {
        padding: 0.75rem !important;
    }

    /* Grid adjustments for very small screens */
    .grid-cols-2, .grid-cols-4 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }

    .md\:grid-cols-5 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
}

/* Tablet landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .calendar-cell {
        min-width: 45px;
        min-height: 45px;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Utility Classes */
.shadow-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.shadow-card:hover {
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12), 0 10px 10px rgba(0, 0, 0, 0.1);
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}