/* Reset and Base Styles */
.ahms-search-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Noto Nastaliq Urdu', 'Amiri', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ahms-search-container * {
    box-sizing: border-box;
}

/* Header Section */
.ahms-header-section {
    background: white;
    padding: 40px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid #e9ecef;
}

.ahms-header-content {
    max-width: 1300px;
    margin: 0 auto;
    text-align: center;
    padding: 0 20px;
}

.ahms-header-content h1 {
    font-size: 36px;
    color: #2c7873;
    margin-bottom: 15px;
    font-family: 'Noto Nastaliq Urdu', serif;
    font-weight: 700;
}

.ahms-header-content p {
    font-size: 18px;
    color: #495057;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Noto Nastaliq Urdu', serif;
}

/* Search Form */
.ahms-search-form {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ahms-search-field {
    margin-bottom: 25px;
}

.ahms-search-field input {
    width: 100%;
    padding: 18px 25px;
    font-size: 18px;
    border: 2px solid #2c7873;
    border-radius: 8px;
    text-align: right;
    font-family: 'Noto Nastaliq Urdu', serif;
    background: white;
    transition: all 0.3s ease;
    line-height: 1.6;
}

.ahms-search-field input:focus {
    outline: none;
    border-color: #004445;
    box-shadow: 0 0 0 3px rgba(44, 120, 115, 0.2);
}

/* Filter Row */
.ahms-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.ahms-filter-group {
    display: flex;
    flex-direction: column;
}

.ahms-filter-group label {
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
    text-align: right;
    font-size: 16px;
}

.ahms-filter-group select,
.ahms-filter-group input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    text-align: right;
    font-family: 'Noto Nastaliq Urdu', serif;
    background: white;
    color: #333;
    transition: border-color 0.3s ease;
}

.ahms-filter-group select:focus,
.ahms-filter-group input[type="number"]:focus {
    outline: none;
    border-color: #2c7873;
}

.ahms-filter-group select:disabled,
.ahms-filter-group input:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Search Actions */
.ahms-search-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
}

.ahms-search-button,
.ahms-reset-button {
    padding: 14px 35px;
    border: 2px solid black;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Nastaliq Urdu', serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: white;
    color: black;
}

.ahms-search-button:hover,
.ahms-reset-button:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Loading Indicator */
.ahms-loading {
    text-align: center;
    padding: 50px 20px;
    background: white;
    border-radius: 10px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.loading-spinner {
    border: 4px solid rgba(44, 120, 115, 0.1);
    border-top: 4px solid #2c7873;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: ahms-spin 1s linear infinite;
    margin: 0 auto 25px;
}

@keyframes ahms-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ahms-loading p {
    color: #2c7873;
    font-size: 18px;
    margin: 0;
    font-weight: 500;
}

/* Results Container */
.ahms-results-container {
    margin-top: 30px;
}

.ahms-results-summary {
    background: linear-gradient(135deg, #e8f4f3 0%, #d4edea 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    text-align: center;
    font-size: 18px;
    color: #004445;
    border-right: 5px solid #2c7873;
    font-weight: 600;
}

/* Hadith Card */
.ahms-hadith-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ahms-hadith-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.ahms-hadith-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #2c7873, #004445);
}

/* Hadith Header */
.hadith-header {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f3f4;
    align-items: center;
}

.hadith-number {
    background: linear-gradient(135deg, #2c7873 0%, #004445 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 3px 10px rgba(44, 120, 115, 0.3);
}

.hadith-collection,
.hadith-book,
.hadith-chapter {
    background: #f8f9fa;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 15px;
    color: #495057;
    border: 1px solid #e9ecef;
}

/* Hadith Content */
.hadith-content {
    margin-bottom: 25px;
}

.arabic-text {
    font-size: 24px;
    line-height: 2;
    text-align: right;
    margin-bottom: 30px;
    color: #2c3e50;
    font-family: 'Amiri', serif;
    font-weight: 400;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.urdu-translation,
.english-translation {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-right: 4px solid;
    position: relative;
}

.urdu-translation {
    border-right-color: #28a745;
    font-size: 19px;
    line-height: 1.8;
    text-align: right;
    color: #343a40;
    font-family: 'Noto Nastaliq Urdu', serif;
}

.english-translation {
    border-right-color: #17a2b8;
    font-size: 17px;
    line-height: 1.7;
    text-align: left;
    color: #495057;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.urdu-translation strong,
.english-translation strong {
    color: #004445;
    font-weight: 600;
}

/* Hadith Meta */
.hadith-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    font-size: 15px;
    color: #6c757d;
}

.hadith-meta > div {
    background: #f8f9fa;
    padding: 10px 18px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    flex: 1;
    min-width: 200px;
}

.hadith-meta strong {
    color: #004445;
    margin-left: 8px;
    font-weight: 600;
}

/* Pagination */
.ahms-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    padding: 25px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.ahms-page-link,
.current-page {
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.ahms-page-link {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    cursor: pointer;
    font-family: 'Noto Nastaliq Urdu', serif;
}

.ahms-page-link:hover {
    background: #2c7873;
    color: white;
    border-color: #2c7873;
    transform: translateY(-2px);
}

.current-page {
    background: #004445;
    color: white;
    border: 1px solid #004445;
}

/* Error Messages */
.ahms-error,
.ahms-no-results {
    background: #f8d7da;
    color: #721c24;
    padding: 20px 25px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #f5c6cb;
    font-size: 18px;
    margin: 20px 0;
    line-height: 1.6;
}

.ahms-no-results {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Responsive Design */
@media (max-width: 1300px) {
    .ahms-search-container {
        max-width: 100%;
        padding: 15px;
    }
    
    .ahms-header-content {
        max-width: 100%;
    }
}

@media (max-width: 992px) {
    .ahms-filter-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .arabic-text {
        font-size: 22px;
        line-height: 1.9;
    }
    
    .urdu-translation {
        font-size: 18px;
    }
    
    .ahms-header-content h1 {
        font-size: 30px;
    }
    
    .ahms-header-content p {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .ahms-search-container {
        padding: 10px;
    }
    
    .ahms-search-form {
        padding: 20px;
    }
    
    .ahms-filter-row {
        grid-template-columns: 1fr;
    }
    
    .ahms-search-actions {
        flex-direction: column;
    }
    
    .ahms-search-button,
    .ahms-reset-button {
        width: 100%;
        padding: 16px;
    }
    
    .hadith-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .arabic-text {
        font-size: 20px;
        line-height: 1.8;
    }
    
    .urdu-translation {
        font-size: 17px;
    }
    
    .hadith-meta > div {
        min-width: 100%;
    }
    
    .ahms-pagination {
        padding: 15px;
    }
    
    .ahms-page-link,
    .current-page {
        padding: 8px 14px;
        font-size: 15px;
    }
    
    .ahms-header-content h1 {
        font-size: 26px;
    }
    
    .ahms-header-content p {
        font-size: 15px;
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .ahms-search-field input {
        padding: 15px 20px;
        font-size: 16px;
    }
    
    .arabic-text {
        font-size: 18px;
        line-height: 1.7;
    }
    
    .ahms-results-summary {
        font-size: 16px;
        padding: 15px;
    }
    
    .ahms-hadith-card {
        padding: 20px;
    }
    
    .ahms-header-content h1 {
        font-size: 22px;
    }
    
    .ahms-header-content p {
        font-size: 14px;
    }
}