/**
 * Widgets Custom Styles
 * أنماط الـ Widgets المخصصة
 */

/* Widget: Matches Widget */
.matches-widget .matches-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.matches-widget .match-item {
    padding: 15px;
    background: #F8F9FA;
    border-radius: 8px;
    border-right: 3px solid var(--primary-green, #5CB85C);
    transition: all 0.3s ease;
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.matches-widget .match-item:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-decoration: none;
    transform: translateY(-2px);
}

.matches-widget .match-item:focus {
    outline: 2px solid var(--primary-green, #5CB85C);
    outline-offset: 2px;
}

.matches-widget .match-time {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.matches-widget .teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
}

.matches-widget .teams .team {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.matches-widget .teams .team-logo,
.widget .matches-widget .teams .team-logo,
.sidebar .matches-widget .teams .team-logo,
.matches-widget .match-item .teams .team .team-logo,
.widget .matches-widget .match-item .teams .team .team-logo,
.sidebar .matches-widget .match-item .teams .team .team-logo {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.matches-widget .teams .team span {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.matches-widget .match-score,
.matches-widget .match-time-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 0 10px;
}

.matches-widget .match-score .score {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-green, #5CB85C);
}

.matches-widget .match-time-center .time {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    background: #F0F0F0;
    padding: 4px 8px;
    border-radius: 4px;
}

.matches-widget .no-matches {
    text-align: center;
    color: #999;
    padding: 20px;
    font-size: 14px;
}

/* Widget: Leagues Widget */
.leagues-widget .leagues-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leagues-widget .league-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #F8F9FA;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
}

.leagues-widget .league-item:hover {
    background: var(--primary-green, #5CB85C);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(92, 184, 92, 0.2);
}

.leagues-widget .league-item img {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    border-radius: 50%;
    object-fit: contain !important;
    flex-shrink: 0;
    display: block !important;
}

.leagues-widget .league-item span:first-of-type {
    flex: 1;
    font-weight: 600;
}

.leagues-widget .league-item .badge {
    background: var(--primary-green, #5CB85C);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.leagues-widget .league-item:hover .badge {
    background: white;
    color: var(--primary-green, #5CB85C);
}

/* Widget: Popular Posts Widget */
.popular-posts-widget .popular-posts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popular-posts-widget .popular-post-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.popular-posts-widget .post-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--primary-green, #5CB85C), var(--primary-green-light, #6FD06F));
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.popular-posts-widget .post-thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
}

.popular-posts-widget .post-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

.popular-posts-widget .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.popular-posts-widget .post-thumbnail img:hover {
    transform: scale(1.1);
}

.popular-posts-widget .post-content {
    flex: 1;
    min-width: 0;
}

.popular-posts-widget .post-content h5 {
    margin: 0 0 5px 0;
    font-size: 14px;
    line-height: 1.4;
}

.popular-posts-widget .post-content h5 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.popular-posts-widget .post-content h5 a:hover {
    color: var(--primary-green, #5CB85C);
}

.popular-posts-widget .post-meta {
    font-size: 11px;
    color: #999;
}

.popular-posts-widget .post-meta i {
    margin-left: 3px;
}

/* Widget: Tags Widget */
.tags-widget .tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags-widget .tag-item {
    display: inline-block;
    padding: 6px 15px;
    background: #F8F9FA;
    border-radius: 20px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
}

.tags-widget .tag-item:hover {
    background: var(--primary-green, #5CB85C);
    color: white;
    transform: translateY(-2px);
}

/* Widget: Search Widget */
.search-widget .search-form {
    margin: 0;
}

.search-widget .input-group {
    display: flex;
    gap: 0;
    flex-direction: row-reverse;
}

.search-widget .form-control {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #DDD;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    outline: none;
}

.search-widget .form-control:focus {
    border-color: var(--primary-green, #5CB85C);
}

.search-widget .btn {
    padding: 10px 20px;
    background: var(--primary-green, #5CB85C);
    color: white;
    border: none;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-widget .btn:hover {
    background: var(--primary-green-dark, #4A9D4A);
}

/* Widget: Related Videos Widget */
.related-videos-widget .related-videos-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.related-videos-widget .related-video-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #F8F9FA;
    border-radius: 12px;
    border-right: 3px solid transparent;
    transition: all 0.3s ease;
}

.related-videos-widget .related-video-item:hover {
    background: var(--primary-green, #5CB85C);
    color: white;
    transform: translateX(-5px);
    border-color: var(--primary-green, #5CB85C);
    box-shadow: 0 4px 15px rgba(92, 184, 92, 0.3);
}

.related-videos-widget .related-video-thumb {
    position: relative;
    width: 130px;
    height: 85px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #E0E0E0;
}

.related-videos-widget .related-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-videos-widget .related-video-item:hover .related-video-thumb img {
    transform: scale(1.05);
}

.related-videos-widget .related-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.related-videos-widget .related-video-item:hover .related-video-overlay {
    opacity: 1;
}

.related-videos-widget .related-video-overlay i {
    font-size: 28px;
    color: white;
}

.related-videos-widget .related-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.related-videos-widget .related-video-info {
    flex: 1;
}

.related-videos-widget .related-video-info h4 {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.related-videos-widget .related-video-info h4 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-videos-widget .related-video-item:hover .related-video-info h4,
.related-videos-widget .related-video-item:hover .related-video-info h4 a {
    color: white;
}

.related-videos-widget .related-video-league {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #666;
}

.related-videos-widget .related-video-item:hover .related-video-league {
    color: white;
}

.related-videos-widget .related-video-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #999;
    flex-wrap: wrap;
}

.related-videos-widget .related-video-item:hover .related-video-meta {
    color: rgba(255, 255, 255, 0.9);
}

.related-videos-widget .related-video-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Widget: Upcoming Matches Widget */
.upcoming-matches-widget .upcoming-matches-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upcoming-matches-widget .upcoming-match-item {
    padding: 12px;
    background: #F8F9FA;
    border-radius: 8px;
    border-right: 3px solid var(--primary-green, #5CB85C);
    transition: all 0.3s ease;
}

.upcoming-matches-widget .upcoming-match-item:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.upcoming-matches-widget .match-info-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #E0E0E0;
}

.upcoming-matches-widget .date {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-green, #5CB85C);
}

.upcoming-matches-widget .league-name {
    font-size: 11px;
    color: #999;
}

.upcoming-matches-widget .match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.upcoming-matches-widget .team {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.upcoming-matches-widget .team-logo,
.widget .upcoming-matches-widget .team-logo,
.sidebar .upcoming-matches-widget .team-logo,
.upcoming-matches-widget .upcoming-match-item .team .team-logo,
.widget .upcoming-matches-widget .upcoming-match-item .team .team-logo,
.sidebar .upcoming-matches-widget .upcoming-match-item .team .team-logo {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.upcoming-matches-widget .team span {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.upcoming-matches-widget .match-score,
.upcoming-matches-widget .match-time-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 0 10px;
}

.upcoming-matches-widget .match-score .score {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-green, #5CB85C);
}

.upcoming-matches-widget .match-time-center .time {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    background: #F0F0F0;
    padding: 4px 8px;
    border-radius: 4px;
}

.upcoming-matches-widget .no-matches {
    text-align: center;
    color: #999;
    padding: 20px;
    font-size: 14px;
}

/* Widget: Calendar Widget */
.calendar-widget {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.calendar-widget h4 {
    color: var(--primary-green, #5CB85C);
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-widget h4 i {
    font-size: 18px;
}

.calendar-widget p {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.6;
}

.calendar-widget .form-control {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #E8E8E8;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    background: white;
    transition: all 0.3s ease;
    outline: none;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    direction: ltr;
}

.calendar-widget .form-control:hover {
    border-color: var(--primary-green, #5CB85C);
    box-shadow: 0 0 0 3px rgba(92, 184, 92, 0.08);
}

.calendar-widget .form-control:focus {
    border-color: var(--primary-green, #5CB85C);
    background: white;
    box-shadow: 0 0 0 4px rgba(92, 184, 92, 0.15);
}

/* تحسين شكل date picker icons */
.calendar-widget .form-control::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.calendar-widget .form-control::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Widget: Live Matches Widget - Extensions to base matches-widget */

/* حجم ثابت للويدجت في hero section */
.widget_sports_live_matches .matches-widget {
    min-height: 345px;
    display: flex;
    flex-direction: column;
}

.widget_sports_live_matches .matches-widget .matches-list {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* عنوان الويدجت */
.matches-widget h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

/* مؤشر البث المباشر في العنوان */
.matches-widget .live-indicator {
    color: #FF0000;
    font-size: 14px;
    animation: pulse-live 2s ease-in-out infinite;
    margin: 0;
    margin-left: 0;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    filter: drop-shadow(0 0 3px rgba(255, 0, 0, 0.5));
}

@keyframes pulse-live {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* شعار الدوري في المباراة المباشرة */
.matches-widget .match-league {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #F8F9FA;
    border-bottom: 1px solid #E8E9EA;
    font-size: 11px;
}

.matches-widget .league-logo-small {
    width: 18px !important;
    height: 18px !important;
    object-fit: contain !important;
    flex-shrink: 0;
}

.matches-widget .league-name {
    font-size: 11px;
    color: #6C757D;
    font-weight: 600;
}

/* الدقيقة الحالية للمباراة */
.matches-widget .match-score .live-minute {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #DC3545;
    margin-top: 2px;
}

/* حالة المباراة المباشرة */
.matches-widget .match-status-live {
    text-align: center;
    padding: 6px 0 0 0;
    margin-top: 8px;
    border-top: 1px solid #E8E9EA;
    font-size: 10px;
    font-weight: 600;
    color: #6C757D;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.matches-widget .live-dot {
    font-size: 6px;
    color: #DC3545;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.5;
    }
}

/* تأثير fade-in */
.widget_sports_matches.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* التحديث التلقائي */
.live-matches.auto-refresh .live-match-item {
    position: relative;
}

.live-matches.auto-refresh .live-match-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FF4444, transparent);
    animation: refresh-indicator 3s infinite;
}

@keyframes refresh-indicator {
    0%, 100% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
}

/* Responsive Design */
@media (max-width: 767px) {
    .popular-posts-widget .post-number {
        min-width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .popular-posts-widget .post-thumbnail {
        width: 50px;
        height: 50px;
    }

    .related-videos-widget .related-video-item {
        padding: 10px;
        gap: 10px;
    }

    .related-videos-widget .related-video-thumb {
        width: 100px;
        height: 70px;
    }

    .related-videos-widget .related-video-info h4 {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .related-videos-widget .related-video-meta {
        font-size: 11px;
        gap: 8px;
    }

    .related-videos-widget .related-video-overlay i {
        font-size: 24px;
    }

    .tags-widget .tag-item {
        padding: 5px 12px;
        font-size: 12px;
    }

    /* Live Matches Mobile */
    .live-matches {
        border-radius: 8px;
    }

    .live-matches h4 {
        font-size: 15px;
        padding: 12px 15px;
    }

    .live-matches-list {
        gap: 10px;
        padding: 12px;
    }

    .live-matches .live-match-item {
        padding: 14px 12px;
        border-radius: 6px;
    }

    .live-matches .teams {
        gap: 8px;
    }

    .live-matches .teams .team img {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        min-height: 26px !important;
        max-width: 26px !important;
        max-height: 26px !important;
    }

    .live-matches .teams .team span {
        font-size: 13px;
    }

    .live-matches .score,
    .live-matches .match-time-center .time {
        font-size: 14px;
    }

    .live-matches .score-section,
    .live-matches .match-time-center {
        min-width: 45px;
    }

    .live-matches .no-live-matches {
        padding: 35px 18px;
    }

    .live-matches .no-live-matches i {
        font-size: 40px;
        margin-bottom: 15px;
    }
}
