/* style.css - Layout profissional do sistema IBRAME RH IA */

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #071128;
    --bg-tertiary: #0a0f1e;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #3b82f6;
    --accent-secondary: #2563eb;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border-color: #1e293b;
    --card-bg: rgba(15, 23, 42, 0.8);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* Layout Principal */
.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(7, 17, 40, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    padding: 0 12px;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--success));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    text-align: left;
}

.nav-link:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(34, 197, 94, 0.1));
    color: var(--accent-primary);
    border-left: 3px solid var(--accent-primary);
}

.nav-icon {
    font-size: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: rgba(7, 17, 40, 0.6);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.header-title {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, var(--accent-primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.header-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.datetime {
    text-align: right;
}

.datetime-value {
    font-size: 18px;
    font-weight: 600;
    font-family: monospace;
}

.datetime-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-badge.pulsing {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
}

.screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-select {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:hover {
    border-color: var(--accent-primary);
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--success));
}

.summary-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.2);
}

.summary-card-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.summary-card-title {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.summary-card-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.summary-card-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

/* Chart Section */
.chart-section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.chart-container {
    height: 250px;
    position: relative;
}

/* Table Section */
.table-section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    padding: 12px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

tbody tr.highlighted {
    background: rgba(59, 130, 246, 0.1);
    animation: highlightFlash 0.5s ease;
}

@keyframes highlightFlash {
    0%, 100% { background: rgba(59, 130, 246, 0.1); }
    50% { background: rgba(59, 130, 246, 0.3); }
}

.status-badge-table {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.status-ok {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.status-exception {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.action-button {
    padding: 6px 12px;
    background: var(--accent-primary);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}

.action-button:hover {
    background: var(--accent-secondary);
    transform: scale(1.05);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-primary), var(--success));
}

.timeline-item {
    position: relative;
    padding: 16px 20px;
    margin-bottom: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition);
}

.timeline-item:hover {
    transform: translateX(8px);
    border-color: var(--accent-primary);
}

.timeline-item.highlighted {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--accent-primary);
}

.timeline-dot {
    position: absolute;
    left: -32px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.timeline-time {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: monospace;
    margin-bottom: 6px;
}

.timeline-text {
    font-size: 14px;
    color: var(--text-primary);
}

/* PDF Preview */
.pdf-preview {
    background: white;
    color: #1a1a1a;
    padding: 40px;
    border-radius: 16px;
    max-height: 600px;
    overflow-y: auto;
}

.pdf-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.pdf-company {
    font-size: 24px;
    font-weight: bold;
    color: #0f172a;
}

.pdf-title {
    font-size: 18px;
    margin-top: 8px;
    color: #475569;
}

.pdf-period {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.pdf-section {
    margin-bottom: 30px;
}

.pdf-section-title {
    font-size: 16px;
    font-weight: bold;
    color: #0f172a;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #cbd5e1;
}

.pdf-summary {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    line-height: 1.8;
}

.pdf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.pdf-table th {
    background: #f1f5f9;
    padding: 8px;
    text-align: left;
    border: 1px solid #cbd5e1;
}

.pdf-table td {
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
}

/* RPA Elements */
.rpa-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border: 2px solid white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    display: none;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
    transition: all 0.3s cubic-bezier(0.22, 0.9, 0.35, 1);
}

.rpa-cursor.active {
    display: block;
}

.rpa-cursor.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-5px, 0); }
    75% { transform: translate(5px, 0); }
}

.rpa-label {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10001;
    font-family: monospace;
}

.rpa-topbar {
    position: fixed;
    top: 80px;
    left: 300px;
    right: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 20px;
    display: none;
    align-items: center;
    gap: 20px;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.rpa-topbar.active {
    display: flex;
}

.rpa-top-info {
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 200px;
}

.rpa-progress-container {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.rpa-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--success));
    width: 0%;
    transition: width 0.3s ease;
}

.rpa-launch-count {
    font-size: 13px;
    color: var(--accent-primary);
    font-weight: 600;
}

/* Splash Screen */
.splash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 17, 40, 0.95);
    backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20000;
}

.splash-overlay.active {
    display: flex;
}

.splash-content {
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.splash-clock {
    font-size: 64px;
    font-family: monospace;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 20px;
}

.splash-message {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.splash-progress {
    width: 400px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 16px;
}

.splash-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--success));
    width: 0%;
    transition: width 3s linear;
}

.splash-period {
    font-size: 12px;
    color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 15000;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 20px;
    color: var(--text-primary);
    font-size: 13px;
    animation: slideInRight 0.3s ease;
    max-width: 350px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.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 slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Center Toast */
.center-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    z-index: 20000;
    display: none;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.center-toast.active {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.center-toast-content {
    text-align: center;
}

.center-toast-content p {
    margin-bottom: 20px;
    line-height: 1.6;
    white-space: pre-line;
}

.center-toast-close {
    padding: 8px 24px;
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.center-toast-close:hover {
    background: var(--accent-secondary);
    transform: scale(1.05);
}

/* RPA Button */
.rpa-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-primary), var(--success));
    border: none;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.rpa-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(59, 130, 246, 0.6);
}

.rpa-button.running {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    animation: buttonPulse 1s infinite;
}

@keyframes buttonPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(239, 68, 68, 0.8); }
}

/* Settings */
.settings-section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    max-width: 600px;
}

.settings-group {
    margin-bottom: 20px;
}

.settings-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.settings-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.settings-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.settings-actions {
    margin-top: 24px;
}

.button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.button.primary {
    background: var(--accent-primary);
    color: white;
}

.button.secondary {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
        padding: 20px 12px;
    }
    
    .logo-text,
    .nav-text {
        display: none;
    }
    
    .nav-link {
        justify-content: center;
    }
    
    .rpa-topbar {
        left: 100px;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .filters-bar {
        flex-direction: column;
    }
}