/* ========================================
   Codetude Encoder/Decoder - Estilos
   ======================================== */

:root {
    --enc-primary: #0ea5e9;
    --enc-success: #10b981;
    --enc-light-bg: #ffffff;
    --enc-light-surface: #f8fafc;
    --enc-light-border: #e2e8f0;
    --enc-light-text: #1e293b;
    --enc-light-text-secondary: #64748b;
    --enc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dark-mode {
    --enc-light-bg: #1e293b;
    --enc-light-surface: #0f172a;
    --enc-light-border: #334155;
    --enc-light-text: #e2e8f0;
    --enc-light-text-secondary: #94a3b8;
    --enc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Container */
.codetude-encoder-decoder {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Seções */
.encoder-section {
    background: var(--enc-light-bg);
    border: 1px solid var(--enc-light-border);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--enc-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.encoder-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Headers */
.section-header {
    margin-bottom: 25px;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--enc-light-text);
    margin: 0 0 10px 0;
}

.section-header h2 .icon {
    width: 28px;
    height: 28px;
    color: var(--enc-primary);
    stroke-width: 2;
}

.section-description {
    color: var(--enc-light-text-secondary);
    margin: 0;
    font-size: 15px;
}

/* Tabs */
.encoder-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--enc-light-border);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--enc-light-surface);
    border: 2px solid var(--enc-light-border);
    border-radius: 10px;
    color: var(--enc-light-text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-icon {
    font-size: 20px;
}

.tab-btn:hover {
    border-color: var(--enc-primary);
    background: var(--enc-light-bg);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: var(--enc-primary);
    border-color: var(--enc-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* IO Section */
.io-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.input-section,
.output-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.full-width {
    grid-column: 1 / -1;
}

.input-section label,
.output-section label {
    font-size: 14px;
    font-weight: 600;
    color: var(--enc-light-text);
}

textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--enc-light-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    background: var(--enc-light-surface);
    color: var(--enc-light-text);
    resize: vertical;
    line-height: 1.6;
    transition: border-color 0.2s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--enc-primary);
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--enc-primary);
    color: white;
}

.btn-primary:hover {
    background: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
    background: var(--enc-light-surface);
    color: var(--enc-light-text);
    border: 2px solid var(--enc-light-border);
}

.btn-secondary:hover {
    background: var(--enc-light-border);
}

.btn-copy {
    background: var(--enc-success);
    color: white;
}

.btn-copy:hover {
    background: #059669;
}

.btn-large {
    padding: 14px 28px;
    font-size: 15px;
    width: 100%;
    margin-top: 10px;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

.button-group {
    display: flex;
    gap: 10px;
}

/* Hash Section */
.hash-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hash-results {
    display: grid;
    gap: 15px;
}

.hash-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hash-item label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--enc-light-text-secondary);
    letter-spacing: 0.5px;
}

.hash-output-group {
    display: flex;
    gap: 10px;
}

.hash-output-group input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--enc-light-border);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    background: var(--enc-light-surface);
    color: var(--enc-light-text);
}

/* JWT Section */
.jwt-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.jwt-results {
    display: grid;
    gap: 20px;
}

.jwt-part {
    padding: 15px;
    background: var(--enc-light-surface);
    border-left: 4px solid var(--enc-primary);
    border-radius: 8px;
}

.jwt-part h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--enc-light-text);
    margin: 0 0 10px 0;
}

.jwt-part pre {
    margin: 0;
    padding: 12px;
    background: var(--enc-light-bg);
    border: 1px solid var(--enc-light-border);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--enc-light-text);
    overflow-x: auto;
    line-height: 1.6;
}

/* Info Cards */
.info-content {
    display: grid;
    gap: 20px;
}

.info-card {
    padding: 20px;
    background: var(--enc-light-surface);
    border-left: 4px solid var(--enc-primary);
    border-radius: 8px;
}

.info-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--enc-light-text);
    margin: 0 0 12px 0;
}

.info-card p {
    color: var(--enc-light-text-secondary);
    line-height: 1.6;
    margin: 0 0 10px 0;
}

.info-card p:last-child {
    margin-bottom: 0;
}

.info-card strong {
    color: var(--enc-light-text);
    font-weight: 600;
}

/* Toast */
.encoder-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--enc-light-text);
    color: white;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--enc-shadow);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.encoder-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsivo */
@media (max-width: 968px) {
    .io-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .codetude-encoder-decoder {
        padding: 15px;
    }
    
    .encoder-section {
        padding: 20px;
    }
    
    .encoder-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
        justify-content: center;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}