/* Custom CSS for WhatsApp CRM */

:root {
    --primary-color: #006f9b;
    --secondary-color: #fff0d6;
    --light-gray: #ebebeb;
    --white: #ffffff;
    --border-radius: 12px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Override Bootstrap primary color */
.btn-primary {
    background: #006F9B;
    background: linear-gradient(139deg, rgba(0, 111, 155, 1) 0%, rgba(0, 91, 128, 1) 54%, rgba(0, 70, 89, 1) 100%);
    border-color: var(--primary-color);
    transition: 0.3s;
}

.btn-primary:hover {
    background: #006F9B;
    background: linear-gradient(rgba(0, 91, 128, 1) 54%, rgba(0, 70, 89, 1) 100%), 99deg, rgba(0, 111, 155, 1) 0%;
    border-color: #005a7a;
}

.bg-primary {
    background: #006F9B;
    background: linear-gradient(139deg, rgba(0, 111, 155, 1) 0%, rgba(0, 91, 128, 1) 54%, rgba(0, 70, 89, 1) 100%);
}

.text-primary {
    color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Login background wrapper */
.login-main {
    min-height: 100vh;
    background: radial-gradient(1200px 600px at 10% 10%, #e9f2f9 0%, #f8fbff 50%, #ffffff 100%),
                linear-gradient(135deg, rgba(0,111,155,0.06) 0%, rgba(0,91,128,0.08) 100%);
}

.cursor-pointer {
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--white) 0%, var(--light-gray) 100%);
    min-height: 100vh;
}

.hero-content h1 {
    color: var(--primary-color);
}

.stat-item h3 {
    margin-bottom: 0.5rem;
}

/* Login/Register Section */
.login-section {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    min-height: 100vh;
}

.login-section .card {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.login-card {
    border: 1px solid rgba(0,0,0,0.06);
}
.login-card {
    border-radius: 16px;
    backdrop-filter: saturate(140%) blur(6px);
}
.login-card .input-group-text {
    background: #f4f7fb;
}
.login-card .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 111, 155, 0.15);
}
.login-card .btn.btn-primary.btn-lg,
.login-card .btn.btn-success.btn-lg {
    border-radius: 10px;
}

/* Login helpers */
.brand-logo img { width: 140px; height: auto; }
.helper-text { font-size: 0.875rem; color: #6c757d; }
.toggle-btn { border-color: #dee2e6; }
.toggle-btn:hover { background: #f8f9fa; }

/* Fade-in animation for cards */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn .35s ease; }

/* Inbox Styles */
.inbox-container {
    height: calc(100vh - 80px);
}

.conversations-header {
    position: sticky;
    top: 0;
    z-index: 10;
}

.conversation-item {
    transition: background-color 0.2s ease;
}

.conversation-item:hover {
    background-color: var(--light-gray);
}

.conversation-item.active {
    background-color: var(--secondary-color);
    border-left: 4px solid var(--primary-color);
}

.conversations-list {
    background-color: var(--white);
}

/* Chat Area */
.chat-header {
    border-bottom: 1px solid var(--light-gray);
    background-color: var(--white);
}

.messages-area {
    background-color: #f8f9fa;
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(255, 255, 255, 0.1) 10px,
            rgba(255, 255, 255, 0.1) 20px
        );
}

/* Ajuste Global */
li{
    list-style-type: none !important;
}

/* Message Bubbles */
.message-bubble {
    max-width: 400px;
    word-wrap: break-word;
    position:relative;
}

.message-bubble.inbound {
    margin-right: auto;
}

.message-bubble.inbound .message-content {
    background-color: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius) var(--border-radius) var(--border-radius) 4px;
    padding: 10px 15px 30px 15px;
    box-shadow: var(--shadow);
}

.message-text{
    width: 100%;
}

.message-bubble.outbound {
    margin-left: auto;
    position: relative;
}

.message-bubble.outbound .message-content {
    background-color: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius) var(--border-radius) var(--border-radius) 4px;
    padding: 10px 15px 35px 15px;
    box-shadow: var(--shadow);
}

.message-meta {
    font-size: 0.75rem;
    margin-top: 4px;
}

.message-status {
    font-size: 0.875rem;
}

/* Media in messages */
.message-media img {
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.message-media audio {
    max-width: 250px;
}

/* Message Input */
.message-input {
    background-color: var(--white);
    border-top: 1px solid var(--light-gray);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.message-input textarea {
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    resize: none;
}

.message-input textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 111, 155, 0.25);
}

.inbound .message-info{
    position: absolute;
    left: 15px;
    bottom: 10px;
    font-size: 13px;
}

.outbound .message-info{
    position: absolute;
    right: 15px;
    bottom: 10px;
    font-size: 13px;
}

/* File Upload */
.file-upload label {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

/* Feature Cards */
.feature-card .card {
    border-radius: var(--border-radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    background-color: rgba(0, 111, 155, 0.1);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Filter Buttons */
.filter-buttons .btn {
    border-radius: 20px;
    font-size: 0.875rem;
    padding: 4px 12px;
}

.filter-buttons .btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Badges */
.badge.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Search Input */
.input-group input[type="text"] {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.input-group .btn {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
}

/* Dropdown */
.dropdown-menu {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--light-gray);
}

.dropdown-item:hover {
    background-color: var(--light-gray);
}

/* Alerts */
.alert {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--shadow);
}

/* Responsive Design */
@media (max-width: 768px) {
    .inbox-container .row {
        height: auto;
    }

    .conversations-list {
        max-height: 300px;
    }

    .messages-area {
        height: 400px;
    }

    .message-bubble {
        max-width: 85%;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .feature-icon {
        width: 60px;
        height: 60px;
    }

    .stats-row .col-4 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .message-input .d-flex {
        flex-direction: column;
        gap: 10px;
    }

    .file-upload {
        align-self: flex-start;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .login-section .card-body {
        padding: 2rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bubble {
    animation: fadeIn 0.3s ease;
}

.conversation-item {
    animation: fadeIn 0.2s ease;
}

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

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Custom Scrollbar */
.conversations-list::-webkit-scrollbar,
.messages-area::-webkit-scrollbar {
    width: 6px;
}

.conversations-list::-webkit-scrollbar-track,
.messages-area::-webkit-scrollbar-track {
    background: var(--light-gray);
}

.conversations-list::-webkit-scrollbar-thumb,
.messages-area::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.conversations-list::-webkit-scrollbar-thumb:hover,
.messages-area::-webkit-scrollbar-thumb:hover {
    background: #005a7a;
}

/* AI Suggestions Styles */
.ai-suggestions {
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    border-top: 2px solid #e3f2fd;
    max-height: 200px;
    overflow-y: auto;
}

.ai-suggestions h6 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestion-card {
    background: white;
    border: 1px solid #e1e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.suggestion-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 2px 8px rgba(13,110,253,0.15);
    transform: translateY(-1px);
}

.suggestion-text {
    line-height: 1.4;
    color: #344767;
}

.suggestion-card .btn-outline-primary {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-width: 1px;
}

.suggestion-card .btn-outline-primary:hover {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.badge-sm {
    font-size: 0.65rem;
    padding: 0.25em 0.5em;
}

/* ========================================
   LEAD DETAILS PAGE - SOPHISTICATED DESIGN
   ======================================== */

/* Enhanced Header Design */
.lead-details-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    position: relative;
    overflow: hidden;
}

.lead-details-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><circle cx="30" cy="30" r="4"/></g></svg>') repeat;
    pointer-events: none;
}

.lead-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.lead-profile-avatar:hover {
    transform: scale(1.05);
}

.lead-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.lead-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.lead-back-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border-radius: 8px;
}

.lead-back-btn:hover {
    background: rgba(255,255,255,0.25);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Enhanced Card Design */
.lead-details-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    background: white;
    overflow: hidden;
    margin-bottom: 0.9rem;
}

.lead-details-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.lead-details-card .card-header {
    background: linear-gradient(135deg, #e9e9e9 0%, #fdfdfd 100%);
    border-bottom: 1px solid #ffffff;
    padding: 1.25rem 1.5rem;
    border-radius: 16px 16px 0 0 !important;
}

.lead-details-card .card-header h5 {
    font-weight: 600;
    color: #334155;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lead-details-card .card-body {
    padding: 1.5rem;
}

/* Enhanced Form Elements */
.enhanced-form-row {
    display: flex;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.enhanced-form-row:last-child {
    border-bottom: none;
}

.enhanced-form-label {
    font-weight: 600;
    color: #475569;
    min-width: 120px;
    margin-bottom: 0;
}

.enhanced-form-value {
    flex: 1;
    color: #64748b;
}

/* Status Badges Enhanced */
.status-badge-enhanced {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid transparent;
}

/* Enhanced Buttons */
.btn-enhanced {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-enhanced:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .lead-details-header {
        padding: 1.5rem;
        text-align: center;
    }

    .lead-title {
        font-size: 1.8rem;
    }

    .lead-profile-avatar {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }

    .enhanced-form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .enhanced-form-label {
        min-width: auto;
        font-size: 0.875rem;
    }

    .lead-details-card {
        margin-bottom: 1rem;
    }

    .lead-details-card .card-body {
        padding: 1rem;
    }
}

/* Smooth Animations */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

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

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