/* Cards (Glassmorphism) */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s, transform 0.1s;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary.loading .btn-text {
    opacity: 0.4;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--primary);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: rgba(139, 92, 246, 0.1);
    border-color: var(--primary);
}

.btn-new-chat {
    width: 100%;
    background: transparent;
    border: 1px dashed var(--border-color);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-new-chat:hover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-sec);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Inputs */
.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

textarea, .web-url-input, .project-input, .auth-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    transition: border-color 0.2s, background-color 0.2s;
    outline: none;
    box-sizing: border-box;
}

textarea:focus, .web-url-input:focus, .project-input:focus, .auth-input:focus {
    border-color: var(--primary);
    background: var(--input-bg-focus);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.number-input {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    width: 60px;
    outline: none;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    white-space: nowrap;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Error box */
.error-box {
    margin-top: 16px;
    padding: 16px;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 0.9rem;
}

/* Links y Utilidades de Auth (Globales) */
.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-sec);
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.auth-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Results & Test Cases */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.result-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-family: 'Outfit', sans-serif;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
}

.test-card {
    padding-bottom: 2rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); /* Línea divisora entre tests */
}

.test-card:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.tc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.tc-number {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.tc-title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
}

.tc-section {
    margin-bottom: 1.25rem;
}

.tc-section h4 {
    font-size: 0.85rem;
    color: var(--text-sec);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.tc-section p, .tc-section li {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
}

.tc-section ol {
    margin: 0;
    padding-left: 1.25rem;
}

.tc-actions {
    margin-top: 1.5rem;
}
