/* shared/style.css */
body {
    background-color: #0d1117;
    color: #e6edf3;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

.demo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
}

.demo-header h1 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.back-link {
    color: #22d3ee;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.card {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}

.btn-primary, .btn-secondary {
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: #22d3ee;
    color: #0d1117;
}

.btn-primary:hover {
    background-color: #06b6d4;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid #30363d;
    color: #e6edf3;
}

.btn-secondary:hover {
    background-color: #30363d;
}

.tab-bar {
    display: flex;
    border-bottom: 1px solid #30363d;
    margin-bottom: 20px;
    gap: 20px;
}

.tab {
    padding: 10px 0;
    color: #8b949e;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-weight: 500;
}

.tab:hover {
    color: #e6edf3;
}

.tab-active {
    color: #22d3ee;
    border-bottom-color: #22d3ee;
}

.input-field, .textarea, .select-field {
    width: 100%;
    background-color: #0d1117;
    border: 1px solid #30363d;
    color: #e6edf3;
    padding: 10px 14px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 15px;
}

.textarea {
    resize: vertical;
}

.input-field:focus, .textarea:focus, .select-field:focus {
    outline: none;
    border-color: #22d3ee;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-cyan {
    background-color: rgba(34, 211, 238, 0.2);
    color: #22d3ee;
}

.badge-green {
    background-color: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge-orange {
    background-color: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge-red {
    background-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.score-bar {
    height: 12px;
    border-radius: 6px;
    background: #30363d;
    width: 100%;
    overflow: hidden;
    margin-top: 10px;
}

.score-bar-fill {
    height: 100%;
    transition: width 0.3s;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(34, 211, 238, 0.3);
    border-radius: 50%;
    border-top-color: #22d3ee;
    animation: spin 1s ease-in-out infinite;
    display: inline-block;
}

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

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: #ffffff;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { background-color: #10b981; }
.toast-error { background-color: #ef4444; }
.toast-warning { background-color: #f59e0b; }
.toast-info { background-color: #22d3ee; color: #0d1117;}

.stat-box {
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    flex: 1;
}

.stat-box-value {
    font-size: 20px;
    font-weight: 700;
    color: #e6edf3;
}

.stat-box-label {
    font-size: 12px;
    color: #8b949e;
    margin-top: 4px;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 900px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

/* Pac-Man Loading Animation */
.pacman-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 20px;
}

.pacman-loader .pacman {
    width: 0px;
    height: 0px;
    border-right: 30px solid transparent;
    border-top: 30px solid #22d3ee;
    border-left: 30px solid #22d3ee;
    border-bottom: 30px solid #22d3ee;
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    animation: pacman-mouth 0.4s infinite ease-in-out alternate;
    flex-shrink: 0;
}

.pacman-loader .dots {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.pacman-loader .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22d3ee;
    opacity: 0.6;
    animation: pacman-dot-fade 1.2s infinite;
}

.pacman-loader .dot:nth-child(2) { animation-delay: 0.2s; }
.pacman-loader .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pacman-mouth {
    0%   { border-right-color: transparent; }
    100% { border-right-color: #22d3ee; }
}

@keyframes pacman-dot-fade {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50%       { opacity: 1;   transform: scale(1); }
}
