/* ============================================
   GPLorbit Playground - Styles
   ============================================ */

:root {
    --color-bg: #0a0a0f;
    --color-bg-elevated: #141420;
    --color-primary: #6366f1;
    --color-secondary: #22d3ee;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-text: #ffffff;
    --color-text-muted: #94a3b8;
    --gradient-primary: linear-gradient(135deg, #22d3ee 0%, #6366f1 100%);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 52px;
    background: var(--color-bg-elevated);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 100;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--color-text);
}

.logo img {
    width: 28px;
    height: 28px;
}

.logo-text {
    font-weight: 600;
    font-size: 15px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    background: rgba(99, 102, 241, 0.2);
    color: var(--color-primary);
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.plugin-name {
    font-size: 14px;
    color: var(--color-text-muted);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.timer-icon {
    width: 16px;
    height: 16px;
    color: var(--color-secondary);
}

.timer.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
}

.timer.warning .timer-icon {
    color: var(--color-warning);
}

.btn-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-close svg {
    width: 20px;
    height: 20px;
    color: var(--color-text-muted);
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-close:hover svg {
    color: var(--color-error);
}

/* Loading State */
.loading-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
}

.loading-content {
    text-align: center;
    max-width: 400px;
    padding: 32px;
}

.loading-animation {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 32px;
}

.orbit {
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    animation: orbit 2s linear infinite;
}

.orbit-1 {
    border-top-color: var(--color-secondary);
    animation-duration: 1.5s;
}

.orbit-2 {
    inset: 10px;
    border-right-color: var(--color-primary);
    animation-duration: 2s;
    animation-direction: reverse;
}

.orbit-3 {
    inset: 20px;
    border-bottom-color: var(--color-success);
    animation-duration: 2.5s;
}

.core {
    position: absolute;
    inset: 35px;
    background: var(--gradient-primary);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.8); opacity: 0.6; }
}

.loading-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.loading-subtitle {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.loading-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.3s ease;
}

.loading-hint {
    font-size: 12px;
    color: rgba(148, 163, 184, 0.6);
}

/* Error State */
.error-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
}

.error-content {
    text-align: center;
    max-width: 400px;
    padding: 32px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.error-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.error-message {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Success Banner */
.success-banner {
    position: fixed;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    color: var(--color-success);
    font-size: 14px;
    font-weight: 500;
    z-index: 99;
    animation: slideDown 0.3s ease, fadeOut 0.3s ease 3s forwards;
}

.success-banner svg {
    width: 18px;
    height: 18px;
}

@keyframes slideDown {
    from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

/* Playground Frame */
.playground-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: white;
    display: none;
}

.playground-frame.loaded {
    display: block;
}
