/* ======================================
   FÓRUM RPG TIBIA - CSS MOBILE RESPONSIVO
   Estilos específicos para dispositivos móveis
   ====================================== */

/* Mobile First Approach - Estilos para tablets */
@media (max-width: 992px) {
    .forum-header {
        padding: 1.5rem 0;
    }
    
    .forum-title {
        font-size: 2.5rem;
        text-align: center;
    }
    
    .forum-subtitle {
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-item {
        padding: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .subforum-link {
        padding: 1.25rem;
    }
    
    .subforum-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .subforum-name {
        font-size: 1rem;
    }
    
    .subforum-last-post {
        width: 180px;
    }
    
    .last-post-topic {
        font-size: 0.8rem;
    }
    
    .last-post-meta {
        font-size: 0.7rem;
    }
}

/* Estilos para smartphones */
@media (max-width: 768px) {
    .forum-container {
        padding: 0;
    }
    
    .forum-header {
        padding: 1rem 0;
        text-align: center;
    }
    
    .forum-header .row {
        flex-direction: column;
    }
    
    .forum-header .col-md-8,
    .forum-header .col-md-4 {
        width: 100%;
        max-width: 100%;
    }
    
    .forum-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .forum-title .title-icon {
        margin-right: 0.5rem;
        font-size: 1.5rem;
    }
    
    .forum-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .forum-stats {
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 8px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .stat-item {
        padding: 0.5rem;
        border-radius: 6px;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    /* Navegação breadcrumb mobile */
    .forum-breadcrumb {
        padding: 0.75rem 0;
    }
    
    .breadcrumb {
        flex-wrap: wrap;
        font-size: 0.8rem;
    }
    
    .breadcrumb-item {
        margin-bottom: 0.25rem;
    }
    
    /* Container principal mobile */
    .container {
        padding: 0 1rem;
    }
    
    /* Boas-vindas mobile */
    .welcome-card {
        margin: 0 1rem 1.5rem 1rem;
        border-radius: 8px;
    }
    
    .welcome-header {
        padding: 0.75rem 1rem;
    }
    
    .welcome-header h3 {
        font-size: 1.1rem;
    }
    
    .welcome-body {
        padding: 1rem;
    }
    
    .welcome-features {
        margin: 0.75rem 0;
    }
    
    .welcome-features li {
        padding: 0.4rem 0;
        font-size: 0.9rem;
    }
    
    .welcome-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-medieval,
    .btn-secondary {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Busca mobile */
    .search-container {
        margin: 0 1rem 1.5rem 1rem;
        padding: 1rem;
        border-radius: 8px;
    }
    
    .search-input-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .search-input-group .form-control {
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    .search-input-group .btn-medieval {
        width: 100%;
    }
    
    /* Categorias mobile */
    .forum-categories {
        margin: 0 1rem 1.5rem 1rem;
    }
    
    .category-card {
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .category-header {
        padding: 0.75rem 1rem;
    }
    
    .category-header .d-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .category-title {
        font-size: 1.2rem;
        margin: 0;
    }
    
    .category-description {
        font-size: 0.8rem;
        margin: 0.25rem 0 0 0;
    }
    
    .category-stats {
        align-self: flex-start;
    }
    
    .badge-medieval {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Subfóruns mobile */
    .subforum-item {
        border-bottom: 1px solid var(--border-dark);
    }
    
    .subforum-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
        text-align: left;
    }
    
    .subforum-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        align-self: flex-start;
    }
    
    .subforum-info {
        width: 100%;
        order: 1;
    }
    
    .subforum-name {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .subforum-desc {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    .subforum-moderators {
        margin-top: 0.4rem;
    }
    
    .subforum-moderators small {
        font-size: 0.75rem;
    }
    
    .subforum-stats {
        width: 100%;
        order: 2;
        text-align: left;
        padding: 0;
    }
    
    .subforum-numbers {
        justify-content: flex-start;
        gap: 1.5rem;
    }
    
    .stat-block {
        text-align: left;
    }
    
    .stat-value {
        font-size: 0.9rem;
    }
    
    .stat-type {
        font-size: 0.7rem;
    }
    
    .subforum-last-post {
        width: 100%;
        order: 3;
        text-align: left;
        padding: 0;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-dark);
    }
    
    .last-post-info {
        justify-content: flex-start;
        gap: 0.5rem;
    }
    
    .last-post-avatar {
        width: 28px;
        height: 28px;
    }
    
    .last-post-details {
        text-align: left;
    }
    
    .last-post-topic {
        font-size: 0.8rem;
        margin-bottom: 0.1rem;
    }
    
    .last-post-meta {
        font-size: 0.7rem;
        line-height: 1.2;
    }
    
    /* Atividade recente mobile */
    .row.mt-4 {
        margin: 0 1rem;
    }
    
    .col-lg-8,
    .col-lg-4 {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .recent-activity {
        margin-bottom: 1.5rem;
        padding: 1rem;
        border-radius: 8px;
    }
    
    .section-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .activity-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem 0;
    }
    
    .activity-avatar {
        width: 32px;
        height: 32px;
        align-self: flex-start;
    }
    
    .activity-content {
        width: 100%;
    }
    
    .activity-text {
        font-size: 0.9rem;
        line-height: 1.3;
        margin-bottom: 0.25rem;
    }
    
    .activity-time {
        font-size: 0.75rem;
    }
    
    .badge-hot,
    .badge-new {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
    }
    
    /* Usuários online mobile */
    .online-users-info p {
        font-size: 0.85rem;
    }
    
    .online-users-list {
        gap: 0.4rem;
    }
    
    .online-user-avatar {
        width: 28px;
        height: 28px;
    }
}

/* Estilos para smartphones pequenos */
@media (max-width: 480px) {
    .forum-title {
        font-size: 1.75rem;
    }
    
    .forum-title .title-icon {
        font-size: 1.25rem;
    }
    
    .forum-subtitle {
        font-size: 0.85rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }
    
    .stat-item {
        padding: 0.4rem 0.6rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .stat-number {
        font-size: 1.1rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .category-card {
        border-radius: 6px;
    }
    
    .category-header {
        padding: 0.6rem 0.8rem;
    }
    
    .category-title {
        font-size: 1.1rem;
    }
    
    .category-title i {
        font-size: 1rem;
    }
    
    .subforum-link {
        padding: 0.8rem;
        gap: 0.6rem;
    }
    
    .subforum-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .subforum-name {
        font-size: 0.95rem;
    }
    
    .subforum-desc {
        font-size: 0.8rem;
    }
    
    .subforum-numbers {
        gap: 1rem;
    }
    
    .last-post-avatar {
        width: 24px;
        height: 24px;
    }
    
    .last-post-topic {
        font-size: 0.75rem;
    }
    
    .last-post-meta {
        font-size: 0.65rem;
    }
    
    .recent-activity {
        padding: 0.8rem;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    .activity-item {
        padding: 0.6rem 0;
    }
    
    .activity-avatar {
        width: 28px;
        height: 28px;
    }
    
    .activity-text {
        font-size: 0.85rem;
    }
    
    .activity-time {
        font-size: 0.7rem;
    }
    
    .btn-medieval,
    .btn-secondary {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .welcome-header h3 {
        font-size: 1rem;
    }
    
    .welcome-features li {
        font-size: 0.85rem;
    }
    
    .search-input-group .form-control {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
}

/* Orientação landscape para smartphones */
@media (max-width: 768px) and (orientation: landscape) {
    .forum-header {
        padding: 0.75rem 0;
    }
    
    .forum-title {
        font-size: 1.5rem;
    }
    
    .forum-subtitle {
        font-size: 0.8rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .stat-item {
        padding: 0.4rem;
    }
    
    .stat-number {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .subforum-link {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        padding: 0.75rem;
    }
    
    .subforum-info {
        flex: 1;
        order: 0;
    }
    
    .subforum-stats {
        width: auto;
        order: 1;
        margin-left: auto;
    }
    
    .subforum-last-post {
        width: 200px;
        order: 2;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }
    
    .last-post-info {
        justify-content: flex-end;
    }
    
    .last-post-details {
        text-align: right;
    }
}

/* Melhorias para telas de alta densidade (Retina) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .forum-title {
        text-shadow: 
            1px 1px 2px rgba(0, 0, 0, 0.8),
            0 0 5px rgba(212, 175, 55, 0.4);
    }
    
    .subforum-icon,
    .activity-avatar,
    .last-post-avatar,
    .online-user-avatar {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Estilos para modo escuro do sistema */
@media (prefers-color-scheme: dark) {
    .search-input-group .form-control {
        background: var(--bg-tertiary);
        border-color: var(--border-dark);
        color: var(--text-primary);
    }
    
    .search-input-group .form-control::placeholder {
        color: var(--text-muted);
    }
    
    .search-input-group .form-control:focus {
        border-color: var(--tibia-gold);
        box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
    }
}

/* Estilos para usuários que preferem menos movimento */
@media (prefers-reduced-motion: reduce) {
    .title-icon {
        animation: none;
    }
    
    .category-card,
    .subforum-item,
    .activity-item {
        animation: none;
    }
    
    .btn-medieval:hover,
    .subforum-item:hover {
        transform: none;
    }
    
    .stat-item:hover {
        transform: none;
    }
}

/* Estilos para impressão */
@media print {
    .forum-header,
    .forum-breadcrumb,
    .welcome-section,
    .search-container,
    .forum-actions,
    .btn-medieval,
    .btn-secondary {
        display: none !important;
    }
    
    .forum-container {
        background: white;
        color: black;
    }
    
    .category-card,
    .recent-activity {
        border: 1px solid #ccc;
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .category-title,
    .section-title {
        color: #333;
    }
    
    .subforum-name {
        color: #666;
    }
    
    .activity-text a {
        color: #000;
        text-decoration: underline;
    }
}
