/* Responsive CSS for LexorAI Platform */
/* Base responsive styles for all pages */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* Estilos globais para placeholders - Melhorar contraste e legibilidade */
::placeholder {
    color: #6b7280 !important;
    font-weight: 500 !important;
    opacity: 1 !important;
}

:-ms-input-placeholder {
    color: #6b7280 !important;
    font-weight: 500 !important;
}

::-ms-input-placeholder {
    color: #6b7280 !important;
    font-weight: 500 !important;
}

/* Estilos específicos para inputs de busca */
input[placeholder*="Buscar"]::placeholder {
    color: #4b5563 !important;
    font-weight: 600 !important;
}

/* Melhorar visibilidade em temas escuros */
.dark input::placeholder,
.dark textarea::placeholder {
    color: #9ca3af !important;
    font-weight: 500 !important;
    opacity: 1 !important;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* Sidebar Responsive Logic */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed !important;
        left: 0;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-container {
        margin-left: 0 !important;
    }
}

@media (min-width: 1025px) {
    .sidebar {
        transform: translateX(0) !important;
    }
}

/* Card Grid Responsiveness */
.grid-standard {
    display: grid;
    gap: var(--gap, 16px);
}

@media (max-width: 640px) {
    .grid-standard {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 641px) and (max-width: 1280px) {
    .grid-standard {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (min-width: 1281px) {
    .grid-standard {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Table Responsiveness */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Form Responsiveness */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    .form-col {
        width: 100% !important;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .card-grid, .grid-cols-3, .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
}

@media (min-width: 1025px) {
    .card-grid, .grid-cols-4 {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2rem !important;
    }
}

/* Responsive Tables */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    table th,
    table td {
        padding: 0.5rem;
        white-space: nowrap;
    }
    
    .table-actions {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .table-actions button {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Responsive Forms */
@media (max-width: 640px) {
    .form-grid, .grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-actions button {
        width: 100%;
        padding: 0.75rem;
    }
}

/* Responsive Modals */
@media (max-width: 640px) {
    .modal, .fixed.inset-0 > div {
        padding: 1rem !important;
        max-width: 95vw !important;
        max-height: 95vh !important;
        margin: 1rem !important;
    }
    
    .modal-header {
        padding: 1rem 0 !important;
    }
    
    .modal-header h3 {
        font-size: 1.125rem !important;
    }
    
    .modal-body {
        padding: 1rem 0 !important;
    }
    
    .modal-footer {
        flex-direction: column !important;
        gap: 0.75rem !important;
        padding: 1rem 0 !important;
    }
    
    .modal-footer button {
        width: 100%;
        padding: 0.75rem;
    }
}

/* Responsive Tabs */
@media (max-width: 640px) {
    .tabs-container, .flex.space-x-1 {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .tab-button, .tab-button button {
        width: 100% !important;
        padding: 0.75rem !important;
        text-align: center !important;
        font-size: 0.875rem !important;
    }
    
    .tab-content {
        padding: 1rem !important;
    }
}

/* Responsive User Cards */
@media (max-width: 640px) {
    .user-card, .flex.items-center.space-x-3.p-4 {
        flex-direction: column !important;
        text-align: center !important;
        padding: 1rem !important;
    }
    
    .user-avatar, .w-8.h-8, .w-10.h-10, .w-12.h-12 {
        margin: 0 auto 1rem auto !important;
    }
    
    .user-info {
        margin-bottom: 1rem !important;
    }
    
    .user-actions, .flex.space-x-2 {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .user-actions button {
        width: 100%;
        padding: 0.5rem;
    }
}

/* Responsive Dashboard Stats */
@media (max-width: 640px) {
    .stats-grid, .grid-cols-4 {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
    }
    
    .stat-card {
        padding: 0.75rem !important;
        text-align: center;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem !important;
    }
    
    .stat-card .stat-label {
        font-size: 0.75rem !important;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .stats-grid, .grid-cols-4 {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 1rem !important;
    }
}

/* Responsive Charts */
@media (max-width: 640px) {
    .chart-container {
        height: 200px !important;
    }
    
    .chart-legend {
        font-size: 0.75rem !important;
    }
}

/* Responsive Notifications */
@media (max-width: 640px) {
    .notification, .fixed.top-4.right-4 {
        width: 90vw !important;
        left: 5vw !important;
        right: 5vw !important;
        font-size: 0.875rem;
        padding: 0.75rem;
    }
}

/* Touch-friendly elements */
@media (max-width: 768px) {
    button, a, input, textarea, select {
        min-height: 44px;
    }
    
    .btn-sm, .px-3.py-1, .px-2.py-1 {
        min-height: 36px;
        padding: 0.5rem 1rem;
    }
}

/* Hide/Show for different screen sizes */
.mobile-only {
    display: none;
}

.tablet-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .tablet-only {
        display: block;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .mobile-menu-toggle,
    .btn,
    .modal,
    button {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 1rem !important;
    }
    
    .glass-effect,
    .glass-morphism {
        background: white !important;
        box-shadow: none !important;
    }
}

/* Responsive containers */
@media (max-width: 640px) {
    .container, .max-w-7xl, .max-w-6xl, .max-w-5xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Responsive spacing */
@media (max-width: 640px) {
    .py-8, .py-12, .py-16 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .px-8, .px-12, .px-16 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .my-8, .my-12, .my-16 {
        margin-top: 2rem !important;
        margin-bottom: 2rem !important;
    }
    
    .mx-8, .mx-12, .mx-16 {
        margin-left: 1rem !important;
        margin-right: 1rem !important;
    }
}

/* Responsive text alignment */
@media (max-width: 640px) {
    .text-left,
    .text-right,
    .text-center {
        text-align: center !important;
    }
    
    .text-left.mobile-left {
        text-align: left !important;
    }
}

/* Responsive flex layouts */
@media (max-width: 640px) {
    .flex-row {
        flex-direction: column !important;
    }
    
    .flex-col.mobile-row {
        flex-direction: row !important;
    }
    
    .justify-between.mobile-center {
        justify-content: center !important;
    }
    
    .items-start.mobile-center {
        align-items: center !important;
    }
}

/* Responsive grid layouts */
@media (max-width: 640px) {
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4,
    .grid-cols-5,
    .grid-cols-6 {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .grid-cols-3,
    .grid-cols-4,
    .grid-cols-5,
    .grid-cols-6 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Responsive button groups */
@media (max-width: 640px) {
    .btn-group, .flex.space-x-2, .flex.space-x-3, .flex.space-x-4 {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .btn-group button,
    .flex.space-x-2 button,
    .flex.space-x-3 button,
    .flex.space-x-4 button {
        width: 100%;
    }
}

/* Responsive lists */
@media (max-width: 640px) {
    .list-group,
    .space-y-4,
    .space-y-3,
    .space-y-2 {
        gap: 0.5rem !important;
    }
    
    .list-item {
        padding: 0.75rem !important;
    }
}
