/* MySSL.info Custom Styles */

/* Grade badges */
.grade-aplus { background-color: #10b981; color: white; }
.grade-a { background-color: #34d399; color: white; }
.grade-b { background-color: #fbbf24; color: black; }
.grade-c { background-color: #f97316; color: white; }
.grade-d { background-color: #ef4444; color: white; }
.grade-f { background-color: #dc2626; color: white; }
.grade-t { background-color: #6b7280; color: white; }

.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.375rem;
    font-weight: 700;
    font-size: 1rem;
}

/* Status indicators */
.status-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
}

.status-healthy { background-color: #10b981; }
.status-warning { background-color: #fbbf24; }
.status-critical { background-color: #ef4444; }
.status-unknown { background-color: #6b7280; }

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse-slow {
    animation: pulse 3s infinite;
}

/* Scan progress */
.scan-progress {
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.scan-progress-bar {
    height: 100%;
    background-color: #4f46e5;
    transition: width 0.3s ease;
}

/* Cards */
.card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.card-hover:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Cost Meter Styles */
.cost-meter-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cost-meter-svg {
    filter: drop-shadow(0 4px 6px rgba(99, 102, 241, 0.15));
}

.cost-meter-progress {
    stroke-dashoffset: 534;
}

.cost-meter-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.cost-meter-value {
    font-variant-numeric: tabular-nums;
}

.cost-meter-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    animation: cost-meter-pulse 2s ease-in-out infinite;
}

@keyframes cost-meter-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
}

/* Cost Breakdown Bars */
.cost-breakdown-bar {
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.cost-breakdown-fill {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.cost-breakdown-item {
    opacity: 0;
    animation: cost-breakdown-fade-in 0.5s ease forwards;
}

.cost-breakdown-item[data-delay="100"] { animation-delay: 0.1s; }
.cost-breakdown-item[data-delay="200"] { animation-delay: 0.2s; }
.cost-breakdown-item[data-delay="300"] { animation-delay: 0.3s; }
.cost-breakdown-item[data-delay="400"] { animation-delay: 0.4s; }

@keyframes cost-breakdown-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Period Progress Bar */
.period-progress-bar {
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.period-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Status Grid for Uptime Dashboard */
.status-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
}

.status-grid-item {
    position: relative;
    cursor: pointer;
}

.status-grid-dot-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background-color: #f3f4f6;
    transition: all 0.2s ease;
}

.status-grid-item:hover .status-grid-dot-wrapper {
    background-color: #e5e7eb;
    transform: scale(1.1);
}

.status-grid-dot {
    display: block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.status-grid-up {
    background-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.status-grid-down {
    background-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.status-grid-pulse {
    animation: status-grid-pulse-animation 2s ease-in-out infinite;
}

@keyframes status-grid-pulse-animation {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.4);
    }
}

/* Status Grid Tooltip */
.status-grid-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-0.5rem);
    background-color: #1f2937;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.status-grid-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.status-grid-item:hover .status-grid-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-0.75rem);
}

/* Toggle Switch Styles for Integrations */
.toggle-switch {
    position: relative;
    display: inline-block;
}

.toggle-bg {
    width: 2.5rem;
    height: 1.25rem;
    background-color: #e5e7eb;
    border-radius: 9999px;
    transition: background-color 0.2s ease-in-out;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.toggle-dot {
    position: absolute;
    left: 0.125rem;
    top: 0.125rem;
    width: 1rem;
    height: 1rem;
    background-color: white;
    border-radius: 9999px;
    transition: transform 0.2s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.alert-toggle:checked + .toggle-bg {
    background-color: rgb(79, 70, 229);
}

.alert-toggle:checked + .toggle-bg + .toggle-dot {
    transform: translateX(1.25rem);
}

/* Uptime Percentage Display */
.uptime-percentage {
    font-variant-numeric: tabular-nums;
    transition: color 0.3s ease;
}

.uptime-percentage-excellent {
    color: #22c55e;
}

.uptime-percentage-good {
    color: #eab308;
}

.uptime-percentage-poor {
    color: #ef4444;
}

/* Uptime Progress Ring Animation */
.uptime-ring {
    transition: stroke-dasharray 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Uptime Stats Card Animation */
.uptime-stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.uptime-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Incident Timeline Styles */
.incident-item {
    transition: background-color 0.2s ease;
}

.incident-item:hover {
    background-color: #f9fafb;
}

.incident-details {
    animation: incident-expand 0.3s ease-out;
}

@keyframes incident-expand {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.incident-chevron {
    transition: transform 0.2s ease-in-out;
}

.incident-chevron.rotate-180 {
    transform: rotate(180deg);
}

/* Ongoing Incident Pulse */
.incident-ongoing {
    animation: incident-pulse 2s ease-in-out infinite;
}

@keyframes incident-pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        opacity: 0.9;
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* Response Time Chart Gradient */
.response-time-good {
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0) 100%);
}

.response-time-warning {
    background: linear-gradient(180deg, rgba(234, 179, 8, 0.2) 0%, rgba(234, 179, 8, 0) 100%);
}

.response-time-critical {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0) 100%);
}

/* Toast Notifications */
#toast-container {
    z-index: 9999;
}

.toast-enter {
    animation: toast-slide-in 0.3s ease-out;
}

.toast-exit {
    animation: toast-slide-out 0.3s ease-in;
}

@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Integration Type Card Hover */
.integration-type-card {
    transition: all 0.2s ease;
}

.integration-type-card:hover {
    transform: translateY(-2px);
}

.integration-type-card.selected {
    border-color: #6366f1;
    background-color: #eef2ff;
}

/* Delivery Log Entry Animation */
.delivery-log-entry {
    animation: log-fade-in 0.3s ease forwards;
}

@keyframes log-fade-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cost Meter Smooth Animation Override */
.cost-meter-progress {
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Number Counter Animation */
.counter-animate {
    font-variant-numeric: tabular-nums;
}

/* General Utility Animations */
@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fade-in 0.3s ease forwards;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slide-up 0.3s ease forwards;
}

/* Smooth transitions for interactive elements */
.smooth-transition {
    transition: all 0.2s ease;
}

/* Loading spinner for async operations */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
