/* ====================================================================
   QONNET FORUM - Main Stylesheet
   Diseño moderno inspirado en Habbo Hotel con colores de Qonnet
   ==================================================================== */

:root {
    /* Colores principales de Qonnet */
    --qonnet-primary: #00A8E8;
    --qonnet-secondary: #003459;
    --qonnet-accent: #00D4FF;
    --qonnet-dark: #001F3F;
    --qonnet-light: #E8F7FF;
    
    /* Colores de rangos */
    --rank-owner: #FF0000;
    --rank-admin: #FF6600;
    --rank-moderator: #00CC00;
    --rank-vip: #FFD700;
    --rank-user: #0099CC;
    
    /* Grises y neutros */
    --bg-primary: #0A1929;
    --bg-secondary: #132F4C;
    --bg-tertiary: #1A3A52;
    --bg-card: #1E3A5F;
    --text-primary: #FFFFFF;
    --text-secondary: #B0C4DE;
    --text-muted: #7B8FA3;
    
    /* Bordes y sombras */
    --border-color: #2C5282;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
    
    /* Animaciones */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ====================================================================
   Reset y Base
   ==================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Ubuntu', 'Roboto', sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--qonnet-dark) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--qonnet-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--qonnet-primary);
    text-decoration: underline;
}

/* ====================================================================
   Header / Navegación
   ==================================================================== */

.forum-header {
    background: linear-gradient(135deg, var(--qonnet-secondary) 0%, var(--bg-secondary) 100%);
    border-bottom: 3px solid var(--qonnet-primary);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forum-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--qonnet-accent);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.forum-logo img {
    height: 50px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

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

.nav-menu a {
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.nav-menu a:hover {
    background: rgba(0, 168, 232, 0.2);
    text-decoration: none;
    transform: translateY(-2px);
}

.nav-menu a.active {
    background: var(--qonnet-primary);
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--qonnet-accent);
    object-fit: cover;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.coins-display {
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--qonnet-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
}

.coins-icon {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 0 4px gold);
}

/* ====================================================================
   Container Principal
   ==================================================================== */

.forum-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* ====================================================================
   Breadcrumb
   ==================================================================== */

.breadcrumb {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-separator {
    color: var(--text-muted);
}

/* ====================================================================
   Categorías del Foro
   ==================================================================== */

.category-section {
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.category-header {
    background: linear-gradient(135deg, var(--qonnet-secondary) 0%, var(--bg-secondary) 100%);
    padding: 1.5rem;
    border-bottom: 2px solid var(--qonnet-primary);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.category-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.category-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--qonnet-accent);
}

.category-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ====================================================================
   Lista de Temas
   ==================================================================== */

.topics-list {
    list-style: none;
}

.topic-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1.5rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    align-items: center;
}

.topic-item:hover {
    background: rgba(0, 168, 232, 0.05);
    transform: translateX(5px);
}

.topic-item:last-child {
    border-bottom: none;
}

.topic-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 10px;
    font-size: 1.5rem;
    border: 2px solid var(--qonnet-primary);
}

.topic-icon.pinned {
    background: var(--qonnet-primary);
    animation: pulse 2s infinite;
}

.topic-icon.locked {
    opacity: 0.5;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.topic-info {
    min-width: 0; /* Para que funcione text-overflow */
}

.topic-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topic-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.topic-badge.pinned {
    background: var(--qonnet-primary);
    color: white;
}

.topic-badge.locked {
    background: #666;
    color: white;
}

.topic-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.topic-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rank-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.rank-owner { background: var(--rank-owner); color: white; }
.rank-admin { background: var(--rank-admin); color: white; }
.rank-moderator { background: var(--rank-moderator); color: white; }
.rank-vip { background: var(--rank-vip); color: black; }
.rank-user { background: var(--rank-user); color: white; }

.topic-stats {
    text-align: center;
}

.stat-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--qonnet-accent);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.topic-last-post {
    min-width: 200px;
}

.last-post-author {
    font-weight: 600;
    color: var(--qonnet-accent);
}

.last-post-time {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ====================================================================
   Posts
   ==================================================================== */

.post-item {
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 250px 1fr;
}

.post-sidebar {
    background: var(--bg-secondary);
    padding: 2rem 1.5rem;
    border-right: 2px solid var(--border-color);
    text-align: center;
}

.post-avatar-container {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.post-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--qonnet-accent);
    object-fit: cover;
}

.post-rank-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    border: 2px solid var(--bg-secondary);
}

.post-username {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.post-user-stats {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.post-user-stat {
    margin: 0.5rem 0;
}

.post-content-area {
    padding: 2rem;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.post-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.post-content {
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.post-content p {
    margin-bottom: 1rem;
}

.post-signature {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.post-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.post-action-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.post-action-btn:hover {
    background: var(--qonnet-primary);
    border-color: var(--qonnet-accent);
    transform: translateY(-2px);
}

/* ====================================================================
   Formularios
   ==================================================================== */

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--qonnet-primary);
    box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.2);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
}

/* ====================================================================
   Botones
   ==================================================================== */

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--qonnet-primary) 0%, var(--qonnet-accent) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

.btn-danger {
    background: #DC3545;
    color: white;
}

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

/* ====================================================================
   Galería de Fotos
   ==================================================================== */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 1rem;
    transform: translateY(100%);
    transition: transform var(--transition-normal);
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-likes {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ====================================================================
   Avatares Habbo Style
   ==================================================================== */

.habbo-avatar {
    display: inline-block;
    width: 64px;
    height: 110px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
}

.habbo-avatar-small {
    width: 32px;
    height: 55px;
}

.habbo-avatar-large {
    width: 128px;
    height: 220px;
}

/* ====================================================================
   Paginación
   ==================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.page-link {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.page-link:hover {
    background: var(--qonnet-primary);
    text-decoration: none;
}

.page-link.active {
    background: var(--qonnet-primary);
    border-color: var(--qonnet-accent);
}

/* ====================================================================
   Modal
   ==================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn var(--transition-normal);
}

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

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--qonnet-primary);
    animation: slideUp var(--transition-normal);
}

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

/* ====================================================================
   Notificaciones
   ==================================================================== */

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #DC3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* ====================================================================
   Responsive
   ==================================================================== */

@media (max-width: 1024px) {
    .post-item {
        grid-template-columns: 1fr;
    }
    
    .post-sidebar {
        border-right: none;
        border-bottom: 2px solid var(--border-color);
    }
}

@media (max-width: 768px) {
    .forum-container {
        padding: 0 1rem;
    }
    
    .topic-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* ====================================================================
   Scrollbar personalizado
   ==================================================================== */

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--qonnet-primary);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--qonnet-accent);
}
