/* Component Generator Styles - Clean Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --gradient-bg: linear-gradient(135deg, #e8b4ff 0%, #ff9a9e 50%, #fad0c4 100%);
    --input-bg: rgba(45, 45, 45, 0.9);
    --input-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --icon-color: rgba(255, 255, 255, 0.6);
    --icon-hover: rgba(255, 255, 255, 0.9);
    --accent-color: #6366f1;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    overflow: hidden;
}

/*body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-bg);
    z-index: -1;
}*/

.navbar.component-generator-nav {
    position: fixed;
    top: 20px;
    left: 20px;
    width: calc(100% - 40px);
    border-radius: 10px;
    padding: 10px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 997;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.6) !important;
    /* Força a cor de fundo */
    backdrop-filter: blur(10px) !important;
    /* Força o efeito de blur */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.062)
}

/* Main Container */
.main-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    
    background-image: url("../assets/fundo-ia.png");
    background-size: cover;
    background-position: center;
}

/* Input Interface */
.input-interface {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    z-index: 10;
    width: 100%;
}

.input-wrapper {
    width: 100%;
    max-width: 800px;
}

.input-container {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 24px;
    padding: 0.75rem 1.5rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    gap: 1rem;
}

.input-container:focus-within {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.prompt-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
}

.prompt-input::placeholder {
    color: var(--text-secondary);
}

.send-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.send-btn:disabled:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: none;
}

.fa-spin {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Component Types Mini */
.component-types-mini {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.component-mini {
    cursor: pointer;
    position: relative;
    display: block;
}

.component-mini input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.component-mini span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: var(--icon-color);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    min-width: 60px;
}

.component-mini:hover span {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.component-mini input[type="radio"]:checked + span {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--text-primary);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
}


/* Preview Section - Janela Branca */
.preview-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.preview-popup {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 95%;
    height: 90%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: popupAppear 0.3s ease-out;
}

@keyframes popupAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    color: #333;
    flex-shrink: 0;
}

.preview-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.preview-actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    background: #4a5568;
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: #2d3748;
    transform: translateY(-1px);
}

.action-btn svg {
    flex-shrink: 0;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1001;
    font-size: 1rem;
}

.close-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.close-btn svg {
    flex-shrink: 0;
}

/* Layout lado a lado */
.preview-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.preview-container {
    background: #ffffff;
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e0e0;
}

.preview-iframe-container {
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: #f8f9fa;
    overflow: auto;
}

.component-iframe {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.code-section {
    background: #ffffff;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 400px;
}

.code-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.code-tab {
    background: transparent;
    border: none;
    color: #6c757d;
    padding: 1rem 2rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
}

.code-tab.active {
    color: #4a5568;
    border-bottom-color: #4a5568;
    background: #ffffff;
}

.code-tab:hover {
    color: #495057;
    background: #e9ecef;
}

.code-content {
    flex: 1;
    overflow-y: auto;
}

.code-block {
    display: none;
    margin: 0;
    padding: 2rem;
    background: #ffffff;
    color: #333;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    height: 100%;
    overflow-y: auto;
}

.code-block.active {
    display: block;
}


/* Responsive */
@media (max-width: 768px) {
    .navbar.component-generator-nav {
        position: fixed;
        top: 0px;
        left: 0px;
        width: 100%;
        border-radius: 0px;
        padding: 10px 40px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        z-index: 997;
        transition: all 0.3s ease;
        background-color: rgba(255, 255, 255, 0.6) !important;
        /* Força a cor de fundo */
        backdrop-filter: blur(10px) !important;
        /* Força o efeito de blur */
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.062)
    }

    .main-container {
        padding: 1rem;
        padding-top: 65px;
    }

    .input-wrapper {
        max-width: 100%;
    }

    .send-btn {
        width: 36px;
        height: 36px;
    }

    .component-types-mini {
        gap: 0.5rem;
    }

    .component-mini span {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-width: 50px;
    }

    .preview-section {
        padding: 0.5rem;
    }

    .preview-popup {
        width: 100%;
        height: 100%;
        border-radius: 8px;
    }

    .preview-content {
        flex-direction: column;
    }

    .preview-container {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        min-height: 300px;
    }

    .preview-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .preview-header h3 {
        font-size: 1rem;
        text-align: center;
    }

    .preview-actions {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .action-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        flex: 1;
        min-width: 120px;
    }

    .code-section {
        min-width: auto;
        flex: 1;
    }

    .code-tab {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .code-block {
        padding: 1rem;
        font-size: 0.8rem;
    }

    .close-btn {
        position: static;
        align-self: flex-end;
        margin-top: 1rem;
    }
}

/* Copy feedback */
.copied-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 1rem 2rem;
    border-radius: 12px;
    backdrop-filter: blur(20px);
    z-index: 1001;
    animation: fadeInOut 2s ease-in-out;
}

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