/* ========================================
   Hstgr DAM - Digital Asset Management
   Estilos principais
   ======================================== */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    --status-pending: #94a3b8;
    --status-in-review: #3b82f6;
    --status-changes: #f59e0b;
    --status-approved: #10b981;
    --status-exported: #8b5cf6;
    --status-rejected: #ef4444;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
}

/* ========================================
   Layout
   ======================================== */

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--gray-900);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-800);
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-nav {
    padding: 16px 12px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-400);
    padding: 0 12px;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--gray-300);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--gray-800);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-icon {
    width: 20px;
    height: 20px;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px;
}

/* ========================================
   Header
   ======================================== */

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* ========================================
   Cards
   ======================================== */

.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* ========================================
   Kanban Board
   ======================================== */

.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.kanban-column {
    flex: 0 0 300px;
    min-width: 300px;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    max-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
}

.kanban-column-title {
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban-column-count {
    background: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--gray-600);
}

.kanban-column-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.kanban-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kanban-card.dragging {
    opacity: 0.5;
}

.kanban-card-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.kanban-card-title {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.kanban-card-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-product {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-production {
    background: #fce7f3;
    color: #be185d;
}

.badge-comments {
    background: #fef3c7;
    color: #b45309;
}

/* ========================================
   Status Colors
   ======================================== */

.status-pending { color: var(--status-pending); }
.status-in-review { color: var(--status-in-review); }
.status-changes { color: var(--status-changes); }
.status-approved { color: var(--status-approved); }
.status-exported { color: var(--status-exported); }
.status-rejected { color: var(--status-rejected); }

/* ========================================
   Canvas & Image Review
   ======================================== */

.review-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 24px;
    height: calc(100vh - 140px);
}

.canvas-wrapper {
    background: var(--gray-900);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.review-canvas {
    position: relative;
    max-width: 100%;
    max-height: 100%;
}

.review-canvas img {
    max-width: 100%;
    max-height: calc(100vh - 180px);
    display: block;
    user-select: none;
}

/* Pins no canvas */
.pin {
    position: absolute;
    width: 28px;
    height: 28px;
    background: var(--danger);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    z-index: 10;
    transition: all 0.2s;
}

.pin:hover {
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 20;
}

.pin.resolved {
    background: var(--success);
}

.pin.active {
    background: var(--warning);
    transform: translate(-50%, -50%) scale(1.3);
}

/* Área de comentários */
.comments-panel {
    background: white;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.comments-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.comments-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.comments-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-200);
}

.comment-item {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.comment-item.resolved {
    opacity: 0.6;
}

.comment-item.has-pin {
    border-left: 3px solid var(--danger);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 600;
    font-size: 0.875rem;
}

.comment-time {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.comment-text {
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.5;
}

.comment-pin-indicator {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========================================
   Upload
   ======================================== */

.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}

.upload-zone.dragover {
    border-color: var(--primary);
    background: #eff6ff;
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--gray-400);
}

.upload-text {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--gray-400);
}

/* ========================================
   Forms
   ======================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--gray-700);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* ========================================
   Grid
   ======================================== */

.grid {
    display: grid;
    gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ========================================
   Media Grid
   ======================================== */

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.media-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.media-card:hover {
    box-shadow: var(--shadow-md);
}

.media-card-image {
    aspect-ratio: 4/3;
    overflow: hidden;
}

.media-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-card-body {
    padding: 16px;
}

.media-card-title {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ========================================
   Modal
   ======================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========================================
   Toast Notifications
   ======================================== */

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   Login
   ======================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
}

.login-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
}

.login-logo p {
    color: var(--gray-500);
    margin-top: 8px;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .review-container {
        grid-template-columns: 1fr;
    }
    
    .comments-panel {
        display: none;
    }
}

@media (max-width: 768px) {
    .kanban-board {
        flex-direction: column;
    }
    
    .kanban-column {
        flex: 0 0 auto;
        max-height: none;
    }
}

/* ========================================
   Utilities
   ======================================== */

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-center { text-align: center; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
