/* ============================================
   HELPSPYPROMPTS - GLOBAL STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --secondary: #1f2937;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --error: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.login-box {
    background: white;
    padding: 48px 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.logo-container {
    margin-bottom: 24px;
}

.logo {
    max-width: 120px;
    height: auto;
}

.login-box h1 {
    color: #1f2937;
    font-size: 28px;
    margin-bottom: 8px;
}

.subtitle {
    color: #6b7280;
    margin-bottom: 32px;
    font-size: 14px;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.login-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    color: #374151;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: white;
    color: #1f2937;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    background: var(--bg-dark) !important;
    color: var(--text-primary) !important;
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group select option {
    background: var(--bg-dark);
    color: var(--text-primary);
    padding: 10px;
}

.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.info-text {
    color: #6b7280;
    font-size: 13px;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    width: 48px;
    height: auto;
}

.brand-info h1 {
    font-size: 24px;
    margin: 0;
}

.highlight {
    color: var(--primary);
}

.tagline {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

.nav-link:hover {
    background: var(--primary-hover);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-email {
    font-size: 14px;
    color: var(--text-secondary);
}

.btn-logout {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-logout:hover {
    border-color: var(--error);
    color: var(--error);
}

/* ============================================
   STICKY FILTERS
   ============================================ */

.filter-sticky {
    position: sticky;
    top: 72px;
    z-index: 90;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    padding: 24px 0 32px;
}

.search-section {
    margin-bottom: 16px;
}

.search-box {
    position: relative;
    max-width: 600px;
}

.search-box svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============================================
   CATEGORIES FILTER
   ============================================ */

.categories-filter {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.category-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.category-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.category-icon {
    font-size: 16px;
}

/* ============================================
   PROMPTS GRID
   ============================================ */

.prompts-count {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 0;
}

.prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.prompt-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.prompt-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2);
}

.prompt-preview {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--secondary);
}

.prompt-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.prompt-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.video-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.prompt-card:hover .video-indicator {
    opacity: 0.8;
}

.prompt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.prompt-content {
    padding: 16px;
}

.prompt-title {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.prompt-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-action {
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-action:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    background: rgba(124, 58, 237, 0.1);
}

.btn-action.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-action.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-action.btn-edit {
    border-color: #f59e0b;
    color: #fbbf24;
}

.btn-action.btn-edit:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: #fbbf24;
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    overflow-y: auto;
    padding: 24px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Modal de Vídeo - Adaptado para vertical e horizontal */
.modal-video {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
}

.modal-video .modal-body {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border-radius: 0 0 12px 12px;
    max-height: 80vh;
    overflow: hidden;
}

.modal-video video {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 20px;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.btn-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.prompt-display {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.btn-copy {
    width: 100%;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-copy:hover {
    background: var(--primary-hover);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Ajuste para vídeos verticais */
@media (max-aspect-ratio: 9/16) {
    .modal-video {
        max-width: 50vw;
    }
}

@media (max-width: 968px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav {
        width: 100%;
        flex-direction: column;
    }
    
    .prompts-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .modal-video {
        max-width: 95vw;
    }
    
    .modal-video video {
        max-height: 70vh;
    }
}

@media (max-width: 640px) {
    .prompts-grid {
        grid-template-columns: 1fr;
    }
    
    .modal {
        padding: 12px;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}