/* ============================================
   BLOG - DICAS & TRUQUES
   Design moderno e responsivo - Estilo Escuro
   ============================================ */

.blog-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================
   CABEÇALHO DO BLOG
   ============================================ */

.blog-header {
    text-align: center;
    margin-bottom: 32px;
    padding: 0;
}

.blog-header h1,
.blog-container h1 {
    font-size: 32px;
    margin: 0 0 8px 0;
    font-weight: 600;
    color: #ffffff !important;
    letter-spacing: -0.5px;
}

.blog-header .blog-subtitle {
    font-size: 14px;
    margin: 0;
    color: rgba(255, 255, 255, 0.65) !important;
    font-weight: 400;
    line-height: 1.5;
}

/* ============================================
   BOTÃO ADICIONAR POST (ADMIN)
   ============================================ */

.add-post-section {
    margin-bottom: 24px;
    text-align: left;
}

.btn-add-post {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0.1px;
}

.btn-add-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-add-post:active {
    transform: translateY(0);
}

.btn-add-post i {
    margin-right: 8px;
}

/* ============================================
   GRID DE POSTS
   ============================================ */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 24px;
    justify-items: stretch;
    align-items: start;
}

@media (max-width: 1200px) {
    .blog-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ============================================
   CARDS DOS POSTS
   ============================================ */

.blog-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 100%;
    backdrop-filter: blur(10px);
}

.blog-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.blog-card-image {
    width: 100%;
    height: 280px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.blog-card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    transition: opacity 0.3s ease;
}

.blog-card:hover .blog-card-image::before {
    opacity: 0.7;
}

.blog-card-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

.blog-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.blog-card h2,
.blog-card-title {
    font-size: 16px;
    margin: 0 0 12px 0;
    color: #ffffff;
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.2s ease;
    min-height: 44px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.3px;
}

.blog-card:hover h2,
.blog-card:hover .blog-card-title {
    color: #10b981;
}

.blog-card-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 16px 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-card-date {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-card-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    align-self: flex-start;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0.1px;
}

.blog-card-button:hover {
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.blog-card-button i {
    transition: transform 0.3s ease;
}

.blog-card-button:hover i {
    transform: translateX(5px);
}

/* ============================================
   BOTÕES DE ADMIN (EDITAR/DELETAR)
   ============================================ */

.blog-card-admin-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 100;
}

.btn-edit-post,
.btn-delete-post {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 12px;
}

.btn-edit-post {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.btn-edit-post:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.5);
    transform: scale(1.05);
}

.btn-delete-post {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.btn-delete-post:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
    transform: scale(1.05);
}

.btn-edit-post:active,
.btn-delete-post:active {
    transform: scale(0.95);
}

/* ============================================
   MENSAGENS DE ESTADO
   ============================================ */

.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.no-posts i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.no-posts p {
    font-size: 14px;
    margin: 0;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    margin: 24px 0;
}

/* ============================================
   MODAL ADICIONAR POST
   ============================================ */

.modal-post {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

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

.modal-post-content {
    background: rgba(26, 26, 26, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 3% auto;
    padding: 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.4s ease;
    max-height: 90vh;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-post-close {
    color: rgba(255, 255, 255, 0.7);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.modal-post-close:hover,
.modal-post-close:focus {
    color: #ffffff;
}

.modal-post-content h2 {
    margin-top: 0;
    color: #ffffff;
    font-size: 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.modal-post-content h2 i {
    color: #10b981;
}

/* ============================================
   FORMULÁRIO
   ============================================ */

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 12px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.2s ease;
    box-sizing: border-box;
    background: #2a2a2a;
    color: #ffffff;
}

.form-group input[type="text"]:focus,
.form-group input[type="url"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(16, 185, 129, 0.5);
    background: #333333;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

/* Summernote Editor dentro do modal */
.note-editor {
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.note-editor.note-frame {
    border-radius: 8px !important;
}

.note-toolbar {
    background: #2a2a2a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px 8px 0 0 !important;
}

.note-toolbar .btn-group .btn {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.note-toolbar .btn-group .btn:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
}

.note-editable {
    background: #2a2a2a !important;
    color: #ffffff !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    padding: 12px !important;
    text-align: left !important;
}

.note-editable p,
.note-editable h3,
.note-editable h4,
.note-editable div {
    text-align: left !important;
    color: #ffffff !important;
}

.note-statusbar {
    border-radius: 0 0 8px 8px !important;
    background: #2a2a2a !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
}

.form-group small a {
    color: #10b981;
    text-decoration: none;
}

.form-group small a:hover {
    text-decoration: underline;
}

/* ============================================
   AÇÕES DO FORMULÁRIO
   ============================================ */

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: flex-end;
}

.btn-cancel,
.btn-submit {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0.1px;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-submit {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-submit i {
    margin-right: 8px;
}

/* ============================================
   MENSAGENS DE FEEDBACK
   ============================================ */

.post-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    display: none;
    font-weight: 500;
    animation: slideUp 0.3s ease;
}

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

.post-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

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

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 768px) {
    .blog-header h1 {
        font-size: 2.5em;
    }

    .blog-subtitle {
        font-size: 1.1em;
    }

    .modal-post-content {
        margin: 5% auto;
        padding: 25px;
        width: 95%;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-cancel,
    .btn-submit {
        width: 100%;
    }

    .blog-card-title {
        font-size: 1.4em;
    }
}

/* ============================================
   SCROLLBAR PERSONALIZADA
   ============================================ */

.modal-post-content::-webkit-scrollbar {
    width: 10px;
}

.modal-post-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.modal-post-content::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.3);
    border-radius: 10px;
}

.modal-post-content::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.5);
}

