/* ========== MOBILE IPHONE 13 (1170x2532) ========== */
@media (max-width: 480px), (max-width: 1170px) and (max-height: 2532px) {
    html, body {
        max-width: 100vw;
        overflow-x: hidden;
    }
    .study-room-container {
        max-width: 100vw;
        padding: 0 0.5rem;
        margin: 0 auto;
    }
    .room-header, .room-content, .lobby-content {
        max-width: 100vw;
        width: 100vw;
        box-sizing: border-box;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .chat-panel {
        min-width: 0;
        width: 100vw;
        max-width: 100vw;
        min-height: 300px;
        height: 60vh;
    }
    .chat-messages {
        max-height: 45vh;
        min-height: 200px;
        font-size: 1rem;
        padding: 0.5rem;
        word-break: break-word;
    }
    .participants-panel {
        max-height: 120px;
        overflow-y: auto;
    }
    .chat-input-container {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    .chat-input-container input[type="text"] {
        width: 100%;
        font-size: 1rem;
    }
    .btn-send, .btn-primary, .btn-secondary {
        width: 100%;
        font-size: 1rem;
        padding: 0.8rem 0;
    }
    .modal-content {
        margin: 0.5rem;
        width: 95vw;
        max-width: 95vw;
    }
    .message-text {
        font-size: 1rem;
        word-break: break-word;
    }
    .message-wrapper, .message {
        max-width: 98vw;
        box-sizing: border-box;
    }
}
/* Salas de Estudo - Estilos */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.message-wrapper {
    display: flex;
    align-items: flex-end;
    margin-bottom: 0.7rem;
    width: 100%;
}
.message.own {
    background: linear-gradient(135deg, #667eea 0%, #9333ea 100%);
    color: #fff;
    border-radius: 18px 18px 0 18px;
    box-shadow: 0 2px 8px rgba(102,126,234,0.10);
    max-width: 75%;
    min-width: 180px;
    margin-left: auto;
    margin-right: 0;
    word-break: break-word;
    display: flex;
    align-items: center;
}
.message:not(.own) {
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 18px 18px 18px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    max-width: 75%;
    min-width: 180px;
    margin-right: auto;
    margin-left: 0;
    word-break: break-word;
    display: flex;
    align-items: center;
}
.message-content {
    padding: 0.7rem 1.2rem;
    width: 100%;
    display: flex;
    align-items: center;
}
.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 0.7rem;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Força textos e títulos pretos no modo claro */
:root:not([data-theme="dark"]) h1,
:root:not([data-theme="dark"]) h2,
:root:not([data-theme="dark"]) h3,
:root:not([data-theme="dark"]) h4,
:root:not([data-theme="dark"]) h5,
:root:not([data-theme="dark"]) h6,
:root:not([data-theme="dark"]) p,
:root:not([data-theme="dark"]) label {
    color: #000000 !important;
}

/* Exceções: manter cor padrão em inputs e spans dentro de mensagens */
:root:not([data-theme="dark"]) input,
:root:not([data-theme="dark"]) textarea,
:root:not([data-theme="dark"]) .message-content,
:root:not([data-theme="dark"]) .message-content span {
    color: var(--text-primary) !important;
}

.study-room-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ========== LOBBY ========== */
.lobby-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.lobby-content {
    width: 100%;
    max-width: 900px;
}

.lobby-header {
    text-align: center;
    margin-bottom: 3rem;
}

.lobby-header h2 {
    color: var(--text-primary);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.lobby-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.lobby-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.action-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
}

.action-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.action-card h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.action-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.premium-badge-small {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.action-card input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.action-card input:focus {
    outline: none;
    border-color: var(--primary);
}

.action-card button {
    width: 100%;
}

/* Minhas Salas */
.my-rooms {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
}

.my-rooms h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.rooms-list {
    display: grid;
    gap: 1rem;
}

.room-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
}

.room-item:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.room-item-info h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.room-item-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.room-item-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ========== SALA ATIVA ========== */
.room-active {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
}

.room-header {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.room-info h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.room-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.room-code {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.room-code strong {
    color: var(--primary);
    font-family: monospace;
    font-size: 1rem;
    background: var(--bg-primary);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* Layout do conteúdo da sala */
.room-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 1rem;
    flex: 2;
    overflow: hidden;
}

/* ========== PARTICIPANTES ========== */
.participants-panel {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    overflow-y: auto;
}

.participants-panel h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.participants-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem;
    background: var(--bg-primary);
    border-radius: 8px;
    transition: all 0.2s;
}

.participant-item:hover {
    background: var(--border-color);
}

.participant-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #9333ea);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.participant-info {
    flex: 1;
    min-width: 0;
}

.participant-name {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.participant-status {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========== CHAT ========== */
.chat-panel {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: var(--bg-primary);
    writing-mode: horizontal-tb !important;
    direction: ltr !important;
}

.chat-messages * {
    writing-mode: horizontal-tb !important;
    direction: ltr !important;
}

/* Scrollbar estilo moderno */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.message {
    display: flex;
    gap: 0.8rem;
    animation: slideIn 0.3s ease-out;
    align-items: flex-end;
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
    writing-mode: horizontal-tb !important;
    direction: ltr !important;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #9333ea);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.message-content {
    display: flex;
    flex-direction: column;
    max-width: 65%;
    min-width: 0;
    writing-mode: horizontal-tb !important;
    direction: ltr !important;
}

.message-content,
.message-content * {
    writing-mode: horizontal-tb !important;
    direction: ltr !important;
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    padding: 0 0.5rem;
}

.message-author {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
}

.message-time {
    color: var(--text-secondary);
    font-size: 0.7rem;
    opacity: 0.7;
}

.message-text {
    color: var(--text-primary);
    font-size: 15px !important;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    display: inline-block;
    padding: 0.7rem 1rem;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-text,
.message-text * {
    writing-mode: horizontal-tb !important;
    direction: ltr !important;
}

/* Mensagens próprias (direita) */
.message.own {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.message.own .message-content {
    align-items: flex-end;
}

.message.own .message-header {
    flex-direction: row-reverse;
}

.message.own .message-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border-radius: 18px 18px 4px 18px;
    text-align: left !important;
}

/* Mensagens dos outros (esquerda) */
.message:not(.own) .message-text {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 18px 18px 18px 4px;
    color: var(--text-primary);
    text-align: left !important;
}

.chat-input-container {
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.chat-input-container #attachFileBtn {
    font-size: 1.3rem;
    padding: 0.6rem;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.chat-input-container #attachFileBtn:hover {
    background: var(--bg-primary);
    color: var(--primary);
    transform: scale(1.1);
}

.chat-input-container #attachFileBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-input-container input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 0.9rem 1.2rem;
    border: none;
    border-radius: 24px;
    background: var(--bg-primary);
    color: var(--text-primary) !important;
    font-size: 15px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    white-space: normal;
    word-wrap: break-word;
    transition: all 0.2s;
}

.chat-input-container input[type="text"]:hover {
    background: var(--border-color);
}

.chat-input-container input[type="text"]::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
    writing-mode: horizontal-tb !important;
    direction: ltr !important;
}

.chat-input-container input:focus {
    outline: none;
    background: var(--bg-primary);
    box-shadow: 0 0 0 2px var(--primary);
}

.btn-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.9rem 1.8rem;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-send:active {
    transform: translateY(0);
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--text-primary);
    font-size: 1.3rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s;
}

.close-modal:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-info {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.form-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .room-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .participants-panel {
        max-height: 200px;
    }

    .lobby-actions {
        grid-template-columns: 1fr;
    }

    .room-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .message.own .message-text,
    .message:not(.own) .message-text {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .room-info h2 {
        font-size: 1.2rem;
    }

    .chat-input-container {
        flex-direction: column;
    }

    .btn-send {
        width: 100%;
    }

    .modal-content {
        margin: 1rem;
    }
}

/* ========== BUTTONS GERAIS ========== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #9333ea);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-delete {
    background: #f97316;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn-delete:hover {
    background: #ea580c;
    transform: translateY(-2px);
}

.room-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

/* ========== FERRAMENTAS DE ESTUDO ========== */
.study-tools {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.study-tools h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.tool-btn {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
    text-align: left;
}

.tool-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateX(5px);
}

/* ========== BARRA DE FERRAMENTAS DO CHAT ========== */
.chat-toolbar {
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.toolbar-btn {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.toolbar-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ========== INDICADOR DE DIGITAÇÃO ========== */
.typing-indicator {
    padding: 0.5rem 1.5rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.typing-dots {
    display: flex;
    gap: 0.3rem;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    animation: typingBounce 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

/* ========== REAÇÕES NAS MENSAGENS ========== */
.message-reactions {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.reaction-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.2rem 0.6rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.reaction-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.1);
}

.reaction-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.message-actions {
    display: none;
    position: absolute;
    top: -10px;
    right: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.3rem;
    gap: 0.3rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.message:hover .message-actions {
    display: flex;
}

.message-action-btn {
    background: none;
    border: none;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.message-action-btn:hover {
    background: var(--primary);
}

.message-wrapper {
    position: relative;
}

.message.pinned {
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
    padding-left: 1rem;
}

/* ========== POMODORO COMPARTILHADO ========== */
.pomodoro-display {
    text-align: center;
    padding: 2rem;
    background: var(--bg-primary);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.pomodoro-timer {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
    font-family: monospace;
    margin-bottom: 0.5rem;
}

.pomodoro-status {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.pomodoro-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.pomodoro-info {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.pomodoro-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.3rem 0;
}

/* ========== ENQUETES ========== */
.poll-container {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.poll-question {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.poll-option {
    position: relative;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.poll-option:hover {
    border-color: var(--primary);
}

.poll-option.selected {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.1);
}

.poll-option-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #9333ea);
    opacity: 0.2;
    transition: width 0.3s ease;
}

.poll-option-content {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.poll-option-text {
    color: var(--text-primary);
    font-weight: 500;
}

.poll-option-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

/* ========== MENSAGENS FIXADAS ========== */
.pinned-messages-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pinned-message-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-left: 3px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
}

.pinned-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.pinned-message-author {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.unpin-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.unpin-btn:hover {
    color: #ef4444;
    transform: scale(1.2);
}

.pinned-message-text {
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* ========== ENQUETES NO CHAT ========== */
.poll-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 1rem 0;
    padding: 0 0.5rem;
}

.poll-message {
    background: var(--card-bg);
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 85%;
    width: 100%;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.poll-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--border-color);
}

.poll-icon {
    font-size: 1.5rem;
}

.poll-title {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.poll-question {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    line-height: 1.4;
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.poll-option {
    position: relative;
}

.poll-option-btn {
    width: 100%;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.poll-option-btn:not(:disabled):hover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
    transform: translateX(4px);
}

.poll-option-btn:disabled {
    cursor: not-allowed;
}

.poll-option.voted .poll-option-btn {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.1);
}

.poll-option-text {
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
}

.poll-option-votes {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.poll-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.poll-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #9333ea);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.poll-total {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-color);
    font-weight: 500;
    line-height: 1.5;
}

/* ========== RESPONSIVE UPDATES ========== */
@media (max-width: 768px) {
    .chat-toolbar {
        flex-direction: column;
    }
    
    .search-input {
        width: 100%;
    }
    
    .pomodoro-timer {
        font-size: 3rem;
    }
    
    .pomodoro-controls {
        flex-direction: column;
    }
    
    .pomodoro-controls button {
        width: 100%;
    }
}

.btn-secondary {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: var(--card-bg);
}
