/**
 * TamRank™ Total Score Widget Styles
 *
 * Styling voor de gecombineerde score widget met Meta (30%) + Content (70%)
 *
 * @package TamRank
 * @since 6.3.0
 */

/* variables.css komt binnen via de tamrank-variables dependency (zie register_common_styles). */

/* ==========================================================================
   Total Score Widget Container
   ========================================================================== */

.tamrank-total-score-widget {
    background: linear-gradient(135deg, var(--tr-color-base) 0%, var(--tr-color-white) 100%);
    border-radius: var(--tr-radius-lg);
    padding: 20px;
    border: 1px solid var(--tr-color-slate-200);
    margin-bottom: 20px;
}

/* ==========================================================================
   Score Header - Badge + Info
   ========================================================================== */

.tamrank-score-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--tr-color-slate-200);
}

/* Score Badge - Cirkel met percentage */
.tamrank-score-badge {
    display: flex;
    align-items: baseline;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    color: var(--tr-color-white);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all var(--tr-transition-slow);
}

.tamrank-score-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.tamrank-score-percent {
    font-size: 14px;
    font-weight: 600;
    margin-left: 1px;
}

/* Score Info */
.tamrank-score-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tamrank-score-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--tr-color-slate-800);
    letter-spacing: -0.3px;
}

.tamrank-score-label {
    font-size: 14px;
    font-weight: 600;
    transition: color var(--tr-transition-base);
}

/* ==========================================================================
   Sub-scores Section
   ========================================================================== */

.tamrank-subscores {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Individual Sub-score */
.tamrank-subscore {
    background: var(--tr-color-white);
    border-radius: var(--tr-radius-md);
    padding: 12px 14px;
    border: 1px solid var(--tr-color-slate-200);
    transition: all var(--tr-transition-base);
}

.tamrank-subscore:hover {
    border-color: var(--tr-color-slate-300);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Sub-score Header */
.tamrank-subscore-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tamrank-subscore-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--tr-color-base);
    border-radius: var(--tr-radius-sm);
    color: var(--tr-color-slate-500);
    flex-shrink: 0;
}

.tamrank-subscore-icon svg {
    width: 16px;
    height: 16px;
}

.tamrank-subscore-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--tr-color-slate-800);
}

.tamrank-subscore-weight {
    font-size: 11px;
    color: var(--tr-color-slate-500);
    margin-left: -4px;
}

.tamrank-subscore-value {
    margin-left: auto;
    font-size: 14px;
    font-weight: 700;
    transition: color var(--tr-transition-base);
}

/* Progress Bar */
.tamrank-progress-bar {
    height: 6px;
    background: var(--tr-color-slate-200);
    border-radius: var(--tr-radius-sm);
    overflow: hidden;
    margin-top: 10px;
}

.tamrank-progress-fill {
    height: 100%;
    border-radius: var(--tr-radius-sm);
    transition: width 0.5s ease, background-color 0.3s ease;
}

/* ==========================================================================
   Schema Status (Geen score, alleen indicator)
   ========================================================================== */

.tamrank-schema-status {
    background: linear-gradient(135deg, var(--tr-color-warning-light) 0%, var(--tr-color-warning-light) 100%);
    border-color: var(--tr-color-warning-light);
}

.tamrank-schema-status[data-status="active"] {
    background: linear-gradient(135deg, var(--tr-color-success-light) 0%, var(--tr-color-success-light) 100%);
    border-color: var(--tr-color-success-light);
}

.tamrank-schema-status[data-status="auto"] {
    background: linear-gradient(135deg, var(--tr-color-info-light) 0%, var(--tr-color-info-light) 100%);
    border-color: var(--tr-color-info-light);
}

.tamrank-schema-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
}

.tamrank-schema-indicator svg {
    flex-shrink: 0;
}

/* ==========================================================================
   Details Toggle Button
   ========================================================================== */

.tamrank-score-details-toggle {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--tr-color-slate-200);
}

.tamrank-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--tr-color-slate-200);
    border-radius: var(--tr-radius-sm);
    color: var(--tr-color-slate-500);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--tr-transition-base);
}

.tamrank-toggle-btn:hover {
    background: var(--tr-color-base);
    border-color: var(--tr-color-slate-300);
    color: var(--tr-color-slate-800);
}

.tamrank-toggle-btn.active {
    background: var(--tr-color-base);
}

.tamrank-toggle-arrow {
    transition: transform 0.2s ease;
}

.tamrank-toggle-btn.active .tamrank-toggle-arrow {
    transform: rotate(180deg);
}

/* ==========================================================================
   Status Icons
   ========================================================================== */

.tamrank-icon-check,
.tamrank-icon-warning,
.tamrank-icon-error,
.tamrank-icon-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes tamrank-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.tamrank-score-badge.updating {
    animation: tamrank-pulse 0.3s ease;
}

@keyframes tamrank-progress-shine {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.tamrank-progress-fill.loading {
    background-image: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    background-size: 50% 100%;
    animation: tamrank-progress-shine 1.5s infinite;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 782px) {
    .tamrank-total-score-widget {
        padding: 16px;
    }

    .tamrank-score-header {
        gap: 12px;
    }

    .tamrank-score-badge {
        width: 60px;
        height: 60px;
    }

    .tamrank-score-value {
        font-size: 24px;
    }

    .tamrank-score-percent {
        font-size: 12px;
    }

    .tamrank-score-title {
        font-size: 14px;
    }

    .tamrank-subscore {
        padding: 10px 12px;
    }

    .tamrank-subscore-icon {
        width: 24px;
        height: 24px;
    }

    .tamrank-subscore-icon svg {
        width: 14px;
        height: 14px;
    }
}

/* ==========================================================================
   Floating Widget Variant (sidebar)
   ========================================================================== */

.tamrank-floating-widget .tamrank-total-score-widget {
    position: sticky;
    top: 32px;
}

/* ==========================================================================
   Dark Mode Support (future)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    /* WordPress admin doesn't support dark mode by default,
       but this is ready for future implementation */
}

/* ==========================================================================
   Score Color Classes
   ========================================================================== */

.tamrank-color-green {
    color: var(--tr-color-primary) !important;
}

.tamrank-color-blue {
    color: var(--tr-color-info) !important;
}

.tamrank-color-orange {
    color: var(--tr-color-warning) !important;
}

.tamrank-color-pink {
    color: var(--tr-color-error) !important;
}

.tamrank-bg-green {
    background-color: var(--tr-color-primary) !important;
}

.tamrank-bg-blue {
    background-color: var(--tr-color-info) !important;
}

.tamrank-bg-orange {
    background-color: var(--tr-color-warning) !important;
}

.tamrank-bg-pink {
    background-color: var(--tr-color-error) !important;
}

/* ==========================================================================
   Integration with existing meta box styles
   ========================================================================== */

/* Ensure widget fits within the SEO tab layout */
#tam-tab-seo .tamrank-total-score-widget {
    margin-bottom: 15px;
}

/* Override any conflicting styles from main meta box */
.tam-rank-meta-box .tamrank-total-score-widget {
    overflow: visible;
}

.tam-rank-meta-box .tamrank-total-score-widget * {
    box-sizing: border-box;
}
