/* Enhanced Zoho Mail Agent Styles */

/* ===== LOADING STATES ===== */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--zoho-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== STEP INDICATOR ENHANCEMENTS ===== */
.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    position: relative;
}

.step {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    margin: 0 8px;
    background: white;
    border: 2px solid var(--zoho-border);
    border-radius: 25px;
    color: var(--zoho-gray);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.step.active {
    background: var(--zoho-blue);
    border-color: var(--zoho-blue);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.step.completed {
    background: var(--zoho-green);
    border-color: var(--zoho-green);
    color: white;
}

.step.completed::before {
    content: '✓';
    margin-right: 8px;
    font-weight: bold;
}

.step.pending {
    background: var(--zoho-bg);
    border-color: var(--zoho-border);
    color: var(--zoho-gray-light);
}

/* ===== CARD ENHANCEMENTS ===== */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--zoho-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--zoho-shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--zoho-blue) 0%, var(--zoho-blue-light) 100%);
    color: white;
    border: none;
    padding: 1.5rem;
}

.card-header h3 {
    margin: 0;
    font-weight: 600;
}

/* ===== UPLOAD AREA ENHANCEMENTS ===== */
.upload-area {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.upload-area:hover {
    border-color: var(--zoho-blue) !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(59, 130, 246, 0.1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(59, 130, 246, 0.2);
}

.upload-area.dragover {
    border-color: var(--zoho-blue) !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.15) 100%);
    transform: scale(1.02);
    box-shadow: 0 12px 30px -5px rgba(59, 130, 246, 0.3);
}

.upload-area i {
    transition: all 0.3s ease;
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.upload-area:hover i {
    transform: scale(1.1);
    color: var(--zoho-blue) !important;
}

.upload-area h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #475569;
}

.upload-area p {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
}

.upload-area .file-info {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.upload-area .file-info strong {
    color: var(--zoho-blue);
    font-weight: 600;
}

/* ===== BUTTON ENHANCEMENTS ===== */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.875rem 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
    font-size: 0.95rem;
    letter-spacing: 0.025em;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn i {
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--zoho-blue) 0%, var(--zoho-blue-light) 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3), 0 2px 4px -1px rgba(59, 130, 246, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.4), 0 4px 6px -1px rgba(59, 130, 246, 0.1);
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--zoho-green) 0%, var(--zoho-green-light) 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3), 0 2px 4px -1px rgba(16, 185, 129, 0.1);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.4), 0 4px 6px -1px rgba(16, 185, 129, 0.1);
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.btn-outline-primary {
    border: 2px solid var(--zoho-blue);
    color: var(--zoho-blue);
    background: transparent;
    box-shadow: 0 2px 4px -1px rgba(59, 130, 246, 0.1);
}

.btn-outline-primary:hover {
    background: var(--zoho-blue);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -3px rgba(59, 130, 246, 0.3);
}

.btn-outline-secondary {
    border: 2px solid #6b7280;
    color: #6b7280;
    background: transparent;
    box-shadow: 0 2px 4px -1px rgba(107, 114, 128, 0.1);
}

.btn-outline-secondary:hover {
    background: #6b7280;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -3px rgba(107, 114, 128, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3), 0 2px 4px -1px rgba(239, 68, 68, 0.1);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(239, 68, 68, 0.4), 0 4px 6px -1px rgba(239, 68, 68, 0.1);
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

/* Button Groups */
.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.btn-group-horizontal {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-group-horizontal .btn {
    flex: 1;
    min-width: 120px;
}

/* ===== FORM ENHANCEMENTS ===== */
.form-control {
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    padding: 0.875rem 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    background: #ffffff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.form-control:focus {
    border-color: var(--zoho-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    outline: none;
    background: #ffffff;
}

.form-control:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    letter-spacing: 0.025em;
}

.form-text {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* Alert styling */
.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

/* ===== DETAILS SECTIONS ===== */
.lead-details-section,
.user-details-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem;
}

.lead-details-section h6,
.user-details-section h6 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.lead-info,
.user-info {
    font-size: 0.8rem;
    color: #6b7280;
}

.lead-info strong,
.user-info strong {
    color: #374151;
    font-weight: 600;
}

/* ===== EMAIL PREVIEW ENHANCEMENTS ===== */
.email-preview-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.email-preview {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1.25rem;
    margin: 0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.email-preview:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.email-subject {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.email-body {
    line-height: 1.6;
    color: #4b5563;
    white-space: pre-wrap;
    font-size: 0.95rem;
}

/* ===== LEAD CARDS ===== */
.lead-card {
    background: white;
    border: 1px solid var(--zoho-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    transition: all 0.3s ease;
    position: relative;
}

.lead-card:hover {
    box-shadow: var(--zoho-shadow-lg);
    transform: translateY(-2px);
    border-color: var(--zoho-blue);
}

.lead-card.current {
    border-color: var(--zoho-blue);
    background: rgba(59, 130, 246, 0.05);
}

.lead-card.completed {
    border-color: var(--zoho-green);
    background: rgba(16, 185, 129, 0.05);
}

.lead-card.completed::after {
    content: '✓';
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--zoho-green);
    font-size: 1.5rem;
    font-weight: bold;
}

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

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* ===== PROGRESS BARS ===== */
.progress-container {
    background: var(--zoho-bg);
    border-radius: 25px;
    padding: 4px;
    margin: 1rem 0;
}

.progress-bar {
    height: 8px;
    background: linear-gradient(90deg, var(--zoho-blue) 0%, var(--zoho-blue-light) 100%);
    border-radius: 20px;
    transition: width 0.5s ease;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

.toast {
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: var(--zoho-shadow-lg);
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid var(--zoho-green);
}

.toast.error {
    border-left: 4px solid var(--zoho-orange);
}

.toast.info {
    border-left: 4px solid var(--zoho-blue);
}

/* ===== TWO COLUMN LAYOUT ===== */
.dashboard-layout {
    display: flex;
    gap: 2rem;
    min-height: 80vh;
    padding: 0;
    margin: 0;
}

.dashboard-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.dashboard-column .card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.dashboard-column .card-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
}

.dashboard-column .card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
}

.dashboard-column .card-header h3 i {
    font-size: 1rem;
    margin-right: 0.5rem;
    color: var(--zoho-blue);
}

.dashboard-column .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
}

.dashboard-column .card-footer {
    background: #f9fafb;
    border-top: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
    margin-top: auto;
}

/* ===== CONTENT ORGANIZATION ===== */
.section-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

.section-content {
    margin-bottom: 2rem;
}

.section-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/* Card content spacing */
.card-body > * + * {
    margin-top: 1.5rem;
}

.card-body > .btn-group-vertical {
    margin-top: 2rem;
}

/* Form spacing improvements */
.form-group + .form-group {
    margin-top: 1.5rem;
}

/* Alert improvements */
.alert + .alert {
    margin-top: 1rem;
}

/* Progress indicator improvements */
.progress-indicator {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* ===== RESPONSIVE IMPROVEMENTS ===== */
@media (max-width: 992px) {
    .dashboard-layout {
        flex-direction: column;
        gap: 1.5rem;
        min-height: auto;
    }
    
    .dashboard-column {
        flex: none;
    }
    
    .dashboard-column .card {
        height: auto;
    }
    
    .dashboard-column .card-body {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .step {
        padding: 8px 16px;
        margin: 0 4px;
        font-size: 0.9rem;
    }
    
    .card-header h3 {
        font-size: 1.25rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .email-preview {
        padding: 1rem;
    }
    
    .dashboard-layout {
        gap: 1rem;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --zoho-bg: #1f2937;
        --zoho-card-bg: #374151;
        --zoho-border: #4b5563;
        --zoho-gray-dark: #f9fafb;
    }
    
    body {
        background: var(--zoho-bg);
        color: var(--zoho-gray-dark);
    }
    
    .card {
        background: var(--zoho-card-bg);
        color: var(--zoho-gray-dark);
    }
    
    .lead-card {
        background: var(--zoho-card-bg);
        color: var(--zoho-gray-dark);
    }
}

/* ===== UTILITY CLASSES ===== */
.text-gradient {
    background: linear-gradient(135deg, var(--zoho-blue) 0%, var(--zoho-blue-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-soft {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(135deg, var(--zoho-blue) 0%, var(--zoho-blue-light) 100%) 1;
}

/* ===== LOADING SKELETONS ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-line {
    height: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.long { width: 100%; }
