/* ============================================================
   SRE Shortcodes Styling
   Custom shortcodes for technical blog content
   ============================================================ */

/* ============================================================
   CALLOUT BOXES
   ==================================================================== */

.sre-callout {
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid;
    position: relative;
}

.sre-callout strong {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 1.1em;
    font-weight: 700;
}

.sre-callout-content {
    line-height: 1.7;
}

.sre-callout-content p:last-child {
    margin-bottom: 0;
}

/* Callout types */
.sre-callout-note {
    border-color: #3182ce;
    background: #ebf8ff;
    color: #2c5282;
}

.sre-callout-note strong {
    color: #2c5282;
}

.sre-callout-warning {
    border-color: #ed8936;
    background: #fffaf0;
    color: #7c2d12;
}

.sre-callout-warning strong {
    color: #7c2d12;
}

.sre-callout-tip {
    border-color: #38a169;
    background: #f0fff4;
    color: #22543d;
}

.sre-callout-tip strong {
    color: #22543d;
}

.sre-callout-danger {
    border-color: #e53e3e;
    background: #fff5f5;
    color: #742a2a;
}

.sre-callout-danger strong {
    color: #742a2a;
}

.sre-callout-success {
    border-color: #48bb78;
    background: #f0fff4;
    color: #22543d;
}

.sre-callout-success strong {
    color: #22543d;
}

.sre-callout-production {
    border-color: #f56565;
    background: #fffaf0;
    color: #7c2d12;
}

.sre-callout-production strong {
    color: #c53030;
}

.sre-callout-security {
    border-color: #805ad5;
    background: #faf5ff;
    color: #44337a;
}

.sre-callout-security strong {
    color: #553c9a;
}

/* ============================================================
   METRICS DISPLAY
   ==================================================================== */

.sre-metrics {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.metric-before,
.metric-after {
    text-align: center;
    flex: 1;
}

.metric-label {
    display: block;
    font-size: 0.85em;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.metric-value {
    display: block;
    font-size: 2em;
    font-weight: 700;
    line-height: 1.2;
}

.metric-arrow {
    font-size: 2em;
    opacity: 0.8;
    flex-shrink: 0;
}

.metric-improvement {
    margin-left: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.2em;
    white-space: nowrap;
}

.metric-improvement.positive {
    background: #48bb78;
    color: white;
}

.metric-improvement.negative {
    background: #f56565;
    color: white;
}

@media (max-width: 768px) {
    .sre-metrics {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .metric-arrow {
        transform: rotate(90deg);
    }
    
    .metric-improvement {
        margin-left: 0;
        margin-top: 1rem;
    }
}

/* ============================================================
   CODE BLOCKS WITH HEADER
   ==================================================================== */

.sre-code-wrapper {
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.code-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: #2d3748;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.9em;
    border-bottom: 2px solid #4a5568;
}

.code-icon {
    font-size: 1.2em;
}

.code-title {
    font-weight: 600;
}

.sre-code-wrapper pre {
    margin: 0 !important;
    border-radius: 0 !important;
}

/* Prism line numbers integration */
.sre-code-wrapper pre.line-numbers {
    padding-left: 3.8em;
}

/* ============================================================
   ARCHITECTURE DIAGRAMS
   ==================================================================== */

.sre-architecture {
    margin: 2rem 0;
    padding: 2rem;
    background: #f7fafc;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    text-align: center;
}

.architecture-title {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2d3748;
}

.architecture-content {
    margin: 1.5rem 0;
    font-family: 'Courier New', monospace;
    white-space: pre;
    overflow-x: auto;
    text-align: left;
    background: white;
    padding: 1rem;
    border-radius: 4px;
}

.sre-architecture figcaption {
    margin-top: 1rem;
    font-style: italic;
    color: #718096;
    font-size: 0.95em;
}

/* ============================================================
   SLO CARDS
   ==================================================================== */

.sre-slo-card {
    display: inline-block;
    margin: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-top: 4px solid #cbd5e0;
    min-width: 250px;
    vertical-align: top;
}

.sre-slo-card.slo-meeting {
    border-top-color: #48bb78;
}

.sre-slo-card.slo-missing {
    border-top-color: #f56565;
}

.slo-name {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #2d3748;
}

.slo-target,
.slo-current {
    margin: 0.5rem 0;
    color: #4a5568;
}

.slo-target strong,
.slo-current strong {
    font-weight: 700;
    color: #2d3748;
}

.slo-window {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.85em;
    color: #718096;
}

@media (max-width: 768px) {
    .sre-slo-card {
        display: block;
        margin: 1rem 0;
        width: 100%;
    }
}

/* ============================================================
   TIMELINE
   ==================================================================== */

.sre-timeline {
    margin: 2rem 0;
    padding: 2rem;
    background: #f7fafc;
    border-radius: 8px;
}

.timeline-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 1.1rem;
    top: 3rem;
    bottom: -2rem;
    width: 2px;
    background: #cbd5e0;
}

.timeline-marker {
    font-size: 2em;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-content {
    flex: 1;
    padding-top: 0.25rem;
}

.timeline-time {
    font-size: 0.9em;
    color: #718096;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.timeline-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.timeline-description {
    color: #4a5568;
    line-height: 1.6;
}

/* Timeline types */
.timeline-event .timeline-marker {
    background: #ebf8ff;
    border-radius: 50%;
}

.timeline-action .timeline-marker {
    background: #fef5e7;
    border-radius: 50%;
}

.timeline-resolution .timeline-marker {
    background: #f0fff4;
    border-radius: 50%;
}

/* ============================================================
   TERMINAL
   ==================================================================== */

.sre-terminal {
    margin: 2rem 0;
    background: #1a202c;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

.terminal-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #2d3748;
    border-bottom: 1px solid #4a5568;
}

.terminal-dots {
    position: relative;
    width: 60px;
    height: 12px;
}

.terminal-dots::before,
.terminal-dots::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dots::before {
    left: 0;
    background: #f56565;
}

.terminal-dots::after {
    left: 20px;
    background: #ed8936;
    box-shadow: 20px 0 0 #48bb78;
}

.terminal-title {
    flex: 1;
    text-align: center;
    color: #a0aec0;
    font-size: 0.85em;
}

.terminal-body {
    padding: 1.5rem;
    color: #e2e8f0;
    font-size: 0.9em;
    line-height: 1.6;
}

.terminal-line {
    margin: 0.3rem 0;
}

.terminal-command {
    color: #68d391;
}

.terminal-prompt {
    color: #fc8181;
    font-weight: 700;
    margin-right: 0.5rem;
}

.terminal-output {
    color: #cbd5e0;
    padding-left: 0.5rem;
}

/* ============================================================
   RESOURCES
   ==================================================================== */

.sre-resources {
    margin: 3rem 0;
    padding: 2rem;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.sre-resources h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.resources-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.resource-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    text-decoration: none;
    color: #2d3748;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.resource-link:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    color: #667eea;
}

.resource-link::after {
    content: '→';
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-weight: 700;
}

.resource-link:hover::after {
    opacity: 1;
}

/* Resource icons */
.resource-doc::before {
    content: '📖';
    font-size: 1.5em;
}

.resource-github::before {
    content: '💻';
    font-size: 1.5em;
}

.resource-blog::before {
    content: '✍️';
    font-size: 1.5em;
}

.resource-video::before {
    content: '🎥';
    font-size: 1.5em;
}

.resource-tool::before {
    content: '🔧';
    font-size: 1.5em;
}

/* ============================================================
   Responsive adjustments for shortcodes
   ==================================================================== */

@media (max-width: 768px) {
    .sre-callout {
        padding: 1rem;
    }
    
    .sre-terminal {
        font-size: 0.85em;
    }
    
    .terminal-body {
        padding: 1rem;
    }
    
    .sre-resources {
        padding: 1rem;
    }
    
    .timeline-item {
        gap: 1rem;
    }
    
    .architecture-content {
        font-size: 0.8em;
    }
}
