/* Estilos para el frontend de CIDToolPro */

/* Sticky Footer Layout - Simple and effective approach */
body {
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
}

main {
    flex: 1 !important;
}

/* Footer container styling */
.footer-container {
    margin-top: auto !important;
}

/* Contenedor de mensajes */
#tlpc-message-container {
    margin-bottom: 1rem;
}

.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.alert-success {
    color: #065f46;
    background-color: #d1fae5;
    border-color: #a7f3d0;
}

.alert-danger {
    color: #991b1b;
    background-color: #fee2e2;
    border-color: #fecaca;
}

.alert-info {
    color: #1e40af;
    background-color: #dbeafe;
    border-color: #bfdbfe;
}

.btn-close {
    float: right;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    opacity: 0.5;
    background: none;
    border: 0;
    padding: 0;
    margin-left: 0.5rem;
    cursor: pointer;
}

.btn-close:hover {
    opacity: 0.75;
}

/* Estado de loading */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.125em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Drag and drop */
#tlpc-drop-zone.dragover {
    background-color: #e5e7eb;
    border: 2px dashed #6b7280;
}

/* Campos de solo lectura */
input[readonly] {
    background-color: #f9fafb !important;
}

/* Responsive */
@media (max-width: 768px) {
    .alert {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
} 

/* Toast notifications */
#tlpc-toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}
.tlpc-toast {
    min-width: 260px;
    max-width: 350px;
    background: #fff;
    color: #222;
    border-radius: 0.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    padding: 1rem 1.5rem 1rem 1rem;
    display: flex;
    align-items: center;
    font-size: 1rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-30px);
    animation: tlpc-toast-in 0.4s forwards;
    pointer-events: auto;
    position: relative;
}
.tlpc-toast-success {
    border-left: 5px solid #10b981;
}
.tlpc-toast-error {
    border-left: 5px solid #ef4444;
}
.tlpc-toast .tlpc-toast-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}
.tlpc-toast .tlpc-toast-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    pointer-events: auto;
}
.tlpc-toast .tlpc-toast-close:hover {
    opacity: 1;
}
@keyframes tlpc-toast-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes tlpc-toast-out {
    to {
        opacity: 0;
        transform: translateY(-30px);
    }
} 

/* Code blocks styling - ALL <code> tags as blocks */
code {
    display: block !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    margin: 1.5rem 0 !important;
    padding: 1rem !important;
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #333 !important;
    position: relative !important;
    clear: both !important;
}

/* Legacy support for pre and other code containers */
.prose pre,
pre code,
pre,
.wp-block-code pre,
.wp-block-code {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: 6px !important;
    padding: 1rem !important;
    margin: 1.5rem 0 !important;
    position: relative !important;
    display: block !important;
    overflow-x: auto !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #333 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
}

/* Copy button styling */
.code-copy-btn {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    background-color: #007cba !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    opacity: 0.8 !important;
    transition: opacity 0.2s ease !important;
    z-index: 10 !important;
}

.code-copy-btn:hover {
    opacity: 1 !important;
    background-color: #005a87 !important;
}

.code-copy-btn.copied {
    background-color: #28a745 !important;
}

/* Ensure code blocks have proper spacing and line breaks */
.prose p + code,
.prose div + code,
.prose h1 + code,
.prose h2 + code,
.prose h3 + code,
.prose h4 + code,
.prose h5 + code,
.prose h6 + code,
p + code,
div + code,
h1 + code,
h2 + code,
h3 + code,
h4 + code,
h5 + code,
h6 + code {
    margin-top: 1.5rem !important;
}

.prose code + p,
.prose code + div,
.prose code + h1,
.prose code + h2,
.prose code + h3,
.prose code + h4,
.prose code + h5,
.prose code + h6,
code + p,
code + div,
code + h1,
code + h2,
code + h3,
code + h4,
code + h5,
code + h6 {
    margin-top: 1.5rem !important;
}

/* WordPress code block specific styling */
.wp-block-code {
    margin: 1.5rem 0 !important;
    padding: 0 !important;
}

.wp-block-code pre {
    margin: 0 !important;
    border-radius: 6px !important;
}

section.footer-container.max-w-7xl.mx-auto.px-4 {
    width: 100%;
}

/* Estilos para las pestañas del historial de tokens */
.tlpc-tabs {
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tlpc-tabs .nav-tab {
    display: inline-block;
    padding: 10px 15px;
    margin-right: 5px;
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-bottom: none;
    text-decoration: none;
    color: #333;
    border-radius: 4px 4px 0 0;
}

.tlpc-tabs .nav-tab:hover {
    background: #e1e1e1;
}

.tlpc-tabs .nav-tab.nav-tab-active {
    background: #fff;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
    color: #000;
}

/* Estilos para la tabla del historial de tokens */
.tlpc-tokens-log-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.tlpc-tokens-log-table th,
.tlpc-tokens-log-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.tlpc-tokens-log-table th {
    background-color: #f9f9f9;
    font-weight: bold;
}

.tlpc-tokens-log-table tr:hover {
    background-color: #f5f5f5;
}

.tlpc-tokens-log-table .tokens-change-positive {
    color: #28a745;
    font-weight: bold;
}

.tlpc-tokens-log-table .tokens-change-negative {
    color: #dc3545;
    font-weight: bold;
}

.tlpc-tokens-log-table .tokens-change-zero {
    color: #6c757d;
}

/* Filtro del historial */
.tlpc-log-filter {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.tlpc-log-filter label {
    display: inline-block;
    margin-right: 10px;
    font-weight: bold;
}

.tlpc-log-filter select {
    margin-right: 10px;
    padding: 5px;
}

.tlpc-log-filter .button {
    margin-left: 10px;
}

/* Header and Navigation Styles */
body {
    font-family: 'Segoe UI', sans-serif;
}

/* Estilos para el menú móvil */
#tlpc-offcanvas nav a:hover {
    color: #0063B1 !important;
}