/* ===== SERVICES SECTION STYLES ===== */
.aiow-services-container {
    direction: rtl;
    max-width: 1152px;
    margin: 0 auto;
    padding: 32px 16px;
}

:root {
    --brand-50: #eff6ff;
    --brand-100: #dbeafe;
    --brand-200: #bfdbfe;
    --brand-300: #93c5fd;
    --brand-400: #60a5fa;
    --brand-500: #3b82f6;
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;
    --brand-800: #1e40af;
}

/* Service List */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Service Card */
.service-card {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #f3f4f6;
}

.service-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.service-card.rank-1 {
    box-shadow: 0 0 0 2px #fcd34d, 0 4px 20px rgba(245, 158, 11, 0.15);
    border-color: #fcd34d;
}

.service-card.rank-2 {
    box-shadow: 0 0 0 2px #d1d5db, 0 2px 10px rgba(0, 0, 0, 0.05);
    border-color: #d1d5db;
}

.service-card.rank-3 {
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.4), 0 2px 10px rgba(0, 0, 0, 0.05);
    border-color: rgba(217, 119, 6, 0.4);
}

.service-card.is-sponsor {
    box-shadow: 0 0 0 2px #f59e0b, 0 4px 20px rgba(245, 158, 11, 0.2);
    background: linear-gradient(135deg, #fffbeb, #ffffff 30%);
    border-color: #f59e0b;
}

/* Rank Badge */
.rank-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 900;
    color: white;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid white;
}

.rank-badge.r1 {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.rank-badge.r2 {
    background: linear-gradient(135deg, #d1d5db, #9ca3af);
}

.rank-badge.r3 {
    background: linear-gradient(135deg, #d97706, #b45309);
}

/* Sponsor Tag */
.sponsor-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Card Inner */
.service-card-inner {
    padding: 20px;
}

/* Card Header */
.card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.card-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-600);
    overflow: hidden;
}

.card-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    flex: 1;
    min-width: 0;
}

.card-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.card-name {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.card-name-en {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}

.card-desc {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Rating Summary */
.rating-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.stars {
    display: flex;
    gap: 2px;
    direction: ltr;
}

.star {
    width: 16px;
    height: 16px;
    color: #d1d5db;
}

.star.filled {
    color: #fbbf24;
}

.rating-num {
    font-size: 14px;
    font-weight: 600;
    color: #d97706;
}

.rating-count {
    font-size: 12px;
    color: #9ca3af;
}

/* Features */
.features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.feature-tag {
    font-size: 11px;
    background: var(--brand-50);
    color: var(--brand-700);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--brand-100);
}

/* Actions Row */
.actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

/* Like/Dislike Buttons */
.like-dislike {
    display: flex;
    align-items: center;
    gap: 10px;
}

.like-btn, .dislike-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    background: #f3f4f6;
    color: #4b5563;
    cursor: pointer;
}

.like-btn:hover {
    background: #d1fae5;
    color: #047857;
}

.like-btn.active {
    background: #d1fae5;
    color: #047857;
    box-shadow: 0 0 0 1px #a7f3d0;
}

.dislike-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.dislike-btn.active {
    background: #fee2e2;
    color: #b91c1c;
    box-shadow: 0 0 0 1px #fecaca;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.visit-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    background: #10b981;
    color: white !important;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.2s;
    text-decoration: none;
}

.visit-btn:hover {
    background: #059669;
    text-decoration: none;
    color: white !important;
}

.toggle-comments-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    background: #f3f4f6;
    color: #4b5563;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.toggle-comments-btn:hover {
    background: #e5e7eb;
}

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

.comments-section.visible {
    display: block;
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.comments-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-comment-btn {
    font-size: 12px;
    background: var(--brand-500);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.add-comment-btn:hover {
    background: var(--brand-600);
}

/* Comment Form */
.comment-form {
    background: rgba(239, 246, 255, 0.7);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #dbeafe;
    display: none;
}

.comment-form.visible {
    display: block;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 4px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--brand-400);
    box-shadow: 0 0 0 3px var(--brand-100);
    outline: none;
}

.form-group textarea {
    resize: none;
    height: 72px;
}

/* Form Stars */
.form-stars {
    display: flex;
    gap: 4px;
    direction: ltr;
}

.form-star {
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: #d1d5db;
    transition: all 0.15s;
    font-size: 20px;
    line-height: 28px;
    text-align: center;
}

.form-star:hover,
.form-star.filled {
    color: #fbbf24;
    transform: scale(1.1);
}

/* Ensure unfilled stars in the comment form appear grey */
.comment-form .form-star {
    color: #d1d5db !important;
}
.comment-form .form-star.filled {
    color: #fbbf24 !important;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 8px;
}

.submit-btn, .cancel-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.submit-btn {
    background: var(--brand-500);
    color: white;
}

.submit-btn:hover {
    background: var(--brand-600);
}

.cancel-btn {
    background: #e5e7eb;
    color: #4b5563;
}

.cancel-btn:hover {
    background: #d1d5db;
}

/* Comments List */
.comments-list {
    max-height: 400px;
    overflow-y: auto;
    padding-left: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-item {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #f3f4f6;
}

.comment-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-author-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.comment-author {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #9ca3af;
}

.comment-date {
    font-size: 11px;
    color: #9ca3af;
}

.comment-text {
    font-size: 13px;
    color: #4b5563;
    margin-right: 36px;
    line-height: 1.5;
}

.no-comments {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    padding: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .aiow-services-container {
        padding: 16px;
    }

    .card-header {
        flex-direction: column;
    }

    .actions-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .comments-list {
        max-height: 300px;
    }
}
