/**
 * Jyotish Sewa - Astrologer Directory Styles
 * Mobile-first responsive design
 */

.sewa-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 16px;
}

.sewa-header {
    text-align: center;
    margin-bottom: 24px;
}

.sewa-title {
    font-size: 1.8rem;
    color: #2D1500;
    margin: 0 0 8px;
}

.sewa-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Search Bar */
.sewa-search-bar {
    margin-bottom: 24px;
}

.sewa-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.sewa-search-input:focus {
    border-color: #E8621A;
    box-shadow: 0 0 0 3px rgba(232, 98, 26, 0.15);
    outline: none;
}

/* Astrologer Grid */
.astrologer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Astrologer Card */
.astrologer-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.astrologer-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.astrologer-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}

.astrologer-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #E8621A 0%, #F5C842 100%);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 700;
}

.astrologer-photo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.astrologer-info {
    flex: 1;
    min-width: 0;
}

.astrologer-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2D1500;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.astrologer-specs {
    font-size: 0.82rem;
    color: #E8621A;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.astrologer-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
}

.astrologer-rating .stars {
    color: #f59e0b;
    letter-spacing: 1px;
}

.astrologer-rating .rating-text {
    color: #6b7280;
    font-size: 0.8rem;
}

.astrologer-card-body {
    padding: 0 16px 14px;
}

.astrologer-desc {
    font-size: 0.88rem;
    color: #7A5C3E;
    line-height: 1.5;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.astrologer-location {
    font-size: 0.82rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Loading State */
.sewa-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
    color: #9ca3af;
}

.sewa-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: #E8621A;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

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

/* Empty State */
.sewa-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.sewa-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.sewa-empty h3 {
    color: #7A5C3E;
    margin: 0 0 8px;
}

.sewa-empty p {
    margin: 0;
}

/* Load More */
.sewa-load-more {
    text-align: center;
    padding: 20px 0;
}

.sewa-load-btn {
    padding: 10px 28px;
    background: #f3f4f6;
    color: #3D2200;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.sewa-load-btn:hover {
    background: #e5e7eb;
}

/* ============================
   MODAL
   ============================ */
.sewa-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.sewa-modal-overlay.active {
    display: flex;
}

.sewa-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideUp 0.25s ease;
}

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

.sewa-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 28px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    z-index: 1;
}

.sewa-modal-close:hover {
    color: #3D2200;
    transform: none;
}

.sewa-modal-body {
    padding: 24px;
}

/* Modal Detail */
.modal-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.modal-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #E8621A 0%, #F5C842 100%);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 700;
}

.modal-photo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.modal-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2D1500;
    margin: 0 0 4px;
}

.modal-specs {
    font-size: 0.9rem;
    color: #E8621A;
    margin: 0 0 6px;
}

.modal-section {
    margin-bottom: 18px;
}

.modal-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px;
}

.modal-desc {
    font-size: 0.95rem;
    color: #3D2200;
    line-height: 1.6;
}

.modal-contact-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.9rem;
    color: #3D2200;
}

.modal-contact-row a {
    color: #E8621A;
    text-decoration: none;
}

.modal-contact-row a:hover {
    text-decoration: underline;
}

/* Comments Section */
.comments-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
    margin-top: 8px;
}

.comment-item {
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 600;
    font-size: 0.88rem;
    color: #3D2200;
}

.comment-date {
    font-size: 0.78rem;
    color: #9ca3af;
}

.comment-stars {
    color: #f59e0b;
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.comment-text {
    font-size: 0.88rem;
    color: #7A5C3E;
    line-height: 1.5;
}

/* Comment Form */
.comment-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.comment-form h4 {
    font-size: 0.95rem;
    color: #3D2200;
    margin: 0 0 12px;
}

.comment-form-group {
    margin-bottom: 10px;
}

.comment-form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 4px;
}

.comment-form-group input,
.comment-form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.comment-form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.comment-form-group input:focus,
.comment-form-group textarea:focus {
    border-color: #E8621A;
    outline: none;
}

.star-rating-input {
    display: flex;
    gap: 4px;
    font-size: 24px;
    cursor: pointer;
    user-select: none;
}

.star-rating-input .star {
    color: #d1d5db;
    transition: color 0.15s;
}

.star-rating-input .star.active {
    color: #f59e0b;
}

.star-rating-input .star:hover,
.star-rating-input .star:hover ~ .star {
    color: #f59e0b;
}

.comment-submit-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #E8621A 0%, #F5A030 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

.comment-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comment-result {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
}

.comment-result.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
}

.comment-result.error {
    display: block;
    background: #fef2f2;
    color: #dc2626;
}

/* ============================
   MOBILE RESPONSIVE
   ============================ */
@media (max-width: 600px) {
    .sewa-container {
        padding: 12px 10px;
    }

    .sewa-title {
        font-size: 1.4rem;
    }

    .sewa-subtitle {
        font-size: 0.85rem;
    }

    .astrologer-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .astrologer-card-header {
        padding: 14px;
        gap: 12px;
    }

    .astrologer-photo {
        width: 54px;
        height: 54px;
        font-size: 20px;
    }

    .sewa-modal {
        max-height: 85vh;
        border-radius: 14px 14px 0 0;
        align-self: flex-end;
    }

    .sewa-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-photo {
        width: 64px;
        height: 64px;
        font-size: 26px;
    }

    .modal-name {
        font-size: 1.15rem;
    }
}
