/* Animação para modal de comentários */
@keyframes slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-slide-up {
    animation: slide-up 0.3s ease-out;
}

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --dark-text: #212529;
    --border-color: #dee2e6;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
}

/* Container Principal */
#app {
    max-width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

/* Sistema de Telas - Ocultar todas por padrão */
.screen {
    display: none !important;
}

/* Mostrar apenas a tela ativa */
.screen.active {
    display: block !important;
}

/* Para telas que usam flexbox do Tailwind quando ativas */
.screen.active.flex,
.screen.active[class*="flex"] {
    display: flex !important;
}

/* Para telas que usam flex-col quando ativas */
.screen.active.flex-col {
    display: flex !important;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background: white;
    padding: 15px 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar h2 {
    font-size: 20px;
    font-weight: 600;
}

.nav-icons {
    display: flex;
    gap: 15px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    position: relative;
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--primary-color);
}

/* Content */
.content {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* Container */
.container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 32px;
}

/* Formulários de Autenticação */
.auth-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.auth-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
}

.auth-links {
    text-align: center;
    margin-top: 15px;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    display: block;
    margin: 5px 0;
}

/* Botões */
.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn:hover {
    opacity: 0.9;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Feed */
.post {
    background: white;
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.post-header {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.post-user-info {
    flex: 1;
}

.post-username {
    font-weight: 600;
    font-size: 14px;
}

.post-date {
    font-size: 12px;
    color: var(--secondary-color);
}

.post-media {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    background: #000;
}

.post-content {
    padding: 15px;
}

.post-caption {
    margin-bottom: 10px;
    font-size: 14px;
}

.post-actions {
    display: flex;
    gap: 15px;
    padding: 10px 15px;
    border-top: 1px solid var(--border-color);
}

.post-action {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-action.liked {
    color: var(--danger-color);
}

.post-stats {
    padding: 0 15px 10px;
    font-size: 14px;
    color: var(--secondary-color);
}

/* Formulário de Post */
.post-form {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.upload-area {
    margin-bottom: 20px;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-label {
    display: block;
    width: 100%;
    min-height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-align: center;
    padding: 20px;
}

#media-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.upload-text {
    color: var(--secondary-color);
}

.post-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 15px;
}

/* Perfil */
.profile-header {
    background: white;
    padding: 30px 20px;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid var(--primary-color);
}

.profile-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.profile-username {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.profile-bio {
    margin: 15px 0;
    font-size: 14px;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.profile-stat {
    text-align: center;
}

.profile-stat-value {
    font-size: 20px;
    font-weight: 600;
    display: block;
}

.profile-stat-label {
    font-size: 12px;
    color: var(--secondary-color);
}

.profile-actions {
    margin-top: 15px;
}

/* Chat */
.conversation {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.conversation-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.conversation-info {
    flex: 1;
}

.conversation-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 3px;
}

.conversation-last-message {
    font-size: 12px;
    color: var(--secondary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-unread {
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
}

/* Mensagens */
.chat-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    padding: 0;
}

#messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.message.sent {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
}

.message.received .message-bubble {
    background: white;
    border-bottom-left-radius: 4px;
}

.message.sent .message-bubble {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 10px;
    color: var(--secondary-color);
    margin-top: 5px;
}

.message-form {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: white;
    border-top: 1px solid var(--border-color);
}

.message-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
}

.message-form button {
    padding: 10px 20px;
    border-radius: 20px;
}

/* Notificações */
.notification {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
}

.notification.unread {
    border-left: 3px solid var(--primary-color);
}

.notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.notification-content {
    flex: 1;
    font-size: 14px;
}

.notification-time {
    font-size: 12px;
    color: var(--secondary-color);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 100;
}

.nav-item {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 20px;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.nav-item.active {
    opacity: 1;
}

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    color: var(--secondary-color);
}

/* Erro */
.error {
    background: #fee;
    color: var(--danger-color);
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
    font-size: 14px;
}

/* Sucesso */
.success {
    background: #efe;
    color: var(--success-color);
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
    font-size: 14px;
}

/* Responsivo */
@media (max-width: 480px) {
    .container {
        margin: 20px auto;
        padding: 10px;
    }
    
    .auth-form {
        padding: 20px;
    }
    
    .content {
        padding: 10px;
    }
}

