/* Main stylesheet for "خدماتنا الإلكترونية" (Our Electronic Services) */

/* General Styles */
body {
    font-family: 'Cairo', sans-serif;
    background-color: #f9f9f9;
    color: #333;
    margin: 0;
    padding: 0;
    direction: rtl;
    text-align: right;
}

a {
    text-decoration: none;
    color: #007bff;
}

a:hover {
    color: #0056b3;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

.section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Header Styles */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    display: flex;
    align-items: center;
}

.navbar-brand img {
    height: 40px;
    margin-left: 10px;
}

.nav-link {
    color: #333;
    font-weight: 500;
    margin: 0 10px;
}

.nav-link:hover {
    color: #007bff;
}

.nav-link.active {
    color: #007bff;
    border-bottom: 2px solid #007bff;
}

/* Hero Section */
.hero {
    padding: 30px 20px;
    background-color: #007bff;
    color: #fff;
    text-align: center;
    border-radius: 5px;
    margin-bottom: 30px;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.btn-hero {
    padding: 10px 30px;
    background-color: #fff;
    color: #007bff;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.btn-hero:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

/* Card Numbers for Services */
.card-number {
    display: inline-block;
    background-color: rgba(43, 88, 118, 0.9);
    color: white;
    font-weight: bold;
    padding: 3px 8px;
    margin-left: 5px;
    border-radius: 8px;
    font-size: 0.8rem;
    vertical-align: middle;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Service Cards */
.service-card {
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: all 0.3s ease;
    border-right: 5px solid transparent;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Service Request - Red color */
.service-card.request {
    border-right-color: #dc3545;
}

/* Service Offer - Teal color */
.service-card.offer {
    border-right-color: #17a2b8;
}

.service-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.service-card .service-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.service-card .service-category {
    color: #666;
    font-size: 0.9rem;
}

.service-card .service-description {
    margin: 15px 0;
}

.service-card .service-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    color: #666;
    font-size: 0.9rem;
}

/* Service Status Colors */
.badge.status-available {
    background-color: #28a745;
    color: white;
}

.badge.status-negotiating {
    background-color: #ffc107;
    color: #333;
}

.badge.status-in-progress {
    background-color: #007bff;
    color: white;
}

.badge.status-completed {
    background-color: #6c757d;
    color: white;
}

.badge.status-closed {
    background-color: #343a40;
    color: white;
}

/* Service Type Badges */
.badge.type-request {
    background-color: #dc3545;
    color: white;
}

.badge.type-offer {
    background-color: #17a2b8;
    color: white;
}

/* Forms */
.form-control {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
}

.form-label {
    font-weight: 500;
    margin-bottom: 8px;
}

.form-floating {
    position: relative;
    margin-bottom: 20px;
}

.form-floating label {
    position: absolute;
    top: 0;
    right: 0;
    padding: 10px 15px;
    pointer-events: none;
    transition: all 0.3s ease;
    color: #666;
}

.form-floating .form-control:focus ~ label,
.form-floating .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.8) translateY(-20px) translateX(-10px);
    background-color: #fff;
    padding: 0 5px;
    color: #007bff;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    padding: 10px 20px;
    font-weight: 500;
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

/* Profile and Dashboard */
.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #6c757d;
    margin-left: 20px;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.profile-details {
    color: #666;
    margin-bottom: 10px;
}

.profile-bio {
    margin-top: 15px;
}

.rating-stars {
    color: #ffc107;
    font-size: 1.2rem;
}

/* Chat and Messages */
.chat-container {
    height: 500px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.chat-footer {
    padding: 15px;
    border-top: 1px solid #e9ecef;
}

.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.message.sent {
    align-items: flex-end;
}

.message.received {
    align-items: flex-start;
}

.message-content {
    background-color: #f0f0f0;
    padding: 10px 15px;
    border-radius: 20px;
    max-width: 70%;
}

.message.sent .message-content {
    background-color: #007bff;
    color: #fff;
    border-bottom-right-radius: 0;
}

.message.received .message-content {
    background-color: #e9ecef;
    border-bottom-left-radius: 0;
}

.message-time {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

.message-attachment {
    margin-top: 5px;
    display: flex;
    align-items: center;
}

.message-attachment a {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    font-size: 0.9rem;
}

.message-attachment .fa-file {
    margin-left: 5px;
}

/* Notifications */
.notification-item {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    background-color: #fff;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    border-right: 3px solid #007bff;
    background-color: #f0f7ff;
}

.notification-time {
    font-size: 0.8rem;
    color: #666;
}

/* Footer */
.footer {
    background-color: #343a40;
    color: #fff;
    margin-top: 50px;
    font-size: 0.9rem;
}

.footer h5 {
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.footer .text-muted {
    color: #adb5bd !important;
}

.footer a {
    color: #adb5bd;
    text-decoration: none;
}

.footer a:hover {
    color: #fff;
}

.footer .btn-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Admin Dashboard */
.admin-sidebar {
    background-color: #343a40;
    color: #fff;
    padding: 20px;
    height: 100%;
    border-radius: 5px;
}

.admin-sidebar .nav-link {
    color: #adb5bd;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 5px;
}

.admin-sidebar .nav-link:hover {
    background-color: #495057;
    color: #fff;
}

.admin-sidebar .nav-link.active {
    background-color: #007bff;
    color: #fff;
}

.admin-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat-card {
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #007bff;
    margin: 10px 0;
}

.stat-card .stat-title {
    color: #666;
    font-size: 1rem;
}

/* Responsive Classes */
@media (max-width: 768px) {
    .hero {
        padding: 30px 15px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .service-card {
        padding: 15px;
    }
    
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .profile-avatar {
        margin-bottom: 20px;
        margin-left: 0;
    }
}

/* ==================== Advertisement Cards ==================== */
.ad-card-item {
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e8edf2;
    min-height: 140px;
    max-height: 180px;
    transition: box-shadow 0.3s ease;
}

.ad-card-item:hover {
    box-shadow: 0 4px 18px rgba(43, 88, 118, 0.12);
}

.ad-card-image-wrap {
    width: 200px;
    min-width: 200px;
    background: linear-gradient(135deg, #f0f4f8, #e8edf2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-left: 1px solid #e8edf2;
}

.ad-card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-card-body {
    flex: 1;
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, #fafbfd 0%, #f5f7fa 100%);
}

.ad-card-body-full {
    background: linear-gradient(135deg, #f8fafe 0%, #f0f3f8 100%);
    border-right: 4px solid #2b5876;
}

.ad-card-label {
    display: inline-block;
    background: linear-gradient(135deg, #2b5876, #4e4376);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 6px;
    width: fit-content;
}

.ad-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2b3e50;
    margin-bottom: 6px;
    line-height: 1.4;
}

.ad-card-text {
    font-size: 0.85rem;
    color: #5a6b7d;
    line-height: 1.5;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ad-card-btn {
    display: inline-block;
    background: linear-gradient(135deg, #2b5876, #4e4376);
    color: #fff;
    padding: 5px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    width: fit-content;
    transition: all 0.3s ease;
}

.ad-card-btn:hover {
    background: linear-gradient(135deg, #1e4562, #3d3568);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(43, 88, 118, 0.3);
}

/* Carousel controls for ads */
.ad-carousel-arrow {
    width: 36px;
    height: 36px;
    background: rgba(43, 88, 118, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.ad-carousel-arrow:hover {
    background: rgba(43, 88, 118, 1);
}

#adsCarousel .carousel-control-prev,
#adsCarousel .carousel-control-next {
    width: 6%;
    opacity: 0.85;
}

#adsCarousel .carousel-control-prev:hover,
#adsCarousel .carousel-control-next:hover {
    opacity: 1;
}

.ad-carousel-dots {
    position: relative;
    bottom: auto;
    margin-top: 16px !important;
    margin-bottom: 0 !important;
}

.ad-carousel-dots button {
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    margin: 0 4px !important;
    background-color: #c5d0db !important;
    border: none !important;
    opacity: 1 !important;
    transition: all 0.3s ease;
}

.ad-carousel-dots button.active {
    background-color: #2b5876 !important;
    transform: scale(1.2);
}

#adsCarousel .carousel-item {
    transition: transform 0.5s ease-in-out;
}

@media (max-width: 768px) {
    .ad-card-item {
        flex-direction: column;
        min-height: auto;
        max-height: none;
    }
    .ad-card-image-wrap {
        width: 100%;
        min-width: 100%;
        height: 120px;
        border-left: none;
        border-bottom: 1px solid #e8edf2;
    }
    .ad-card-body {
        padding: 12px;
    }
    .ad-card-body-full {
        border-right: none;
        border-top: 4px solid #2b5876;
    }
}

/* Rating System */
.star-rating {
    direction: ltr;
    font-size: 1.5rem;
    display: inline-block;
}

.star-rating i {
    color: #e4e5e9;
    cursor: pointer;
}

.star-rating i.active {
    color: #ffc107;
}

.star-rating.readonly i {
    cursor: default;
}

.reviews-container {
    margin-top: 30px;
}

.review-item {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

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

.review-user {
    font-weight: bold;
}

.review-date {
    font-size: 0.8rem;
    color: #666;
}

.review-stars {
    color: #ffc107;
    margin-bottom: 10px;
}

/* Loading states */
.loading {
    position: relative;
}

.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border-radius: 50%;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    animation: spin 1s linear infinite;
    z-index: 101;
}

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

/* تنسيق الخدمات المميزة (المثبتة) - النسخة المحدثة */
/* النمط المستطيل للخدمات المثبتة */
.featured-service-card {
    position: relative;
    border: none;
    margin: 0 auto 15px;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    min-height: 240px; /* جعل البطاقة أطول */
    display: flex;
    flex-direction: column;
    max-width: 95%;
    background: linear-gradient(135deg, #e3eeff 0%, #f3e7ff 100%); /* تدرج لوني متوهج */
    box-shadow: 0 5px 15px rgba(78, 67, 118, 0.3);
    animation: color-shift 5s infinite alternate;
}

.featured-service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    background: #f8f9fa; /* لون فاتح للخلفية عند التمرير */
    border-color: #3949ab;
    animation: none; /* إيقاف التوهج عند التمرير */
}

@keyframes color-shift {
    0% {
        background: linear-gradient(135deg, #e3eeff 0%, #f3e7ff 100%);
        box-shadow: 0 5px 15px rgba(43, 88, 118, 0.3);
    }
    50% {
        background: linear-gradient(135deg, #e8f0fa 0%, #ede7f6 100%);
        box-shadow: 0 5px 15px rgba(78, 67, 118, 0.4);
    }
    100% {
        background: linear-gradient(135deg, #e1f5fe 0%, #ede7f6 100%);
        box-shadow: 0 5px 15px rgba(43, 88, 118, 0.5);
    }
}

@keyframes subtle-glow {
    0% {
        box-shadow: 0 4px 10px rgba(43, 88, 118, 0.2);
    }
    100% {
        box-shadow: 0 4px 20px rgba(43, 88, 118, 0.4);
    }
}

/* تنسيق رأس البطاقة */
.featured-service-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* تنسيق جسم البطاقة */
.featured-service-body {
    padding: 15px;
    flex-grow: 1;
}

.featured-service-body p {
    color: #111;
    font-weight: 500;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.6);
    padding: 8px;
    border-radius: 5px;
    margin-bottom: 0;
}

/* تنسيق قدم البطاقة */
.featured-service-footer {
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.02);
}

/* تنسيق معلومات المستخدم */
.user-info {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    color: #333;
    border-right: 2px solid #2b5876;
}

/* تمييز الألوان حسب نوع الخدمة */
.featured-request {
    border-left: 4px solid #17a2b8; /* حد أزرق */
}

.featured-offer {
    border-left: 4px solid #2b5876; /* حد أرجواني */
}

/* تغييرات لون الخلفية والنص عند التمرير */
.featured-request:hover {
    background: #fff;
    border-left: 4px solid #0288d1;
}

.featured-offer:hover {
    background: #fff;
    border-left: 4px solid #3949ab;
}

/* تعزيز وضوح النص عند التمرير */
.featured-service-card h5 {
    color: #333;
    font-weight: 600;
}

.featured-service-card .featured-service-body p {
    color: #444;
}

.featured-service-card:hover h5 {
    color: #222;
    font-weight: 700;
}

.featured-service-card:hover .featured-service-body p {
    color: #333;
    font-weight: 500;
}

/* شارة نوع الخدمة */
.featured-badge {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.featured-request .featured-badge {
    background-color: #17a2b8;
    color: white;
}

.featured-offer .featured-badge {
    background-color: #2b5876; 
    color: white;
}

/* تنسيق علامة تاريخ انتهاء التثبيت */
.expiry-badge {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.9);
    color: #555;
    border: 1px solid #ddd;
    border-radius: 30px;
    padding: 3px 10px;
    margin-top: 5px;
    font-size: 0.7rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.expiry-badge:hover {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

/* إضافة أيقونة التثبيت */
.featured-service-card::after {
    content: "\f005"; /* نجمة */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: 10px;
    left: 10px;
    color: #ffd700;
    font-size: 20px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    animation: star-pulse 1.5s infinite alternate;
}

@keyframes star-pulse {
    from {
        transform: scale(1);
        opacity: 0.8;
    }
    to {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* أزرار التنقل في المؤشر */
#featuredServicesCarousel .carousel-control-prev-icon,
#featuredServicesCarousel .carousel-control-next-icon {
    background-color: rgba(43, 88, 118, 0.7);
    border-radius: 50%;
    padding: 10px;
    background-size: 50%;
    width: 40px;
    height: 40px;
}

/* ==================== Featured Service Cards ==================== */
.featured-card-item {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e8edf2;
    transition: box-shadow 0.3s ease;
    min-height: 180px;
}

.featured-card-item:hover {
    box-shadow: 0 4px 18px rgba(43, 88, 118, 0.12);
}

.featured-card-request {
    border-right: 4px solid #17a2b8;
    background: linear-gradient(135deg, #f8fdff 0%, #f0f8fa 100%);
}

.featured-card-offer {
    border-right: 4px solid #2b5876;
    background: linear-gradient(135deg, #f8fafe 0%, #f0f3f8 100%);
}

.featured-card-body {
    padding: 24px 28px;
}

.featured-card-type-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    color: #fff;
}

.featured-card-type-badge.type-req {
    background: linear-gradient(135deg, #17a2b8, #0c7087);
}

.featured-card-type-badge.type-off {
    background: linear-gradient(135deg, #2b5876, #4e4376);
}

.featured-card-pin {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    background: #fef3cd;
    color: #856404;
}

.featured-card-expiry {
    display: inline-block;
    font-size: 0.72rem;
    padding: 4px 12px;
    border-radius: 20px;
    background: #f0f0f0;
    color: #666;
}

.featured-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2b3e50;
    margin-bottom: 10px;
    line-height: 1.5;
}

.featured-card-desc {
    font-size: 0.95rem;
    color: #5a6b7d;
    line-height: 1.7;
    margin-bottom: 16px;
}

.featured-card-user {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 500;
}

.featured-card-location {
    margin-right: 10px;
    color: #718096;
    font-weight: 400;
}

#featuredServicesCarousel .carousel-control-prev,
#featuredServicesCarousel .carousel-control-next {
    width: 6%;
    opacity: 0.85;
}

#featuredServicesCarousel .carousel-control-prev:hover,
#featuredServicesCarousel .carousel-control-next:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .featured-card-body {
        padding: 18px;
    }
    .featured-card-request {
        border-right: none;
        border-top: 4px solid #17a2b8;
    }
    .featured-card-offer {
        border-right: none;
        border-top: 4px solid #2b5876;
    }
}
