/* =====================================================
   WhatsApp Business AI Assistant - Main Stylesheet
   ===================================================== */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    
    --whatsapp-color: #25D366;
    --whatsapp-dark: #128C7E;
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* =====================================================
   Global Styles
   ===================================================== */

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

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f4f7fc;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

a:hover {
    color: #0a58ca;
}

/* =====================================================
   Typography
   ===================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-weight: 700;
}

/* =====================================================
   Layout
   ===================================================== */

.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

.main-content {
    width: 100%;
    padding: 20px;
    min-height: 100vh;
    transition: all 0.3s;
    background-color: #f4f7fc;
}

/* =====================================================
   Sidebar
   ===================================================== */

.sidebar {
    min-width: 280px;
    max-width: 280px;
    background: linear-gradient(180deg, #1a2634 0%, #0d1b2a 100%);
    color: #fff;
    transition: all 0.3s;
    position: relative;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar.active {
    margin-left: -280px;
}

.sidebar .sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .sidebar-header h3 {
    color: #fff;
    margin-bottom: 0;
    font-size: 1.5rem;
}

.sidebar .sidebar-menu {
    padding: 20px 0;
}

.sidebar .nav-item {
    margin-bottom: 5px;
}

.sidebar .nav-link {
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    border-left: 3px solid transparent;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.sidebar .nav-link i {
    margin-right: 10px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
    border-left-color: var(--primary-color);
}

.sidebar .nav-link.active {
    color: #fff;
    background: rgba(13, 110, 253, 0.2);
    border-left-color: var(--primary-color);
}

.sidebar .nav-link.active i {
    color: var(--primary-color);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: absolute;
    bottom: 0;
    width: 100%;
}

/* =====================================================
   Cards
   ===================================================== */

.card {
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* =====================================================
   Buttons
   ===================================================== */

.btn {
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}

.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.2);
}

.btn-whatsapp {
    background: var(--whatsapp-color);
    border-color: var(--whatsapp-color);
    color: #fff;
}

.btn-whatsapp:hover {
    background: var(--whatsapp-dark);
    border-color: var(--whatsapp-dark);
    color: #fff;
    transform: translateY(-2px);
}

/* =====================================================
   Forms
   ===================================================== */

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    padding: 0.6rem 1rem;
    transition: all 0.3s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.input-group-text {
    border-radius: 8px;
    background: #f8f9fa;
    border-color: #e0e0e0;
}

/* =====================================================
   Tables
   ===================================================== */

.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: #495057;
    border-bottom-width: 1px;
    padding: 1rem;
    background: #f8f9fa;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.02);
}

/* =====================================================
   Badges
   ===================================================== */

.badge {
    padding: 0.5em 0.8em;
    font-weight: 500;
    border-radius: 6px;
}

.badge.bg-success {
    background: rgba(25, 135, 84, 0.1) !important;
    color: #198754;
}

.badge.bg-warning {
    background: rgba(255, 193, 7, 0.1) !important;
    color: #ffc107;
}

.badge.bg-danger {
    background: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545;
}

.badge.bg-info {
    background: rgba(13, 202, 240, 0.1) !important;
    color: #0dcaf0;
}

.badge.bg-primary {
    background: rgba(13, 110, 253, 0.1) !important;
    color: #0d6efd;
}

/* =====================================================
   Progress Bars
   ===================================================== */

.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.progress-bar {
    background-color: var(--primary-color);
    border-radius: 4px;
}

/* =====================================================
   Animations
   ===================================================== */

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

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

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* =====================================================
   Hero Section
   ===================================================== */

.hero-section {
    padding: 100px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.hero-section .lead {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* =====================================================
   Features Section
   ===================================================== */

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin-bottom: 1rem;
}

.hover-card {
    transition: all 0.3s;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
}

/* =====================================================
   Pricing Cards
   ===================================================== */

.pricing-card {
    border: none;
    border-radius: 20px;
    transition: all 0.3s;
    overflow: hidden;
}

.pricing-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1) !important;
}

.pricing-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 2rem;
    border: none;
}

.pricing-card .price {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.pricing-card .price-period {
    opacity: 0.8;
    font-size: 0.9rem;
}

.pricing-card .feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pricing-card .feature-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.pricing-card .feature-list li:last-child {
    border-bottom: none;
}

/* =====================================================
   Chat Interface
   ===================================================== */

.chat-wrapper {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.chat-sidebar {
    background: #fff;
    border-right: 1px solid #e0e0e0;
}

.conversation-item {
    cursor: pointer;
    transition: all 0.2s;
}

.conversation-item:hover {
    background: #f8f9fa;
}

.conversation-item.active {
    background: #e3f2fd;
    border-left: 3px solid var(--primary-color);
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    animation: fadeIn 0.3s;
}

.message-incoming {
    background: #f1f3f5;
    border-bottom-left-radius: 5px;
}

.message-outgoing {
    background: var(--primary-color);
    color: #fff;
    border-bottom-right-radius: 5px;
}

.message-time {
    font-size: 11px;
    margin-top: 5px;
    opacity: 0.7;
}

.message-outgoing .message-time {
    color: rgba(255,255,255,0.9);
}

.unread-badge {
    background: var(--danger-color);
    color: #fff;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 11px;
    min-width: 20px;
    text-align: center;
}

.typing-indicator {
    background: #e9ecef;
    padding: 8px 12px;
    border-radius: 18px;
    display: inline-block;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #adb5bd;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* =====================================================
   Responsive Design
   ===================================================== */

@media (max-width: 768px) {
    .sidebar {
        margin-left: -280px;
    }
    
    .sidebar.active {
        margin-left: 0;
    }
    
    .main-content {
        width: 100%;
        padding: 15px;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .chat-sidebar {
        display: none;
    }
    
    .chat-main {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table td, .table th {
        padding: 0.75rem;
    }
}

/* =====================================================
   Utilities
   ===================================================== */

.bg-soft-primary {
    background-color: rgba(13, 110, 253, 0.1);
}

.bg-soft-success {
    background-color: rgba(25, 135, 84, 0.1);
}

.bg-soft-danger {
    background-color: rgba(220, 53, 69, 0.1);
}

.bg-soft-warning {
    background-color: rgba(255, 193, 7, 0.1);
}

.bg-soft-info {
    background-color: rgba(13, 202, 240, 0.1);
}

.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    /* -webkit-background-clip: text; */
    -webkit-text-fill-color: transparent;
}

.min-width-0 {
    min-width: 0;
}

.cursor-pointer {
    cursor: pointer;
}

.z-index-1 {
    z-index: 1;
}

.z-index-10 {
    z-index: 10;
}

/* =====================================================
   Print Styles
   ===================================================== */

@media print {
    .sidebar,
    .chat-footer,
    .btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* =====================================================
   Dark Mode Support
   ===================================================== */

@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #f8f9fa;
    }
    
    .card {
        background-color: #2d2d2d;
        border-color: #404040;
    }
    
    .card-header {
        border-bottom-color: #404040;
    }
    
    .table {
        color: #f8f9fa;
    }
    
    .table th {
        background-color: #2d2d2d;
        color: #f8f9fa;
        border-bottom-color: #404040;
    }
    
    .table td {
        border-top-color: #404040;
    }
    
    .table-hover tbody tr:hover {
        background-color: #363636;
        color: #f8f9fa;
    }
    
    .form-control,
    .form-select {
        background-color: #363636;
        border-color: #404040;
        color: #f8f9fa;
    }
    
    .form-control:focus,
    .form-select:focus {
        background-color: #404040;
        color: #f8f9fa;
    }
    
    .input-group-text {
        background-color: #404040;
        border-color: #4d4d4d;
        color: #f8f9fa;
    }
}