/* Custom Styles for Imam Ali Companions Website */

body {
    font-family: 'Tajawal', Arial, sans-serif;
    direction: rtl;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Smooth transitions */
.transition-all {
    transition: all 0.3s ease;
}

/* Custom button styles */
.btn-primary {
    @apply px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors;
}

.btn-secondary {
    @apply px-4 py-2 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors;
}

/* Card hover effects */
.companion-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.companion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Search input focus styles */
#search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Navigation button styles */
.nav-button {
    transition: all 0.2s ease;
}

.nav-button:hover {
    transform: scale(1.05);
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .page-break {
        page-break-before: always;
    }
    
    /* Hide navigation and interactive elements when printing */
    header nav,
    #search-input,
    .companion-card button,
    #share-btn,
    #prev-companion,
    #next-companion,
    #all-companions-btn {
        display: none !important;
    }
}

/* Responsive design improvements */
@media (max-width: 768px) {
    .max-w-6xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    header .flex {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    header nav {
        order: -1;
    }
    
    .companion-card {
        margin-bottom: 1rem;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Highlight search results */
.highlight {
    background-color: #fef3c7;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Custom styles for Arabic text */
.arabic-text {
    line-height: 1.8;
    text-align: justify;
}

/* Enhanced card styles */
.companion-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
}

.companion-card:hover {
    border-color: #6366f1;
}

/* Button group styles */
.button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .button-group {
        flex-direction: column;
    }
    
    .button-group button {
        width: 100%;
    }
}

/* Detail page specific styles */
#detail-page {
    animation: slideIn 0.3s ease-out;
}

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

/* Navigation arrows */
.nav-arrow {
    font-size: 1.2em;
    font-weight: bold;
}

/* Enhanced typography */
h1, h2, h3 {
    font-weight: 700;
}

.text-balance {
    text-wrap: balance;
}

/* Focus styles for accessibility */
button:focus,
input:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Custom spacing for RTL */
.space-x-reverse > * + * {
    margin-right: 1rem;
    margin-left: 0;
}
