:root {
    --primary-color: #2563eb;
    --hover-color: #1d4ed8;
    --background: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --card-background: #ffffff;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --error-color: #ef4444;
}

[data-theme="dark"] {
    --primary-color: #3b82f6;
    --hover-color: #2563eb;
    --background: #0f172a;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --card-background: #1e293b;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --error-color: #ef4444;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

#container {
    background: var(--card-background);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    max-width: 600px;
    width: 90%;
    margin: 2rem;
    transition: transform 0.2s ease;
}

#container:hover {
    transform: translateY(-2px);
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
}

.description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

button:hover {
    background: var(--hover-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

button:active {
    transform: translateY(0);
}

button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

button:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(100, 100);
        opacity: 0;
    }
}

#linkContainer {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background: #f1f5f9;
    word-break: break-all;
    min-height: 100px;
}

#linkContainer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

#linkContainer a:hover {
    text-decoration: underline;
}

.loading-message {
    padding: 1rem;
    border-radius: 0.5rem;
    background: #f1f5f9;
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
}

.error-message {
    padding: 1rem;
    border-radius: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.error-message i {
    font-size: 1.5rem;
}

.pr-card {
    background: #f1f5f9;
    border-radius: 0.5rem;
    padding: 1.25rem;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.pr-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.pr-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.pr-repo {
    color: var(--primary-color);
    font-weight: 500;
}

.pr-number {
    color: var(--text-secondary);
}

.pr-title {
    margin: 0.5rem 0 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
    line-height: 1.4;
}

.pr-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.pr-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.pr-link:hover {
    background: rgba(37, 99, 235, 0.2);
    transform: translateY(-1px);
}

.fa-spin {
    animation: fa-spin 1s linear infinite;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

.heart {
    display: inline-block;
    transition: transform 0.2s ease;
}

footer:hover .heart {
    transform: scale(1.2);
}

@media (max-width: 640px) {
    #container {
        padding: 1.5rem;
        margin: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .description {
        font-size: 1rem;
    }

    button {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* Interactive Button Animation - Fixed */
.interactive-button {
    position: relative;
    overflow: hidden;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(0,0,0,0.1);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    margin: 0 auto;
    /* Remove conflicting background property */
    background: transparent;
}

.button-text {
    display: inline-block;
    transform: translateX(0);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.button-icon-container {
    position: absolute;
    top: 0;
    z-index: 2;
    display: flex;
    height: 100%;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: white;
    transform: translateX(3rem);
    opacity: 0;
    transition: all 0.3s ease;
}

.button-background {
    position: absolute;
    left: 20%;
    top: 40%;
    height: 8px;
    width: 8px;
    border-radius: 0.5rem;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    transform: scale(0); /* Hide the circle initially */
    opacity: 0; /* Make it fully transparent initially */
}

/* Hover states */
.interactive-button:hover .button-text {
    transform: translateX(3rem);
    opacity: 0;
}

.interactive-button:hover .button-icon-container {
    transform: translateX(0);
    opacity: 1;
}

.interactive-button:hover .button-background {
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    transform: scale(1.8);
    opacity: 1; /* Make it visible on hover */
    border-radius: 9999px;
}

/* Disabled state */
.interactive-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.interactive-button:disabled .button-background {
    background-color: var(--text-secondary);
}

.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(30deg);
    color: var(--primary-color);
}

/* SRE Metrics styling */
.metrics-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--card-background);
    border-radius: 0.5rem;
    border-top: 1px dashed var(--text-secondary);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.metrics-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.metrics-container h3 {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metrics-container h3::before {
    content: '📊';
    font-size: 1.2rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.metric-card {
    background: rgba(0,0,0,0.03);
    padding: 1rem;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease;
}

[data-theme="dark"] .metric-card {
    background: rgba(255,255,255,0.03);
}

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

.metric-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.metric-chart {
    height: 40px;
    width: 100%;
    margin-top: 0.5rem;
    background: linear-gradient(90deg, var(--primary-color) 70%, rgba(37, 99, 235, 0.3) 30%);
    border-radius: 4px;
    opacity: 0.7;
}

@media (max-width: 640px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* Terminal styling */
.terminal-container {
    margin: 1.5rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-family: 'Courier New', monospace;
    display: none; /* Hidden by default, shown after first PR request */
}

.terminal-header {
    background: #2d3748;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-title {
    color: #e2e8f0;
    font-size: 0.9rem;
}

.terminal-buttons {
    display: flex;
    gap: 0.5rem;
}

.terminal-button {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-button:nth-child(1) {
    background: #ef4444;
}

.terminal-button:nth-child(2) {
    background: #f59e0b;
}

.terminal-button:nth-child(3) {
    background: #10b981;
}

.terminal-body {
    background: #1a202c;
    color: #a0aec0;
    padding: 1rem;
    min-height: 60px;
}

.command-line {
    display: flex;
    align-items: center;
}

.prompt {
    color: #10b981;
    font-weight: bold;
    margin-right: 0.5rem;
}

.command {
    color: #e2e8f0;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: #e2e8f0;
    margin-left: 3px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* SRE Monitoring Easter Egg Styling */
.monitoring-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #e2e8f0;
    backdrop-filter: blur(3px);
}

.monitoring-overlay.visible {
    opacity: 1;
}

.monitoring-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.monitoring-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #3b82f6;
}

#closeMonitoring {
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 2rem;
    cursor: pointer;
}

.monitoring-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    overflow-y: auto;
}

.monitor-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.chart {
    height: 150px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.5) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-radius: 0.25rem;
    margin-top: 1rem;
}

.budget-display, .slo-status, .deploy-count {
    font-size: 2rem;
    font-weight: bold;
    margin-top: 1rem;
    text-align: center;
}

.slo-status {
    color: #10b981;
}

/* Add a glitch animation for SRE humor when errors happen */
@keyframes glitch {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0);
    }
}

.error-message {
    animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    animation-iteration-count: 3;
}

/* CLI Mode Easter Egg Styling */
.cli-terminal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 80%;
    max-width: 700px;
    height: 400px;
    background: #1a202c;
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

.cli-terminal.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.cli-header {
    background: #2d3748;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cli-title {
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
}

.cli-close {
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 1.5rem;
    cursor: pointer;
}

.cli-output {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    color: #a0aec0;
    font-size: 0.9rem;
}

.cli-welcome {
    color: #3b82f6;
    margin-bottom: 1rem;
}

.cli-command-line {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #2d3748;
    font-family: 'Courier New', monospace;
}

.cli-prompt {
    color: #10b981;
    margin-right: 0.5rem;
}

.cli-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    outline: none;
}

.cli-cursor {
    width: 8px;
    height: 16px;
    background: #e2e8f0;
    display: inline-block;
    animation: blink 1s step-end infinite;
}

.cli-command-display {
    margin-bottom: 0.5rem;
    color: #e2e8f0;
}

.cli-response {
    margin-bottom: 1rem;
    line-height: 1.5;
}

.cli-error {
    color: #ef4444;
}

.cli-command {
    color: #3b82f6;
    font-weight: bold;
}

.cli-secret {
    color: #f59e0b;
    font-style: italic;
}