/**
 * Conviction Meter Styles - New Design
 * TCT Conviction Meter with tier-based gradients
 * Styled to match Technical Analysis card
 */

/* Card Container - Full Width */
.tctm-conviction-meter-wrapper {
    width: 100%;
}

/* Card Base - Single Outer Card */
.tctm-conviction-card {
    background: #ffffff;
    border-radius: 8px;
    border: 2px solid #1E64B7;
    padding: 25px;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.tctm-conviction-card.titanium {
    background: linear-gradient(135deg, #fff 0%, rgb(0 181 127 / 10%) 40%, rgb(0 104 252 / 10%) 100%);
}

/* Tier Title */
.tctm-tier-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 18px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Header Row */
.tctm-meter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tctm-meter-label {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.tctm-meter-date {
    font-size: 14px;
    color: #495057;
    font-weight: 600;
}

/* Badge Row */
.tctm-badge-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.tctm-long-badge {
    background-color: #1e3a8a;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.tctm-long-badge.short {
    background-color: #EF4444;
}

.tctm-long-badge.neutral {
    background-color: #F59E0B;
}

.tctm-tier-icon {
    text-align: center;
}

.tctm-tier-icon img {
    width: 28px;
    height: 28px;
}

.tctm-investment-label {
    font-size: 13px;
    font-weight: 600;
    color: #6c757d;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

/* Gauge */
.tctm-gauge-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: -10px;
    position: relative;
}

.tctm-gauge-container {
    position: relative;
    width: 200px;
    height: 110px;
}

.tctm-gauge-svg {
    width: 200px;
    height: 110px;
}

.tctm-gauge-bg {
    fill: none;
    stroke: #e8ecf0;
    stroke-width: 18;
    stroke-linecap: round;
}

.tctm-gauge-fill {
    fill: none;
    stroke-width: 18;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.tctm-gauge-fill.silver {
    stroke: url(#silverGradient);
}

.tctm-gauge-fill.gold {
    stroke: url(#goldGradient);
}

.tctm-gauge-fill.titanium {
    stroke: url(#titaniumGradient);
}

/* Needle */
.tctm-needle-group {
    transform-origin: 90px 90px;
    transition: transform 1s ease;
}

.tctm-needle-circle {
    fill: #1a1a2e;
    stroke: #fff;
    stroke-width: 2;
}

.tctm-needle-line {
    fill: #1a1a2e;
}

/* Percentage */
.tctm-gauge-percentage {
    position: absolute;
    right: -35px;
    bottom: 8px;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
}

/* Conviction Label */
.tctm-conviction-label {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    margin-top: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Footer */
.tctm-card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e9ecef;
    font-size: 11px;
    color: #000;
    letter-spacing: 0.3px;
}

.tctm-phase-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.tctm-phase-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tctm-phase-icon.silver {
    background-color: #1e3a8a;
}

.tctm-phase-icon.gold {
    background-color: #1e3a8a;
}

.tctm-phase-icon.titanium {
    background-color: #1e3a8a;
}

.tctm-phase-text {
    font-weight: 600;
    color: #1e3a8a;
    font-size: 12px;
    text-transform: uppercase;
}

.tctm-tct-logo {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #333;
    font-size: 12px;
    font-weight: 600;
}

.tctm-tct-logo svg {
    width: 16px;
    height: 16px;
}

/* Refresh Button */
.tctm-refresh-btn {
    cursor: pointer;
    transition: all 0.2s ease;
}

.tctm-refresh-btn:hover {
    color: #1e3a8a;
}

.tctm-refresh-btn:hover svg {
    transform: rotate(180deg);
}

.tctm-refresh-btn:active {
    transform: scale(0.95);
}

.tctm-meter-content {
    position: relative;
}

/* FREE card specific */
.tctm-conviction-card.free .tctm-gauge-wrapper {
    filter: blur(6px);
    opacity: 0.5;
}

.tctm-conviction-card.free .tctm-conviction-label {
    filter: blur(4px);
    opacity: 0.5;
}

/* FREE tier — blur date, position type (SWING/INVESTMENT), and intended position */
.tctm-conviction-card.free .tctm-meter-date {
    filter: blur(5px);
    opacity: 0.4;
    user-select: none;
    pointer-events: none;
}

.tctm-conviction-card.free .tctm-investment-label {
    filter: blur(5px);
    opacity: 0.4;
    user-select: none;
    pointer-events: none;
}

.tctm-conviction-card.free .tctm-free-footer {
    filter: blur(5px);
    opacity: 0.4;
    user-select: none;
    pointer-events: none;
}

.tctm-upgrade-overlay {
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.tctm-upgrade-link {
    color: #1e3a8a;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
    display: block;
}

.tctm-upgrade-link:hover {
    text-decoration: underline;
}

.tctm-upgrade-text {
    font-size: 14px;
    font-weight: bold;
    margin-top: 4px;
    color: #1a1a2e;
}

.tctm-free-footer {
    font-size: 12px;
    color: #1e3a8a;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-align: center;
    margin-top: 12px;
    text-transform: uppercase;
}

/* SVG Gradients Container */
.tctm-svg-gradients {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Dynamic Mode - Loading and Error States */
.tctm-conviction-meter-dynamic {
    width: 100%;
}

.tctm-cm-loading .tctm-gauge-wrapper {
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tctm-cm-error .tctm-error-message {
    text-align: center;
    color: #EF4444;
    padding: 20px;
    font-size: 14px;
}

/* Spinner */
.tctm-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e8ecf0;
    border-top-color: #0068FC;
    border-radius: 50%;
    animation: tctm-spin 0.8s linear infinite;
}

@keyframes tctm-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .tctm-conviction-card {
        padding: 20px 16px 18px;
    }

    .tctm-tier-title {
        font-size: 20px;
    }

    .tctm-meter-label {
        font-size: 13px;
    }

    .tctm-meter-date {
        font-size: 13px;
    }

    .tctm-long-badge {
        font-size: 12px;
        padding: 4px 12px;
    }

    .tctm-investment-label {
        font-size: 12px;
    }

    .tctm-gauge-container {
        width: 180px;
        height: 100px;
    }

    .tctm-gauge-svg {
        width: 180px;
        height: 100px;
    }

    .tctm-gauge-percentage {
        right: -30px;
        font-size: 18px;
    }

    .tctm-conviction-label {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .tctm-conviction-card {
        padding: 16px 14px 16px;
        border-radius: 6px;
    }

    .tctm-tier-title {
        font-size: 18px;
        margin-bottom: 14px;
    }

    .tctm-meter-header {
        margin-bottom: 10px;
    }

    .tctm-meter-label {
        font-size: 12px;
    }

    .tctm-meter-date {
        font-size: 12px;
    }

    .tctm-long-badge {
        font-size: 11px;
        padding: 3px 10px;
    }

    .tctm-investment-label {
        font-size: 11px;
    }

    .tctm-gauge-container {
        width: 160px;
        height: 90px;
    }

    .tctm-gauge-svg {
        width: 160px;
        height: 90px;
    }

    .tctm-gauge-percentage {
        right: -25px;
        font-size: 16px;
    }

    .tctm-conviction-label {
        font-size: 14px;
        margin-top: 10px;
    }

    .tctm-card-footer {
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
    }

    .tctm-phase-icon {
        width: 20px;
        height: 20px;
    }

    .tctm-phase-text {
        font-size: 10px;
    }

    .tctm-tct-logo {
        font-size: 11px;
    }

    .tctm-tct-logo svg {
        width: 14px;
        height: 14px;
    }

    .tctm-upgrade-link {
        font-size: 14px;
    }

    .tctm-upgrade-text {
        font-size: 12px;
    }

    .tctm-free-footer {
        font-size: 10px;
    }
}

/* Gold gate CTA button */
.tctm-upgrade-btn-gold {
    display: inline-block;
    margin-top: 10px;
    padding: 9px 20px;
    background: #f5c518;
    color: #222 !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.3px;
}

.tctm-upgrade-btn-gold:hover {
    background: #e0b010;
    color: #222 !important;
}
