/* ==========================================================================
   PLUGIN: POSTAGENS REDE DDD BRASIL
   VERSION: 7.3.0
   THEME: COMPLETO (GLASSMORPHISM + PRINT VISUAL + MEDIA)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. IMPORTAÇÃO DE FONTES E RESET
   -------------------------------------------------------------------------- 
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Reset para garantir consistência dentro do wrapper */
.comentarios-gemini-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    padding: 0 15px;
    font-family: 'Inter', sans-serif;
    color: #1f2937;
    box-sizing: border-box;
}

.comentarios-gemini-wrapper *,
.comentarios-gemini-wrapper *::before,
.comentarios-gemini-wrapper *::after {
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   2. CONFIGURAÇÃO DO CORPO (BODY) - FORÇAR FUNDO
   -------------------------------------------------------------------------- 
   O !important garante que o tema do WordPress não deixe o fundo branco.
*/

body {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%) !important;
    min-height: 100vh;
    margin: 0;
    background-attachment: fixed;
}

/* --------------------------------------------------------------------------
   3. CONTAINER PRINCIPAL (CARD DO FORMULÁRIO)
   -------------------------------------------------------------------------- 
*/

#comentarios-gemini-form-container {
    background: #ffffff !important; /* Fundo branco sólido */
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08); /* Sombra suave */
    padding: 45px;
    border: 1px solid #e5e7eb;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

/* Título do Formulário */
.form-title {
    text-align: left;
    font-size: 1.5rem;
    font-weight: 800;
    color: #374151;
    margin-bottom: 35px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-title i {
    color: #6366f1; /* Roxo */
    background: #eef2ff;
    padding: 10px;
    border-radius: 12px;
    font-size: 1.2rem;
}

/* --------------------------------------------------------------------------
   4. GRID SYSTEM (COLUNAS RESPONSIVAS)
   -------------------------------------------------------------------------- 
*/

.comgem-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    width: 100%;
}

.comgem-col-full {
    width: 100%;
    flex: 0 0 100%;
}

.comgem-col {
    width: calc(50% - 12.5px);
    flex: 0 0 calc(50% - 12.5px);
}

/* --------------------------------------------------------------------------
   5. INPUTS, LABELS E TEXTAREAS
   -------------------------------------------------------------------------- 
*/

label {
    font-weight: 700;
    color: #374151;
    margin-bottom: 8px;
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.5;
}

.required {
    color: #ef4444;
    font-weight: bold;
    margin-left: 4px;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #1f2937;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

input:focus,
textarea:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background: #ffffff;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* --------------------------------------------------------------------------
   6. FOTO DE PERFIL (UPLOAD REDONDO)
   -------------------------------------------------------------------------- 
*/

.profile-upload-wrapper {
    position: relative;
    width: 90px;
    height: 90px;
    flex-shrink: 0;
}

.profile-upload-label {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.profile-upload-label:hover {
    transform: scale(1.05);
    border-color: #6366f1;
}

#profile-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.profile-upload-label:hover .profile-overlay {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   7. DRAG & DROP (ESTILO DO PRINT: BOTÕES ROSA/ROXO)
   -------------------------------------------------------------------------- 
*/

.comgem-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 20px;
    padding: 50px 20px;
    background: #ffffff;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.comgem-dropzone:hover {
    background: #f9fafb;
    border-color: #a5b4fc;
}

.comgem-dropzone.dragover {
    border-color: #6366f1;
    background: #eff6ff;
    transform: scale(1.01);
}

/* Ícone de Nuvem e Texto */
.dz-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.dz-message i {
    font-size: 3.5rem;
    color: #6366f1;
    background: #e0e7ff;
    padding: 15px;
    border-radius: 16px;
    margin-bottom: 5px;
}

.dz-message span {
    font-size: 1.3rem;
    color: #4b5563;
    font-weight: 500;
}

/* Botões da Área de Upload */
.dz-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

/* Botão Selecionar (Borda Rosa - Igual ao Print) */
.btn-select {
    background: #ffffff;
    border: 1px solid #db2777; /* Rosa */
    color: #db2777;
    padding: 10px 25px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-select:hover {
    background: #fdf2f8;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Botão Colar (Roxo Sólido - Igual ao Print) */
.btn-paste {
    background: #6366f1; /* Roxo */
    border: 1px solid #6366f1;
    color: #ffffff;
    padding: 10px 25px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-paste:hover {
    background: #4f46e5;
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

/* Previews de Imagem */
.preview-area {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

.preview-area img {
    height: 90px;
    border-radius: 8px;
    border: 2px solid #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    object-fit: cover;
    transition: transform 0.2s;
}

.preview-area img:hover {
    transform: scale(1.1);
    z-index: 2;
}

/* ==========================================================================
   8. VÍDEO (LINK E ARQUIVO)
   ========================================================================== */

/* Input de Link com Ícone */
.video-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    transition: all 0.3s;
}

.video-input-wrapper:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.video-icon {
    position: absolute;
    left: 15px;
    color: #ef4444; /* Vermelho YouTube */
    font-size: 1.2rem;
    z-index: 2;
}

.video-url-input {
    border: none !important;
    background: transparent !important;
    padding-left: 45px !important;
    box-shadow: none !important;
}

/* Upload de Arquivo de Vídeo */
.video-upload-box {
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: 0.3s;
    cursor: pointer;
}

.video-upload-box:hover {
    border-color: #6366f1;
    background: #eef2ff;
}

.file-input { display: none; }

.file-label-block {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    color: #4b5563;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
}

.file-label-block i {
    font-size: 1.5rem;
    color: #6366f1;
}

.video-preview-box {
    margin-top: 15px;
    width: 100%;
}

.video-preview-box video {
    width: 100%;
    border-radius: 8px;
    background: #000;
    max-height: 250px;
}

/* ==========================================================================
   9. GRAVADORES (MEDIA BOXES - CARTÕES CINZA)
   ========================================================================== */

.media-box {
    background: #f3f4f6;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 350px;
    border: 1px solid #e5e7eb;
    transition: transform 0.3s;
}

.media-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.media-box h3 {
    margin-top: 0;
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.media-content-area {
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#waveform {
    width: 100%;
    height: 70px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.timer {
    font-size: 1.8rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 20px;
    font-family: monospace;
}

.comgem-video-preview-wrapper {
    width: 100%;
    max-width: 220px;
    aspect-ratio: 9 / 16;
    background: #0f172a;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.comgem-video-preview-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Botões de Controle Redondos */
.media-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: auto;
}

.media-controls button {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.media-controls button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.record-btn { background: #1f2937; } /* Preto/Cinza */
.stop-btn   { background: #ef4444; } /* Vermelho */
.play-btn   { background: #1f2937; }
.delete-btn { background: #6b7280; width: 45px; height: 45px; font-size: 1rem; }
.switch-btn { background: #4b5563; width: 45px; height: 45px; font-size: 1rem; }

/* ==========================================================================
   10. TOKEN VIP E MENSAGENS
   ========================================================================== */

/* Botão para mostrar o Token */
.btn-toggle-token {
    background: #e0e7ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-toggle-token:hover {
    background: #c7d2fe;
}

/* Mensagem de Token (Abaixo do E-mail) */
.token-info-msg {
    font-size: 0.85rem;
    color: #4338ca; /* Roxo escuro */
    background: #e0e7ff; /* Roxo claro */
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #c7d2fe;
}

.token-info-msg strong {
    font-weight: 700;
    color: #3730a3;
}

/* ==========================================================================
   11. CHECKBOX "NÃO SOU UM ROBÔ"
   ========================================================================== */

.robot-check-container {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    padding: 15px 20px;
    border-radius: 8px;
    display: inline-block;
    margin-top: 25px;
    min-width: 250px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.robot-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    color: #374151;
    font-weight: 600;
    position: relative;
    user-select: none;
    margin: 0;
}

.robot-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 26px;
    width: 26px;
    background-color: #fff;
    border: 2px solid #9ca3af;
    border-radius: 4px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.robot-label:hover input ~ .checkmark {
    border-color: #6366f1;
}

.robot-label input:checked ~ .checkmark {
    background-color: #10b981; /* Verde */
    border-color: #10b981;
}

.checkmark:after {
    content: "";
    display: none;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.robot-label input:checked ~ .checkmark:after {
    display: block;
}

.robot-text {
    font-family: 'Arial', sans-serif;
    color: #4b5563;
    font-size: 0.95rem;
}

/* ==========================================================================
   12. BOTÃO DE ENVIO (SUBMIT)
   ========================================================================== */

#comgem-submit-btn {
    width: 100%;
    padding: 20px;
    margin-top: 30px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

#comgem-submit-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

#comgem-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s infinite linear;
    vertical-align: middle;
    margin-left: 10px;
}

@keyframes spin { to { transform: rotate(360deg); } }

#comgem-response {
    margin-top: 25px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: none;
}

/* ==========================================================================
   13. FRONTEND: LISTA DE COMENTÁRIOS E EXIBIÇÃO
   ========================================================================== */

.comgem-comments-area {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid #e5e7eb;
}

.comgem-comments-area h3 {
    text-align: center;
    font-size: 1.8rem;
    color: #1f2937;
    margin-bottom: 30px;
    font-weight: 700;
}

.comgem-comment-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative;
    border-left: 4px solid #6366f1;
}

.comgem-comment-author {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comgem-comment-author img {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.comgem-comment-content {
    color: #4b5563;
    line-height: 1.6;
    font-size: 1rem;
}

.comgem-comment-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.comgem-like-btn,
.comgem-reply-btn {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    color: #6b7280;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.comgem-like-btn:hover,
.comgem-reply-btn:hover {
    background: #f3f4f6;
    border-color: #6366f1;
    color: #6366f1;
}

.comgem-like-btn.liked {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

.comgem-comment-replies {
    margin-left: 30px;
    padding-left: 20px;
    border-left: 2px dashed #d1d5db;
    margin-top: 20px;
}

/* ==========================================================================
   14. SINGLE POST DISPLAY (GALERIA E LIGHTBOX)
   ========================================================================== */

.comgem-main-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 15px;
}

.comgem-featured-image-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.comgem-video-embed iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Galeria */
.comgem-gallery {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.comgem-gallery h4 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #1f2937;
}

.gallery-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.comgem-gallery-item {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.comgem-gallery-item:hover {
    transform: scale(1.05);
    z-index: 5;
}

/* Modal de Zoom */
.comgem-zoom-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.comgem-zoom-modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    border: 2px solid #fff;
    border-radius: 4px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.comgem-zoom-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100001;
}

.comgem-zoom-nav {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    transition: 0.3s;
    user-select: none;
    z-index: 100000;
}

.comgem-zoom-nav:hover {
    background: rgba(255,255,255,0.3);
}

.comgem-zoom-nav.next { right: 20px; }
.comgem-zoom-nav.prev { left: 20px; }

/* --------------------------------------------------------------------------
   15. MEDIA QUERIES (RESPONSIVIDADE)
   -------------------------------------------------------------------------- 
*/

@media (max-width: 768px) {
    .comgem-col {
        width: 100%;
        flex: 0 0 100%;
    }
    
    #comentarios-gemini-form-container {
        padding: 25px;
    }
    
    .media-box {
        min-height: auto;
    }
    
    .comgem-zoom-modal-content {
        max-width: 95%;
    }
    
    .media-controls button {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}