@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ===== VARIÁVEIS ===== */
:root {
    --primary: #212529;
    --primary-dark: #1a1d20;
    --secondary: #495057;
    --success: #28a745;
    --danger: #dc3545;
    --bg-light: #fafafa;
    --bg-white: #ffffff;
    --text-primary: #262626;
    --text-secondary: #8e8e8e;
    --text-light: #adb5bd;
    --border: #dbdbdb;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ===== RESET ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ===== UTILITÁRIOS ===== */
.hidden {
    display: none !important;
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

.no-scroll {
    overflow: hidden;
}

/* ===== LOADING ===== */
.initial-loading {
    position: fixed;
    inset: 0;
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 9999;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ===== AUTH SCREEN ===== */
.auth-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.auth-header img {
    width: 180px;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

.auth-header h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    font-size: 14px;
    opacity: 0.9;
}

.auth-form {
    background: var(--bg-white);
    padding: 32px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 380px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: var(--bg-light);
}

.form-group input:focus {
    outline: none;
    border-color: var(--text-secondary);
    background: var(--bg-white);
}

.input-hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}

.auth-error {
    margin-top: 16px;
    padding: 12px;
    background: #fee;
    color: #c00;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
}

/* ===== BUTTONS ===== */
.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ===== PAINEL PRINCIPAL ===== */
.approval-panel {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-light);
}

/* ===== HEADER - PRETO ===== */
.panel-header {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
}

.panel-header img {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
}

.header-content h1 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-usernames {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 2px;
}

/* ===== TABS - PRETO ===== */
.tabs-nav {
    display: flex;
    background: var(--primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs-nav::-webkit-scrollbar {
    display: none;
}

.tab-item {
    flex: 1;
    min-width: 70px;
    padding: 12px 8px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.tab-item i {
    font-size: 20px;
}

.tab-item:hover {
    color: rgba(255, 255, 255, 0.9);
}

.tab-item.active {
    color: white;
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: white;
}

#btn-logout {
    color: #ff4444;
}

#btn-logout:hover {
    color: #ff6666;
}

/* ===== CONTENT ===== */
.tab-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
}

/* ===== GRID INSTAGRAM STYLE ===== */
.posts-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5px;
    padding: 0;
}

/* ===== POST ITEM (THUMBNAIL) ===== */
.post-item {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    cursor: pointer;
    background: #f0f0f0;
}

.post-item-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.post-item:active .post-item-overlay {
    opacity: 1;
}

.post-type-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    z-index: 2;
    font-size: 16px;
}

.post-type-badge i {
    font-size: 16px;
    color: white;
}

.post-carousel-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    color: white;
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
    z-index: 2;
}

/* ===== MODAL DE VISUALIZAÇÃO (ESTILO INSTAGRAM) ===== */
.post-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
    padding: 0;
    scrollbar-width: none;
}

.post-modal::-webkit-scrollbar {
    display: none;
}

.post-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
}

.post-modal-content {
    position: relative;
    width: 100%;
    min-height: 100vh;
    max-width: 100vw;
    background: #000;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.post-modal-close {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    backdrop-filter: blur(8px);
    transition: background 0.2s;
}

.post-modal-close:hover {
    background: rgba(0, 0, 0, 0.95);
}

.post-modal-close i {
    font-size: 24px;
}

/* ===== HEADER DO POST NO MODAL ===== */
.post-modal-header {
    padding: 14px 16px;
    background: #000;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #262626;
    flex-shrink: 0;
}

.client-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.client-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #262626;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.client-info {
    flex: 1;
}

.client-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.post-date {
    font-size: 12px;
    color: #a8a8a8;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== MEDIA NO MODAL ===== */
.post-modal-media {
    position: relative;
    width: 100%;
    background: #000;
    display: block;
    overflow: hidden;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.media-image,
.media-video {
    width: 100%;
    height: auto;
    max-width: 500px;
    object-fit: contain;
    background: #000;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}

/* Esconder controles nativos do vídeo */
.media-video::-webkit-media-controls {
    display: none !important;
}

.media-video::-webkit-media-controls-enclosure {
    display: none !important;
}

.media-video::-webkit-media-controls-panel {
    display: none !important;
}

.media-video::-webkit-media-controls-play-button {
    display: none !important;
}

.media-video::-webkit-media-controls-start-playback-button {
    display: none !important;
}

/* Barra de progresso do vídeo */
.video-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
    z-index: 10;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.video-progress-track {
    position: relative;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    overflow: visible;
}

.video-progress-buffer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    width: 0%;
    transition: width 0.3s ease;
}

.video-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: white;
    width: 0%;
    transition: width 0.05s linear;
}

.video-progress-thumb {
    position: absolute;
    top: 50%;
    right: -6px;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    transform: translateY(-50%) scale(0);
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.video-progress-container:hover .video-progress-thumb,
.video-progress-container.seeking .video-progress-thumb {
    transform: translateY(-50%) scale(1);
}

.video-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 5;
    pointer-events: none;
}

.video-play-overlay.show {
    pointer-events: all;
}

.video-play-overlay i {
    font-size: 72px;
    color: white;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8));
    opacity: 0;
    transition: opacity 0.2s;
}

.video-play-overlay.show i {
    opacity: 1;
}

/* ===== CAROUSEL NO MODAL ===== */
.carousel-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-track {
    display: flex;
    width: 100%;
    transition: transform 0.3s ease;
}

.carousel-item {
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 12px;
}

.carousel-next {
    right: 12px;
}

.carousel-indicators {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s;
    cursor: pointer;
}

.indicator.active {
    background: white;
}

/* ===== AÇÕES ESTILO INSTAGRAM ===== */
.post-modal-actions {
    padding: 16px;
    background: #000;
    border-top: 1px solid #262626;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.action-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 12px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
}

.action-btn:hover {
    opacity: 0.7;
    transform: scale(1.05);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn i {
    font-size: 28px;
}

.action-btn-reject {
    color: #ff4444;
    order: 1;
}

.action-btn-reject:hover {
    background: rgba(255, 68, 68, 0.15);
}

.action-btn-edit {
    color: #fff;
    order: 2;
}

.action-btn-edit:hover {
    background: rgba(255, 193, 7, 0.15);
}

.action-btn-download {
    color: white;
    order: 3;
}

.action-btn-download:hover {
    background: rgba(255, 255, 255, 0.15);
}

.action-btn-approve {
    color: #28a745;
    order: 4;
}

.action-btn-approve:hover {
    background: rgba(40, 167, 69, 0.15);
}

.action-btn-approve.liked {
    color: #ed4956;
    background: rgba(237, 73, 86, 0.15);
}

/* ===== CAPTION ===== */
.post-modal-caption {
    padding: 12px 16px;
    background: #000;
    border-top: 1px solid #262626;
    flex-shrink: 0;
}

.post-caption {
    font-size: 14px;
    line-height: 1.6;
    color: white;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.post-caption-empty {
    color: #a8a8a8;
    font-style: italic;
    font-size: 13px;
}

/* ===== EMPTY STATES ===== */
.empty-state,
.loading-container,
.error-container {
    padding: 60px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.empty-state i,
.error-container i {
    font-size: 64px;
    color: var(--text-secondary);
}

.empty-state h3,
.error-container h3 {
    font-size: 20px;
    font-weight: 600;
}

.empty-state p,
.error-container p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===== ANIMAÇÕES ===== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== SCROLLBAR ESCONDIDA (MAS FUNCIONAL) ===== */
.post-modal-caption {
    scrollbar-width: none;
}

.post-modal-caption::-webkit-scrollbar {
    display: none;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
    .posts-list {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }

    .panel-header {
        padding: 16px 24px;
    }

    .panel-header img {
        height: 36px;
    }

    .header-content h1 {
        font-size: 18px;
    }

    .tabs-nav {
        justify-content: center;
        gap: 8px;
    }

    .tab-item {
        flex: 0 0 auto;
        min-width: 100px;
        padding: 14px 20px;
        flex-direction: row;
    }

    .post-item:hover .post-item-overlay {
        opacity: 1;
    }

    .post-modal {
        align-items: center;
        padding: 20px;
    }

    .post-modal-content {
        min-height: auto;
        max-height: 95vh;
        max-width: 935px;
        flex-direction: row;
    }

    .post-modal-media {
        flex: 0 0 60%;
        max-height: 95vh;
    }
    
    .media-image,
    .media-video {
        max-height: 95vh;
    }

    .post-modal-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        background: #000;
        max-height: 95vh;
        overflow-y: auto;
        scrollbar-width: none;
    }

    .post-modal-body::-webkit-scrollbar {
        display: none;
    }

    .post-modal-header {
        border-bottom: 1px solid #262626;
        border-right: none;
    }

    .post-modal-caption {
        flex: 1;
        overflow-y: auto;
    }

    .post-modal-actions {
        border-top: 1px solid #262626;
        flex-direction: row;
        padding: 16px;
    }

    .action-btn {
        flex: 1;
        padding: 12px 16px;
    }
}

@media (min-width: 1024px) {
    .posts-list {
        gap: 6px;
        padding: 6px;
    }

    .post-item {
        transition: transform 0.2s;
    }

    .post-item:hover {
        transform: scale(1.02);
    }
}


/* ===== MODAL DE EDIÇÃO ===== */
.edit-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.edit-modal-overlay.active {
    opacity: 1;
}

.edit-modal {
    background: var(--bg-white);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.edit-modal-overlay.active .edit-modal {
    transform: scale(1);
}

.edit-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.edit-modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.edit-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-light);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.edit-modal-close:hover {
    background: var(--border);
}

.edit-modal-close i {
    font-size: 20px;
}

.edit-modal-form {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.edit-form-group {
    margin-bottom: 24px;
}

.edit-form-group:last-of-type {
    margin-bottom: 0;
}

.edit-form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.edit-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s;
}

.edit-form-group textarea:focus {
    outline: none;
    border-color: var(--text-secondary);
}

.edit-form-group input[type="datetime-local"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.edit-form-group input[type="datetime-local"]:focus {
    outline: none;
    border-color: var(--text-secondary);
}

.edit-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.edit-modal-actions {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.edit-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
}

.edit-btn-cancel {
    background: var(--bg-light);
    color: var(--text-primary);
}

.edit-btn-cancel:hover {
    background: var(--border);
}

.edit-btn-save {
    background: var(--primary);
    color: white;
}

.edit-btn-save:hover {
    opacity: 0.9;
}

.edit-btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toast de sucesso */
.edit-success-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--success);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    transition: transform 0.3s ease;
}

.edit-success-toast.show {
    transform: translateX(-50%) translateY(0);
}

.edit-success-toast i {
    font-size: 20px;
}





