/**
 * Match Card Styles
 * Maç kartları için ortak stiller
 *
 * @package AylakSpor
 */

/* Grid Match Card */
.as-match-card {
    position: relative;
    background: var(--as-card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--as-radius);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Flex layout for equal height */
    height: 100%;
    display: flex;
    flex-direction: column;
}

.as-match-card:hover {
    transform: translateY(-8px);
    border-color: var(--as-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px var(--as-primary);
}

.as-match-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: var(--as-text);
}

/* Thumbnail Section */
.as-match-thumb {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    background-color: #0f172a;
    flex-shrink: 0;
}

.as-match-thumb img,
.as-dynamic-match-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding-bottom: 0;
    /* Reset padding for dynamic image inside thumb wrapper */
}

/* Content Section */
.as-match-card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 16px;
}

/* Match Badge */
.as-match-card-badges {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 8px;
}

.as-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.as-badge-live {
    background: var(--as-live);
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

.as-badge-upcoming {
    background: rgba(255, 255, 255, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.as-badge-finished {
    background: rgba(255, 255, 255, 0.05);
    color: var(--as-text-muted);
}

/* League Info */
.as-match-card-league {
    font-size: 11px;
    font-weight: 600;
    color: var(--as-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: -8px;
}

/* Match Teams */
.as-match-card-teams {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: auto;
    /* Push footer down */
}

.as-team-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.as-team-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.as-team-logo-placeholder {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.as-team-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--as-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.as-team-score {
    font-size: 16px;
    font-weight: 700;
    color: var(--as-text);
    min-width: 20px;
    text-align: right;
}

/* Footer / Action Button */
.as-match-card-time {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center the button/text */
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--as-text-muted);
    width: 100%;
}

/* Dynamic Card Specific Overrides */
.as-card-dynamic .as-match-card-content {
    justify-content: space-between;
}

.as-card-dynamic .as-match-card-time {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 6px;
    border: none;
    color: #fff;
    transition: background 0.2s;
}

.as-card-dynamic:hover .as-match-card-time {
    background: var(--as-primary);
}

.as-card-dynamic .as-match-card-badges {
    margin-bottom: 0;
    justify-content: center;
    /* Center badge if it's the only thing */
}

/* Responsive */
@media (max-width: 768px) {
    .as-match-card-content {
        padding: 16px;
    }
}

/* Animations */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ==========================================================================
   Dynamic Match Image Styles
   ========================================================================== */
.as-dynamic-match-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

.as-dynamic-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 50%, rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: clamp(10px, 4%, 20px);
    color: #fff;
    text-align: center;
}

/* Keep internal dynamic image styles */
.as-dynamic-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.as-dynamic-league {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: clamp(9px, 1.5vw, 12px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a3e635;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
}

.as-dynamic-datetime {
    font-size: clamp(12px, 2vw, 16px);
    font-weight: 800;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

.as-dynamic-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 3vw, 30px);
    width: 100%;
    flex: 1;
}

.as-dynamic-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 1.5vw, 12px);
    width: 35%;
}

.as-dynamic-logo-wrapper {
    width: clamp(40px, 8vw, 70px);
    height: clamp(40px, 8vw, 70px);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 8px;
}

.as-dynamic-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.as-dynamic-logo-placeholder {
    font-size: clamp(20px, 4vw, 32px);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
}

.as-dynamic-team-name {
    font-size: clamp(10px, 1.8vw, 14px);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.as-dynamic-vs {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: clamp(16px, 3vw, 24px);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
}

.as-dynamic-footer {
    font-size: clamp(9px, 1.5vw, 11px);
    opacity: 0.7;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Dynamic Card Specific Styles */
.as-card-dynamic .as-match-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.8) 100%);
    padding: 20px;
    padding-top: 60px;
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass through overlay unless on interactive elements */
}

.as-card-dynamic .as-match-card-link {
    padding: 0;
    height: 100%;
}

.as-card-dynamic .as-match-card-time {
    justify-content: center;
    color: #fff;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    padding: 8px 16px;
    border-radius: 8px;
    width: fit-content;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: auto;
    /* Enable clicks on button */
}

/* Hide badge if dynamic since it might overlap or look weird */
.as-card-dynamic .as-match-badge {
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.as-card-dynamic.as-match-card:hover {
    transform: translateY(-5px);
}

/* Adjust aspect ratio for dynamic card wrapper to fit content perfectly */
.as-card-dynamic .as-match-thumb {
    height: 100%;
    border-radius: var(--as-radius);
    overflow: hidden;
}