/* ==========================================================================
   Common styles shared across the Extrudo application
   ========================================================================== */

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

/* Base body styles (light theme) */
body {
    font-family: "IBM Plex Sans", "Space Grotesk", "Segoe UI", sans-serif;
    background-color: #f6f6f6;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
    min-height: 100vh;
    padding: 0 32px 32px;
    color: #0a0a0a;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

body.loaded {
    opacity: 1;
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid #e2e2e2;
    color: #8a8a8a;
    font-size: 13px;
}

/* Shared button base */
.btn {
    padding: 12px 20px;
    border: 1px solid #0a0a0a;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #0a0a0a;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #ffffff;
    color: #0a0a0a;
}

.btn-secondary:hover {
    background: #f0f0f0;
}

/* Loading spinner for buttons */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-primary.loading::after {
    border-top-color: #ffffff;
}

.btn-secondary.loading::after {
    border-top-color: #0a0a0a;
}

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

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    background: #f3f3f3;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0a0a0a;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0a0a0a;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.2s ease;
}

.back-link:hover {
    background: #f3f3f3;
    border-color: #0a0a0a;
}

/* Panel (card-like container) */
.panel {
    background: #ffffff;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

/* Status messages */
.status {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
    font-size: 14px;
}

.status.show {
    display: block;
}

.status.pending,
.status.success,
.status.error {
    background: #f3f3f3;
    border-left: 4px solid #0a0a0a;
    color: #2a2a2a;
}

.status-text {
    margin-bottom: 10px;
}

.status-id {
    font-family: monospace;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.1);
    padding: 5px 10px;
    border-radius: 4px;
    word-break: break-all;
}

/* Info box */
.info-box {
    background: #f3f3f3;
    border-left: 4px solid #0a0a0a;
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
    color: #2a2a2a;
    margin-top: 15px;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.12);
    border-top-color: #0a0a0a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* Progress bar */
.progress {
    margin-top: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #0a0a0a;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Mobile base responsive */
@media (max-width: 600px) {
    body {
        padding: 20px;
    }
}
