/* Loading screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.loading-content {
    text-align: center;
    animation: fadeIn 0.5s ease-in;
}

.loading-content h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

.loading-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hide all content until fully loaded */
body:not(.app-loaded) .container {
    visibility: hidden !important;
    opacity: 0 !important;
}

body.app-loaded .container {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Estilos globales */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.section {
    margin-bottom: 30px;
}

.hidden {
    display: none;
}

h1 {
    color: #2c3e50;
}

h2 {
    margin-bottom: 15px;
    color: #3498db;
}

/* Botones */
.btn {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.btn:hover {
    background: #2980b9;
}

/* Lista de correos */
#email-list {
    list-style: none;
}

#email-list li {
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background 0.3s;
}

#email-list li:hover {
    background: #f9f9f9;
}

#email-list .email-subject {
    font-weight: bold;
}

#loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #7f8c8d;
}

.unread-email {
    font-weight: bold;
}

.unread-indicator {
    color: #1a73e8;
    margin-right: 5px;
}

.inbox-indicator {
    margin-right: 5px;
}

.email-label {
    background-color: #f1f3f4;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.8em;
    margin-right: 4px;
}

.email-labels {
    margin-top: 4px;
}

.email-status {
    display: inline-block;
    width: 30px;
}

/* ===== TABS AND NAVIGATION ===== */
.tabs {
    display: flex;
    border-bottom: 2px solid #e1e5e9;
    margin-bottom: 20px;
}

.tab-button {
    background: transparent;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #3498db;
    background-color: #f8f9fa;
}

.tab-button.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background-color: #fff;
}

/* ===== CONTENT CONTAINERS ===== */
.content-container {
    min-height: 400px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* ===== THREADS STYLES ===== */
.threads-list {
    list-style: none;
    padding: 0;
}

.thread-item {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.thread-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.thread-item.expanded {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.thread-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.thread-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.thread-icon {
    font-size: 16px;
    font-weight: bold;
    width: 20px;
    text-align: center;
}

.thread-icon.sent-icon {
    color: #28a745;
}

.thread-icon.received-icon {
    color: #3498db;
}

.thread-from {
    font-weight: 500;
    color: #2c3e50;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thread-date {
    font-size: 13px;
    color: #6c757d;
    min-width: 120px;
    text-align: right;
}

.thread-actions {
    display: flex;
    gap: 8px;
}

.thread-action {
    background: #f8f9fa;
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.thread-action.urgent,
.thread-action.action,
.thread-action.responder {
    background: #fff5f5;
    color: #e53e3e;
    border: 1px solid #fed7d7;
}

.thread-action.normal {
    background: #f0f8ff;
    color: #3182ce;
    border: 1px solid #bee3f8;
}

.thread-action.low,
.thread-action.informativo {
    background: #f0fff4;
    color: #38a169;
    border: 1px solid #c6f6d5;
}

.thread-content {
    margin-top: 12px;
}

.thread-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
    line-height: 1.3;
}

.thread-subtitle {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 8px;
    font-style: italic;
    line-height: 1.4;
}

.thread-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #6c757d;
}

.thread-categoria {
    font-weight: 500;
}

/* ===== STATUS INDICATOR (CIRCLE) ===== */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
    border: 2px solid transparent;
}

.status-green {
    background-color: #28a745;
    border-color: #1e7e34;
}

.status-red {
    background-color: #dc3545;
    border-color: #bd2130;
}

.status-orange {
    background-color: #fd7e14;
    border-color: #dc6502;
}

.status-gray {
    background-color: #6c757d;
    border-color: #545b62;
}

/* ===== STATUS LEGEND ===== */
.status-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

/* Category Filters */
.filters-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    gap: 15px;
}

.category-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background-color: white;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background-color: #e9ecef;
    border-color: #3498db;
}

.filter-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* Keyboard Shortcuts Help */
.shortcuts-help {
    background-color: #e3f2fd;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 10px;
    border-left: 4px solid #2196f3;
}

/* Thread Selection and Keyboard Navigation */
.thread-item {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.thread-item.selected {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.thread-item.keyboard-focused {
    outline: 2px solid #2196f3;
    outline-offset: -2px;
}

.thread-item:hover {
    background-color: #f5f5f5;
}

.thread-item.selected:hover {
    background-color: #e1f5fe;
}

/* Thread Selection Checkbox */
.thread-checkbox-container {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.thread-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.thread-content-wrapper {
    margin-left: 40px; /* Space for checkbox */
}

/* Automatizable Indicator */
.status-blue {
    background-color: #2196f3;
}

.automatizable-badge {
    display: inline-block;
    background-color: #2196f3;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 5px;
}

/* Agent Button */
.agent-button {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 8px;
    transition: background-color 0.2s ease;
}

.agent-button:hover {
    background-color: #45a049;
}

/* Archive Button for Threads */
.archive-thread-btn {
    background-color: #ff9800;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 8px;
    transition: background-color 0.2s ease;
}

.archive-thread-btn:hover {
    background-color: #f57c00;
}

/* Loading and Status Messages */
.loading-message {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    border: 1px solid #f5c6cb;
}

/* Temporary Message Container */
#temporary-message-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 5px;
    color: white;
    z-index: 10000; /* Ensure it's on top */
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: opacity 0.5s ease-in-out, bottom 0.5s ease-in-out;
}

#temporary-message-container.hidden {
    opacity: 0;
    bottom: -50px; /* Slide out downwards */
}

#temporary-message-container.success {
    background-color: #28a745; /* Green for success */
}

#temporary-message-container.error {
    background-color: #dc3545; /* Red for error */
}

/* Tooltip styles */
.thread-tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    max-width: 300px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tooltip-content p {
    margin: 4px 0 0 0;
    line-height: 1.4;
}

/* Notes icon styling */
.notes-icon {
    cursor: pointer;
    margin-right: 8px;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.notes-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.notes-icon.has-notes {
    color: #4caf50;
    opacity: 1;
}

/* Thread icons group */
.thread-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.thread-icons span {
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.thread-icons span:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Gmail icon */
.gmail-icon {
    color: #ea4335;
}

/* Summary icon */
.summary-icon {
    color: #4285f4;
}

/* Thread ID copy icon */
.thread-id-icon {
    color: #34a853;
}

/* Modal improvements */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background-color: #f5f5f5;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 4px;
}

.close-modal:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    background-color: #f5f5f5;
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Notes textarea */
#notes-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
}

#notes-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Modal help text */
.modal-help {
    margin-top: 8px;
    text-align: center;
    color: #666;
    font-size: 12px;
}

.modal-help strong {
    color: #333;
}

/* Success and error messages */
.success-message,
.error-message {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 500;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Configuration Icon */
.config-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    z-index: 1000;
}

.config-icon:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Move Folders Button */
.move-folders-btn {
    position: absolute;
    top: 20px;
    right: 70px;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    z-index: 1000;
}

.move-folders-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.move-folders-btn a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Configuration Panel */
.config-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.config-panel.open {
    right: 0;
}

.config-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f5f5f5;
}

.config-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-config {
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 4px;
}

.close-config:hover {
    color: #333;
}

.config-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.config-section {
    margin-bottom: 24px;
}

.config-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.config-textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    resize: vertical;
    background-color: #fafafa;
}

.config-textarea:focus {
    outline: none;
    border-color: #2196f3;
    background-color: white;
}

.config-textarea.unsaved {
    border-color: #ff9800;
    background-color: #fff8e1;
}

.config-help {
    margin-top: 8px;
    color: #666;
}

.config-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background-color: #f5f5f5;
}

.config-status {
    margin-bottom: 12px;
    min-height: 20px;
    font-size: 14px;
}

.config-status.success {
    color: #4caf50;
}

.config-status.error {
    color: #f44336;
}

.config-status.loading {
    color: #2196f3;
}

.config-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.config-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

/* Configuration Tabs */
.config-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f5f5f5;
}

.config-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.config-tab:hover {
    background-color: #e9ecef;
    color: #333;
}

.config-tab.active {
    background-color: white;
    color: #2196f3;
    border-bottom-color: #2196f3;
}

.config-tab-content {
    display: none;
}

.config-tab-content.active {
    display: block;
}

/* Agents Management */
.agents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.agents-header label {
    margin-bottom: 0;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.agents-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #fafafa;
}

.agent-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    background-color: white;
    margin-bottom: 1px;
}

.agent-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.agent-info {
    width: 100%;
}

.agent-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 16px;
}

.agent-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    word-wrap: break-word;
    margin-bottom: 8px;
}

.agent-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.agent-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.agent-badge.enabled {
    background-color: #d4edda;
    color: #155724;
}

.agent-badge.disabled {
    background-color: #f8d7da;
    color: #721c24;
}

.agent-badge.autorun {
    background-color: #d1ecf1;
    color: #0c5460;
}

.agent-badge.needfiles {
    background-color: #fff3cd;
    color: #856404;
}

.agent-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.agent-action {
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.agent-edit {
    background-color: #e3f2fd;
    color: #1976d2;
}

.agent-edit:hover {
    background-color: #bbdefb;
}

.agent-delete {
    background-color: #ffebee;
    color: #d32f2f;
}

.agent-delete:hover {
    background-color: #ffcdd2;
}

.agent-toggle {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.agent-toggle:hover {
    background-color: #e1bee7;
}

.agents-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Agent Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.form-textarea {
    resize: vertical;
    min-height: 60px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0;
}

.form-checkbox {
    margin-right: 8px;
    width: auto;
}

.checkbox-text {
    font-weight: 500;
}

.form-help {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 12px;
    line-height: 1.3;
}

/* Form validation */
.form-input.invalid,
.form-textarea.invalid {
    border-color: #f44336;
    background-color: #fff5f5;
}

.form-error {
    color: #f44336;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Modal adjustments for agent form */
.modal-content {
    max-width: 500px;
}

/* Authorization section styles */
.auth-section {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 16px;
    margin-top: 8px;
}

.auth-description {
    margin-bottom: 12px;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.reauth-status {
    margin-top: 12px;
    min-height: 20px;
    font-size: 14px;
}

.reauth-status.success {
    color: #4caf50;
}

.reauth-status.error {
    color: #f44336;
}

.reauth-status.loading {
    color: #2196f3;
}

#reauthorize-btn {
    background-color: #ff9800;
    color: white;
    border: none;
    font-weight: 500;
}

#reauthorize-btn:hover {
    background-color: #f57c00;
}

#reauthorize-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Responsive adjustments for agents */
@media (max-width: 768px) {
    .agent-item {
        padding: 12px;
    }
    
    .agent-name {
        font-size: 15px;
    }
    
    .agent-description {
        font-size: 13px;
    }
    
    .agent-actions {
        justify-content: space-between;
    }
    
    .agents-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .config-panel {
        width: 100vw;
        right: -100vw;
    }
    
    .config-icon {
        top: 10px;
        right: 10px;
        font-size: 20px;
    }
    
    /* Thread mobile optimizations */
    .thread-header {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .thread-info {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .thread-actions {
        flex-direction: column;
        gap: 6px;
        align-items: stretch;
    }
    
    .thread-icons {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .thread-icons span {
        font-size: 16px;
        padding: 6px;
        min-width: 32px;
        text-align: center;
    }
    
    .thread-action {
        align-self: flex-start;
        max-width: fit-content;
    }
    
    .automatizable-badge {
        align-self: flex-start;
        max-width: fit-content;
    }
    
    .agent-button {
        align-self: flex-start;
        max-width: fit-content;
    }
    
    /* Reduce font sizes for mobile */
    .thread-from {
        font-size: 12px;
    }
    
    .thread-date {
        font-size: 11px;
    }
    
    .thread-title {
        font-size: 14px;
        line-height: 1.3;
    }
    
    .thread-subtitle {
        font-size: 12px;
    }
    
    .thread-categoria {
        font-size: 11px;
    }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
    .container {
        padding: 10px;
        margin: 0;
        border-radius: 0;
    }
    
    .thread-item {
        padding: 12px 8px;
    }
    
    .thread-icons {
        gap: 8px;
    }
    
    .thread-icons span {
        font-size: 14px;
        padding: 4px;
        min-width: 28px;
    }
    
    .thread-from {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .thread-title {
        font-size: 13px;
        line-height: 1.2;
    }
    
    .thread-subtitle {
        font-size: 11px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .filters-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .category-filters {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    /* Adjust header buttons for mobile */
    .config-icon {
        top: 10px;
        right: 10px;
        font-size: 20px;
    }
    
    .move-folders-btn {
        top: 10px;
        right: 45px;
        font-size: 20px;
    }
}

/* Postpone Menu Styles */
.postpone-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    padding: 0;
    min-width: 250px;
    animation: fadeInScale 0.3s ease-out;
}

.postpone-content {
    padding: 20px;
    text-align: center;
}

.postpone-content h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

.postpone-content button {
    display: block;
    width: 100%;
    padding: 10px 15px;
    margin: 8px 0;
    border: none;
    border-radius: 5px;
    background: #f8f9fa;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.postpone-content button:hover {
    background: #667eea;
    color: white;
}

.postpone-content button:last-child {
    background: #dc3545;
    color: white;
    margin-top: 15px;
}

.postpone-content button:last-child:hover {
    background: #c82333;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Overlay for postpone menu */
.postpone-menu::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

/* App Footer Styles */
.app-footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.footer-content {
    text-align: center;
    color: #666;
    font-size: 14px;
}

.footer-content p {
    margin: 0 0 10px 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.footer-separator {
    color: #ccc;
    margin: 0 5px;
}

/* Responsive footer */
@media (max-width: 480px) {
    .footer-links {
        flex-direction: column;
        gap: 5px;
    }
    
    .footer-separator {
        display: none;
    }
    
    .app-footer {
        margin-top: 20px;
        padding: 15px 10px;
    }
    
    .footer-content {
        font-size: 12px;
    }
}

/* Auth Messages Styles */
.auth-message,
.auth-error {
    list-style: none;
    padding: 30px;
    margin: 20px 0;
    border-radius: 8px;
    text-align: center;
}

.auth-message {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #2196f3;
}

.auth-message.scope-update {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 1px solid #ff9800;
}

.auth-error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 1px solid #f44336;
}

.auth-content h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
}

.auth-content p {
    margin-bottom: 10px;
    color: #555;
    line-height: 1.6;
}

.auth-content .scopes-list {
    font-size: 0.85rem;
    color: #666;
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 12px;
    border-radius: 4px;
    margin: 10px 0;
    word-break: break-all;
}

.auth-content .btn {
    display: inline-block;
    padding: 12px 24px;
    margin: 10px 5px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.auth-content .btn-primary {
    background-color: #2196f3;
    color: white;
}

.auth-content .btn-primary:hover {
    background-color: #1976d2;
    transform: translateY(-1px);
}

.auth-content .btn-secondary {
    background-color: #9e9e9e;
    color: white;
}

.auth-content .btn-secondary:hover {
    background-color: #757575;
}

.auth-content .loading-spinner {
    margin: 20px auto;
}

/* Gmail Status Bar */
.gmail-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.gmail-status-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gmail-status-info .status-icon {
    font-size: 1.2rem;
}

.gmail-status-info .status-icon.connected {
    color: #28a745;
}

.gmail-status-info .status-icon.disconnected {
    color: #dc3545;
}

.gmail-status-info .status-icon.warning {
    color: #ffc107;
}

#gmail-status-text {
    font-weight: 500;
    color: #333;
}

.gmail-email {
    font-size: 0.9rem;
    color: #666;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
}

.gmail-status-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-warning {
    background-color: #ffc107;
    color: #333;
    border: none;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Responsive gmail status bar */
@media (max-width: 600px) {
    .gmail-status-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .gmail-status-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
