/* Configurações Styles */

.settings-container {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.settings-card {
    background: var(--card);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.settings-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    padding: 1.5rem 2rem;
}

.card-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header h2 i {
    font-size: 1.2rem;
}

.card-header p {
    margin: 0;
    opacity: 0.95;
    font-size: 0.95rem;
}

.card-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: var(--primary);
    font-size: 1rem;
}

.form-group .hint {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 0.25rem;
    margin-left: 1.5rem;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="password"],
.form-group input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background: var(--bg);
    color: var(--text);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group input {
    flex: 1;
}

.btn-icon {
    width: 42px;
    height: 42px;
    border: 2px solid var(--border);
    background: var(--bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(129, 140, 248, 0.05);
}

/* Toggle Switch */
.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
}

.toggle input[type="checkbox"] {
    display: none;
}

.toggle .slider {
    position: relative;
    width: 52px;
    height: 28px;
    background: var(--border);
    border-radius: 14px;
    transition: background 0.3s;
}

.toggle .slider::before {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
}

.toggle input:checked + .slider {
    background: var(--primary);
}

.toggle input:checked + .slider::before {
    transform: translateX(24px);
}

.toggle .label {
    font-size: 0.95rem;
    color: var(--text);
}

/* Info Box */
.info-box {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    margin-top: 1rem;
}

.info-box i {
    color: #3b82f6;
    font-size: 1.2rem;
    margin-top: 0.1rem;
}

.info-box div {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text);
}

.info-box strong {
    display: block;
    margin-bottom: 0.25rem;
}

.info-box code {
    display: block;
    padding: 0.5rem;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    word-break: break-all;
}

/* Warning Box */
.warning-box {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 8px;
    margin-top: 1rem;
}

.warning-box i {
    color: #f59e0b;
    font-size: 1.2rem;
    margin-top: 0.1rem;
}

.warning-box div {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text);
}

.warning-box strong {
    display: block;
    margin-bottom: 0.25rem;
}

/* Credential Sections */
.credential-section {
    margin-bottom: 2rem;
}

.credential-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.credential-section h3 i {
    color: var(--primary);
    font-size: 1rem;
}

.credential-section .btn {
    margin-top: 0.5rem;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 2rem 0;
}

/* Status Message */
.status-message {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: none;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.status-message.show {
    display: flex;
}

.status-message.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #059669;
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

.status-message.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #2563eb;
}

/* Footer Actions */
.footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
    border-top: 2px solid var(--border);
    margin-top: 2rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Buttons */
.btn-secondary {
    background: var(--card);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(129, 140, 248, 0.05);
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Responsive */
@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
        min-width: auto;
    }
    
    output[for] {
        display: block;
        margin-left: 0;
        margin-top: 0.5rem;
        text-align: center;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .header-actions .btn {
        width: 100%;
    }
    
    .footer-actions {
        flex-direction: column;
    }
    
    .footer-actions .btn {
        width: 100%;
    }
}

/* Action Buttons Group */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.action-buttons .btn {
    flex: 1;
    min-width: 150px;
}

/* Range Input with Output */
input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary);
    cursor: pointer;
    border-radius: 50%;
    border: none;
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.2);
}

output[for] {
    display: inline-block;
    margin-left: 1rem;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Select Dropdown */
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

select:hover {
    border-color: var(--primary);
}

select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* System Info Text */
#node_version,
#system_uptime,
#memory_usage,
#disk_usage {
    font-weight: 600;
    color: var(--primary);
}

.btn-success {
    background: #16a34a;
    color: white;
    border: none;
}

.btn-success:hover {
    background: #15803d;
}

.btn-info {
    background: #0891b2;
    color: white;
    border: none;
}

.btn-info:hover {
    background: #0e7490;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border: none;
}

.btn-warning:hover {
    background: #d97706;
}

/* Telegram Status */
.telegram-status {
    margin-bottom: 1.5rem;
}

/* WhatsApp Status */
.whatsapp-status {
    margin-bottom: 1rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-badge i {
    font-size: 0.625rem;
}

.status-connected {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.status-disconnected {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.status-connecting {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.whatsapp-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Telegram Specific */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.telegram-commands {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
}

.telegram-commands h4 {
    margin: 0 0 1rem 0;
    color: #3b82f6;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.commands-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.commands-list li {
    padding: 0.625rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.commands-list li:last-child {
    border-bottom: none;
}

.commands-list code {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 120px;
    display: inline-block;
}

/* Responsividade Telegram */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .telegram-commands {
        padding: 1rem;
    }
    
    .commands-list code {
        min-width: 90px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .telegram-commands h4 {
        font-size: 0.875rem;
    }
    
    .commands-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.375rem;
    }
    
    .commands-list code {
        width: 100%;
    }
}

/* Modal QR Code */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.qrcode-modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    max-width: 600px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@media (max-width: 768px) {
    .qrcode-modal-content {
        width: 98%;
        margin: 10px;
        border-radius: 12px;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .modal-header {
        padding: 1rem;
        flex-wrap: wrap;
    }
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .modal-header h2 {
        font-size: 1.25rem;
        gap: 0.5rem;
    }
}

.modal-header h2 i {
    color: #25d366;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.modal-body {
    padding: 2rem;
}

@media (max-width: 768px) {
    .modal-body {
        padding: 1rem;
    }
}

.qrcode-instructions {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(37, 211, 102, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(37, 211, 102, 0.1);
}

@media (max-width: 768px) {
    .qrcode-instructions {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
}

.qrcode-instructions h3 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    color: #25d366;
}

@media (max-width: 768px) {
    .qrcode-instructions h3 {
        font-size: 1rem;
    }
}

.qrcode-instructions ol {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

@media (max-width: 768px) {
    .qrcode-instructions ol {
        padding-left: 1.25rem;
        font-size: 0.875rem;
        line-height: 1.6;
    }
}

.qrcode-instructions strong {
    color: var(--text);
}

.qrcode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    position: relative;
}

@media (max-width: 768px) {
    .qrcode-container {
        min-height: 280px;
        padding: 1rem;
    }
}

.qrcode-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #666;
}

.qrcode-loading i {
    font-size: 3rem;
    color: #25d366;
}

@media (max-width: 768px) {
    .qrcode-loading i {
        font-size: 2rem;
    }
}

.qrcode-loading p {
    margin: 0;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .qrcode-loading p {
        font-size: 0.875rem;
    }
}

#qrcode-canvas {
    max-width: 100%;
    height: auto;
    display: none;
}

#qrcode-canvas.show {
    display: block;
}

.qrcode-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #22c55e;
}

.qrcode-success i {
    font-size: 4rem;
}

.qrcode-success p {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.qrcode-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.qrcode-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.qrcode-hint i {
    color: #25d366;
}

/* Templates Modal */
.templates-modal-content {
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .templates-modal-content {
        width: 98%;
        max-height: 90vh;
        margin: 10px;
    }
}

.template-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: #60a5fa;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .template-info {
        flex-direction: column;
        font-size: 0.875rem;
        padding: 0.75rem;
    }
}

.template-info i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.template-info code {
    background: rgba(59, 130, 246, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #93c5fd;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .template-info code {
        font-size: 0.75rem;
        white-space: normal;
        word-break: break-all;
    }
}

.template-editor {
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .template-editor {
        margin-bottom: 1.5rem;
    }
}

.template-editor label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.template-editor label i {
    color: var(--primary);
}

.template-editor .hint {
    display: block;
    font-weight: 400;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    margin-left: 0;
    width: 100%;
}

@media (max-width: 768px) {
    .template-editor .hint {
        font-size: 0.8rem;
    }
}

.template-textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.2s;
    min-height: 150px;
}

@media (max-width: 768px) {
    .template-textarea {
        font-size: 0.75rem;
        padding: 0.75rem;
        min-height: 120px;
    }
}

.template-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.template-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .template-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .template-actions button {
        width: 100%;
        justify-content: center;
    }
}

