/* =============================================
   ESTILOS GLOBALES
   ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #eef0f2;
    color: #1a1a2e;
    line-height: 1.6;
}

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

a {
    text-decoration: none;
    color: #1a6fc4;
}

a:hover {
    color: #0b4f8a;
}

/* =============================================
   HEADER - SIN CATEGORÍAS
   ============================================= */
.header {
    background: #0b1f33;
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

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

.logo a {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 800;
    color: white;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f5b942, #f39c12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    color: #0b1f33;
}

.logo-text {
    background: linear-gradient(135deg, #f5b942, #f39c12);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.search-box input {
    background: transparent;
    border: none;
    padding: 8px 10px;
    color: white;
    font-size: 14px;
    width: 180px;
    outline: none;
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.5);
}

.search-box button {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 5px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* =============================================
   NAV - TARINGA MODERNO
   ============================================= */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    flex-wrap: wrap;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2px;
    flex-wrap: wrap;
}

.nav-menu li a {
    color: rgba(255,255,255,0.7);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-menu li a:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}

.nav-menu li a.active {
    color: #f5b942;
    background: rgba(245,185,66,0.1);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* =============================================
   CRÉDITOS WIDGET
   ============================================= */
.credits-widget-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(245,185,66,0.15);
    border: 1px solid rgba(245,185,66,0.2);
    padding: 4px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.credits-widget-header:hover {
    background: rgba(245,185,66,0.25);
}

.credits-widget-header .coins {
    color: #f5b942;
    font-size: 16px;
}

.credits-widget-header .balance {
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.credits-widget-header .label {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
}

.credits-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #16213e;
    border-radius: 10px;
    padding: 15px;
    min-width: 250px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.05);
    z-index: 100;
    margin-top: 5px;
}

.credits-dropdown.show {
    display: block;
}

.credits-dropdown .balance-big {
    font-size: 32px;
    font-weight: 800;
    color: #f5b942;
    text-align: center;
}

.credits-dropdown .balance-label {
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    margin-bottom: 15px;
}

.credits-dropdown .buy-btn {
    display: block;
    background: linear-gradient(135deg, #f5b942, #f39c12);
    color: #0b1f33;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
}

.credits-dropdown .buy-btn:hover {
    transform: scale(1.02);
}

.credits-dropdown .history-link {
    display: block;
    color: rgba(255,255,255,0.5);
    text-align: center;
    font-size: 12px;
    margin-top: 10px;
    text-decoration: none;
}

.credits-dropdown .history-link:hover {
    color: white;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    padding: 20px 0;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 25px;
}

/* =============================================
   BREADCRUMB - CATEGORÍA ACTUAL
   ============================================= */
.breadcrumb {
    background: white;
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 16px;
    border: 1px solid #e8ecf1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #1a6fc4;
    font-size: 13px;
    font-weight: 500;
}

.breadcrumb span {
    color: #888;
    font-size: 13px;
}

.breadcrumb .current {
    color: #1a1a2e;
    font-weight: 600;
}

/* =============================================
   POST CARD
   ============================================= */
.post-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e8ecf1;
    transition: all 0.2s;
}

.post-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.post-card.sticky {
    border-left: 4px solid #f5b942;
    background: #fffdf5;
    position: relative;
}

.post-card.sticky::before {
    content: "📌";
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 16px;
    opacity: 0.8;
}

.post-card.sticky .sticky-badge {
    display: inline-block;
    background: #f5b942;
    color: #0b1f33;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 10px;
    border-radius: 10px;
    margin-right: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sticky-section {
    margin-bottom: 20px;
}

.sticky-section .sticky-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #856404;
    background: #fff8e1;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
    width: fit-content;
}

.posts-divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    color: #888;
    font-size: 12px;
    font-weight: 500;
}

.posts-divider::before,
.posts-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e8ecf1;
}

.post-header {
    padding: 14px 18px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.post-category {
    font-size: 11px;
    font-weight: 600;
    color: #1a6fc4;
    background: #e8f0fe;
    padding: 2px 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-category .cost-badge {
    background: #fff3cd;
    color: #856404;
    font-size: 9px;
    padding: 0 6px;
    border-radius: 8px;
    margin-left: 4px;
}

.post-category .cost-badge.free {
    background: #d4edda;
    color: #155724;
}

.post-category .subcat-badge {
    background: #e8ecf1;
    color: #666;
    font-size: 9px;
    padding: 0 6px;
    border-radius: 8px;
    margin-left: 4px;
}

.post-date {
    font-size: 11px;
    color: #888;
}

.post-title {
    padding: 0 18px;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
}

.post-title a {
    color: #1a1a2e;
    text-decoration: none;
}

.post-title a:hover {
    color: #1a6fc4;
}

.post-excerpt {
    padding: 0 18px;
    color: #666;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.post-footer {
    padding: 8px 18px;
    border-top: 1px solid #f0f2f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    flex-wrap: wrap;
    gap: 6px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-author img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e8ecf1;
}

.post-author a {
    color: #1a1a2e;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none;
}

.post-author a:hover {
    color: #1a6fc4;
}

.post-stats {
    display: flex;
    gap: 14px;
    color: #888;
}

.post-stats span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.post-stats i {
    font-size: 13px;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar-widget {
    background: white;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e8ecf1;
}

.sidebar-widget .widget-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f2f5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-widget .widget-title i {
    color: #f5b942;
    font-size: 16px;
}

/* Categorías en sidebar con subcategorías */
.category-list {
    list-style: none;
    padding: 0;
}

.category-list li {
    padding: 8px 12px;
    margin-bottom: 4px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e8ecf1;
    transition: all 0.2s;
}

.category-list li:hover {
    background: #e8f0fe;
    border-color: #1a6fc4;
}

.category-list li:last-child {
    margin-bottom: 0;
}

.category-list li > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #1a1a2e;
    font-weight: 600;
    text-decoration: none;
    font-size: 13px;
}

.category-list li > a:hover {
    color: #1a6fc4;
}

.category-list .badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.badge-free {
    background: #d4edda;
    color: #155724;
}

.badge-paid {
    background: #fff3cd;
    color: #856404;
}

/* Subcategorías */
.subcategory-list {
    list-style: none;
    padding: 8px 0 4px 20px;
    margin-top: 6px;
    border-top: 1px dashed #e8ecf1;
}

.subcategory-list li {
    padding: 4px 8px;
    margin-bottom: 2px;
    background: transparent;
    border: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.subcategory-list li:hover {
    background: #e8f0fe;
    transform: translateX(4px);
}

.subcategory-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-weight: 400;
    text-decoration: none;
    font-size: 12px;
}

.subcategory-list li a:hover {
    color: #1a6fc4;
}

.subcategory-list .sub-badge {
    font-size: 9px;
    padding: 1px 8px;
    border-radius: 8px;
    background: #f0f2f5;
    color: #888;
}

/* =============================================
   CREAR POST - CON SELECCIÓN DE CATEGORÍA
   ============================================= */
.create-post-form {
    background: white;
    border-radius: 10px;
    padding: 25px;
    border: 1px solid #e8ecf1;
}

.create-post-form h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 20px;
}

.create-post-form h2 i {
    color: #f5b942;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 5px;
    color: #1a1a2e;
}

.form-group label .required {
    color: #e74c3c;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e8ecf1;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: all 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a6fc4;
    box-shadow: 0 0 0 3px rgba(26,111,196,0.1);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.form-group select option {
    padding: 8px;
}

.form-group select optgroup {
    font-weight: 700;
    color: #1a1a2e;
}

.form-group select optgroup option {
    font-weight: 400;
    padding-left: 12px;
}

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

.form-group .help-text {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.form-group .credit-info {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.form-group .credit-info.free {
    background: #d4edda;
    color: #155724;
}

.form-group .credit-info.paid {
    background: #fff3cd;
    color: #856404;
}

.submit-btn {
    padding: 10px 30px;
    background: linear-gradient(135deg, #f5b942, #f39c12);
    color: #0b1f33;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(245,185,66,0.3);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* =============================================
   COMPRA DE CRÉDITOS - SOLICITUD AL ADMIN
   ============================================= */
.credit-request-form {
    background: white;
    border-radius: 10px;
    padding: 25px;
    border: 1px solid #e8ecf1;
    margin-bottom: 20px;
}

.credit-request-form h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}

.credit-request-form h2 i {
    color: #f5b942;
}

.credit-request-form .subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.credit-request-form .info-box {
    background: #e8f0fe;
    border-left: 4px solid #1a6fc4;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #1a1a2e;
}

.credit-request-form .info-box i {
    color: #1a6fc4;
    margin-right: 6px;
}

.credit-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.credit-package-option {
    padding: 12px;
    border: 2px solid #e8ecf1;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.credit-package-option:hover {
    border-color: #1a6fc4;
}

.credit-package-option.selected {
    border-color: #f5b942;
    background: #fffdf5;
}

.credit-package-option .amount {
    font-size: 24px;
    font-weight: 800;
    color: #f5b942;
}

.credit-package-option .price {
    font-size: 13px;
    color: #666;
}

.credit-package-option .radio {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #e8ecf1;
    margin-top: 6px;
    transition: all 0.2s;
}

.credit-package-option.selected .radio {
    border-color: #f5b942;
    background: #f5b942;
    box-shadow: inset 0 0 0 3px white;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
    background: #0b1f33;
    color: rgba(255,255,255,0.6);
    padding: 20px 0 10px;
    margin-top: 20px;
    border-top: 3px solid #f5b942;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 10px;
}

.footer-section h3 {
    color: white;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.footer-section h3 span {
    color: #f5b942;
}

.footer-section h4 {
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.footer-section p {
    font-size: 12px;
    line-height: 1.5;
    opacity: 0.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    padding: 2px 0;
    font-size: 12px;
}

.footer-section ul li a {
    color: rgba(255,255,255,0.6);
    transition: color 0.2s;
    text-decoration: none;
}

.footer-section ul li a:hover {
    color: #f5b942;
}

.footer-bottom {
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 11px;
    color: rgba(255,255,255,0.3);
}

.footer-bottom a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
}

.footer-bottom a:hover {
    color: #f5b942;
}

/* =============================================
   BOTONES DE NAVEGACIÓN
   ============================================= */
.nav-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 15px 0;
    border-top: 2px solid #e8ecf1;
    margin-top: 10px;
}

.nav-btn {
    padding: 8px 18px;
    background: #f0f2f5;
    color: #333;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: #e0e2e5;
}

.nav-btn.active {
    background: #1a6fc4;
    color: white;
}

.nav-btn.primary {
    background: linear-gradient(135deg, #f5b942, #f39c12);
    color: #0b1f33;
}

.nav-btn.primary:hover {
    transform: scale(1.02);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 992px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .search-box {
        display: none;
    }

    .main-nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 10px 0;
    }

    .main-nav.open {
        display: flex;
    }

    .nav-menu {
        flex-direction: column;
        gap: 1px;
    }

    .nav-menu li a {
        padding: 10px 15px;
    }

    .nav-right {
        flex-direction: column;
        align-items: stretch;
        padding-top: 10px;
        border-top: 1px solid rgba(255,255,255,0.05);
    }

    .credits-widget-header {
        justify-content: center;
    }

    .credits-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 10px 10px 0 0;
        padding: 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .credit-packages-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .credit-packages-grid {
        grid-template-columns: 1fr;
    }
}
/* =============================================
   MEJORAS HOME Y PAGINACIÓN
   ============================================= */

/* Filtros */
.filters-bar a {
    transition: all 0.2s ease;
}
.filters-bar a:hover {
    background: #e8f0fe !important;
    color: #1a6fc4 !important;
}
.filters-bar a.active {
    background: #e8f0fe !important;
    color: #1a6fc4 !important;
    font-weight: 600;
}

/* Paginación */
.pagination .links a {
    transition: all 0.2s ease;
}
.pagination .links a:hover {
    background: #e8f0fe !important;
    color: #1a6fc4 !important;
}
.pagination .links .active {
    background: #f5b942 !important;
    color: #0b1f33 !important;
    font-weight: 700;
    border-radius: 6px;
}
.pagination .links .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination .links .prev,
.pagination .links .next {
    font-weight: 600;
}
.pagination .links .prev i,
.pagination .links .next i {
    font-size: 12px;
}

/* Responsive para paginación */
@media (max-width: 768px) {
    .pagination {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    .pagination .links {
        flex-wrap: wrap;
        justify-content: center;
    }
    .pagination .links a,
    .pagination .links span {
        padding: 4px 10px;
        font-size: 12px;
    }
}