/**
 * Layout Principal - Rede SX
 * Estilos identicos ao Next.js (Tailwind)
 */

/* Container Principal */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #ffffff;
    color: #000000;
    overflow: hidden;
    font-family: var(--font-primary);
}

/* ========================================
   HEADER FIXO (identico ao Next.js)
   ======================================== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    z-index: 40;
    padding: 0 16px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
    max-width: 448px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-left a {
    display: flex;
    align-items: center;
}

.header-logo-img {
    height: 32px;
    width: auto;
}

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

.header-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #111827;
    transition: background-color 0.15s ease;
}

.header-btn:hover {
    background-color: #f3f4f6;
}

.header-btn svg {
    width: 24px;
    height: 24px;
}

/* Badge dot (vermelho para mensagens) */
.header-badge-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 9999px;
}

/* Badge dot roxo (para notificacoes) */
.header-badge-purple {
    background-color: #a855f7;
}

/* Badge com contador */
.header-badge-count {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    background-color: #a855f7;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
}

/* ========================================
   CONTEUDO PRINCIPAL
   ======================================== */
.app-content {
    margin-top: 56px;
    margin-bottom: 64px;
    min-height: calc(100vh - 56px - 64px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.content-container {
    max-width: 448px;
    margin: 0 auto;
    padding: 8px;
}

/* ========================================
   FOOTER FIXO (identico ao Next.js)
   ======================================== */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: #ffffff;
    border-top: 1px solid #e5e7eb;
    z-index: 40;
}

.footer-container {
    max-width: 448px;
    margin: 0 auto;
    padding: 8px;
    height: 100%;
}

.footer-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 100%;
}

.footer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #4b5563;
    transition: all 0.2s ease;
}

.footer-btn:hover {
    color: #1f2937;
    background-color: #f9fafb;
}

.footer-btn.active {
    color: #9333ea;
    background-color: #faf5ff;
}

.footer-btn svg {
    width: 24px;
    height: 24px;
}

/* Botao Criar (Central) */
.footer-create-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 16px;
    border-radius: 9999px;
    background: linear-gradient(to right, #a855f7, #ec4899);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.footer-create-btn:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(1.05);
}

.footer-create-btn:active {
    transform: scale(0.95);
}

.footer-create-btn svg {
    width: 28px;
    height: 28px;
    color: #ffffff;
}

/* Perfil com foto */
.footer-profile-btn {
    padding: 8px;
}

.footer-profile-photo {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.footer-profile-photo.active {
    box-shadow: 0 0 0 2px #9333ea;
}

.footer-profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.footer-profile-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom right, #c084fc, #f472b6);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   MODAL DE CRIAR
   ======================================== */
.create-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
}

.create-modal.hidden {
    display: none;
}

.create-modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.create-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 384px;
    padding: 24px;
    animation: scaleIn 0.2s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.create-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.create-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.create-modal-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.create-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
    transition: background-color 0.15s ease;
}

.create-modal-close:hover {
    background-color: #f3f4f6;
}

.create-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.create-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background-color 0.15s ease;
}

.create-option:hover {
    background: linear-gradient(to right, #faf5ff, #fdf2f8);
}

.create-option-icon {
    width: 56px;
    height: 56px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.15s ease;
}

.create-option:hover .create-option-icon {
    transform: scale(1.05);
}

.create-option-story {
    background: linear-gradient(to bottom right, #a855f7, #ec4899, #f97316);
}

.create-option-feed {
    background: linear-gradient(to bottom right, #3b82f6, #a855f7);
}

.create-option-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.create-option-label {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.create-option-desc {
    font-size: 14px;
    color: #6b7280;
}

.create-option-arrow {
    color: #9ca3af;
    transition: all 0.15s ease;
}

.create-option:hover .create-option-arrow {
    color: #a855f7;
    transform: translateX(4px);
}

.create-modal-hint {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 24px;
    margin-bottom: 0;
}

/* ========================================
   LAYOUTS ESPECIAIS
   ======================================== */

/* Auth Layout (sem header/footer) */
.auth-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: #f9fafb;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ========================================
   UTILITARIOS
   ======================================== */

/* Grid */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* Flex */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

/* Espacamentos */
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.p-sm { padding: 8px; }
.p-md { padding: 16px; }
.p-lg { padding: 24px; }

/* Textos */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-muted { color: #6b7280; }

/* Esconder */
.hidden { display: none !important; }

/* Mobile responsive */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (min-width: 769px) {
    .hide-desktop { display: none !important; }
}
