/* Estilos para el Módulo de Phishing Email */

/* Ventana de Email Principal */
.email-window {
    position: fixed;
    top: 3%;
    left: 8%;
    width: 84%;
    height: 90%;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 8px 32px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 1000;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Roboto, Arial, sans-serif;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.email-window.show {
    display: flex;
    flex-direction: column;
}

/* Header del Email */
.email-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.email-app-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 18px;
}

.email-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.email-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Layout principal */
.email-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.email-sidebar {
    width: 250px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-right: 1px solid #e2e8f0;
    padding: 20px 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.05);
}

.email-folders {
    padding: 0 16px;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    color: #475569;
}

.folder-item:hover {
    background: rgba(255, 255, 255, 0.7);
    color: #1e293b;
    transform: translateX(2px);
}

.folder-item.active {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.folder-count {
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    margin-left: auto;
}

/* Lista de Emails */
.email-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.email-toolbar {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    align-items: center;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.email-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.email-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.email-btn.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.email-btn.danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.email-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    background: #fafbfc;
}

/* Items de Email */
.email-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin: 6px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
}

.email-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.email-item.high {
    border-left: 5px solid #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

.email-item.high::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.email-item-content {
    padding: 20px;
}

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

.email-from {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
}

.email-address {
    color: #6b7280;
    font-size: 13px;
    font-weight: 400;
    margin-left: 8px;
}

.phishing-indicator {
    color: #ef4444;
    font-size: 18px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.email-time {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 6px;
}

.email-subject {
    font-weight: 700;
    color: #111827;
    margin: 12px 0 8px 0;
    font-size: 16px;
    line-height: 1.3;
}

.email-preview {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 8px;
}

/* Visor de Email */
.email-viewer {
    display: none;
    flex-direction: column;
    height: 100%;
}

.email-viewer-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.viewer-back-btn {
    background: linear-gradient(135deg, #64748b, #475569);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(100, 116, 139, 0.2);
}

.viewer-back-btn:hover {
    background: linear-gradient(135deg, #475569, #334155);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.viewer-from {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.viewer-from-name {
    font-weight: 600;
    color: #1e293b;
}

.viewer-from-email {
    color: #64748b;
    font-size: 14px;
}

.viewer-subject {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 8px 0 4px 0;
}

.viewer-time {
    font-size: 12px;
    color: #64748b;
}

.email-content-body {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    line-height: 1.6;
    font-size: 15px;
}

/* Panel de Análisis de Phishing */
.phishing-analysis {
    background: linear-gradient(135deg, #fef2f2 0%, #fef7f7 100%);
    border: 1px solid #fca5a5;
    border-radius: 12px;
    padding: 24px;
    margin: 24px;
    display: none;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
}

.analysis-title {
    color: #dc2626;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.red-flags-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.red-flags-list li {
    color: #dc2626;
    margin-bottom: 8px;
    font-size: 14px;
}

.analysis-tip {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    padding: 12px;
    margin-top: 12px;
    font-size: 14px;
    color: #9a3412;
}

/* Responsivo */
@media (max-width: 1024px) {
    .email-window {
        top: 2%;
        left: 2%;
        width: 96%;
        height: 96%;
    }
    
    .email-sidebar {
        width: 160px;
    }
    
    .email-main {
        flex-direction: column;
    }
    
    .email-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
}

/* Estilos adicionales para mejorar la apariencia */
.email-item.unread {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid #0ea5e9;
}

.email-item.unread .email-subject {
    font-weight: 800;
}

.folder-item .folder-icon {
    font-size: 16px;
    opacity: 0.8;
}

.folder-item.active .folder-icon {
    opacity: 1;
}

/* Animaciones suaves */
.email-item {
    animation: slideIn 0.3s ease-out;
}

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

/* Scroll personalizado */
.email-list::-webkit-scrollbar {
    width: 6px;
}

.email-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.email-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #cbd5e1, #94a3b8);
    border-radius: 3px;
}

.email-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #94a3b8, #64748b);
}