/* Custom Styles for WhatsApp Bulk Sender */

/* Import Google Fonts for better typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Custom Properties for consistent theming */
:root {
    --whatsapp-green: #25d366;
    --whatsapp-dark: #128c7e;
    --whatsapp-light: #dcf8c6;
    --primary-gradient: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    --secondary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.12);
    --shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Layout */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: #2d3748;
    overflow-x: hidden;
}

.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    position: relative;
}

/* Background patterns */
.main-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(37, 211, 102, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(18, 140, 126, 0.1) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* Login Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--primary-gradient);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    animation: float 20s infinite linear;
    z-index: -1;
}

@keyframes float {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-heavy);
    width: 100%;
    max-width: 420px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Navigation */
.navbar {
    backdrop-filter: blur(20px);
    background: rgba(37, 211, 102, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    font-size: 1.6rem;
    animation: pulse 2s infinite;
}

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

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    margin: 0 0.25rem;
    transition: var(--transition);
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 2px;
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-medium);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--primary-gradient);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-heavy);
}

.card:hover::before {
    left: 0;
}

/* Forms and Inputs */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    transition: all var(--transition-speed) ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 211, 102, 0.25);
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
}

.form-control:hover {
    border-color: rgba(37, 211, 102, 0.5);
}

.form-floating {
    position: relative;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    color: var(--primary-color);
}

.form-select {
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    transition: all var(--transition-speed) ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 211, 102, 0.25);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(37, 211, 102, 0.25);
}

.input-group {
    position: relative;
}

.input-group .form-control {
    border-right: none;
}

.input-group-text {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border-color);
    border-left: none;
    color: var(--text-color);
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-input-wrapper .btn {
    cursor: pointer;
}

/* Tables */
.table {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.table thead th {
    background: var(--primary-gradient);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody tr {
    transition: all var(--transition-speed) ease;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.1), rgba(129, 236, 236, 0.1));
    transform: scale(1.01);
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border: none;
}

.table-responsive {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

/* Progress Bars */
.progress {
    height: 8px;
    border-radius: 50px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.progress-bar {
    background: var(--primary-gradient);
    border-radius: 50px;
    transition: width var(--transition-speed) ease;
}

.progress-bar-striped {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% {
        background-position: 1rem 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* Modals */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-heavy);
    overflow: hidden;
}

.modal-header {
    background: var(--primary-gradient);
    color: white;
    border-bottom: none;
    padding: 1.5rem;
}

.modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    background: rgba(248, 249, 250, 0.8);
}

.btn-close {
    filter: invert(1);
    opacity: 0.8;
}

.btn-close:hover {
    opacity: 1;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.bg-primary {
    background: var(--primary-gradient) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, #198754, #20c997) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #dc3545, #e83e8c) !important;
}

/* Utility Classes */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-glass {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.shadow-custom {
    box-shadow: var(--shadow-heavy);
}

.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box, var(--primary-gradient) border-box;
}

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

.animate-slide-up {
    animation: slideUp 0.6s ease-out;
}

.animate-bounce-in {
    animation: bounceIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .container-fluid {
        padding: 0.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .form-control {
        padding: 0.6rem 0.8rem;
    }
}

@media (max-width: 576px) {
    .navbar-nav .nav-link {
        padding: 0.5rem 0;
        text-align: center;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    .btn-group-vertical .btn {
        margin-bottom: 0.5rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .alert {
        margin-bottom: 0.5rem;
        padding: 0.75rem;
    }
    
    .progress {
        height: 6px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .alert {
        display: none !important;
    }
    
    .container-fluid {
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

.card-header {
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.8);
}

.card-body {
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    transform: rotate(45deg) translateX(100px);
    transition: var(--transition);
}

.stat-card:hover::after {
    transform: rotate(45deg) translateX(-100px);
}

.stat-card .display-6 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.stat-card h5 {
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.stat-card h3 {
    font-weight: 700;
    font-size: 2rem;
}

/* Buttons */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.7rem 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
    box-shadow: var(--shadow-light);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: var(--transition);
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn:active {
    transform: translateY(0);
}

.btn-success {
    background: var(--primary-gradient);
    border: none;
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #128c7e 0%, #0d5d52 100%);
    color: white;
}

.btn-outline-success {
    color: var(--whatsapp-green);
    border: 2px solid var(--whatsapp-green);
    background: transparent;
}

.btn-outline-success:hover {
    background: var(--whatsapp-green);
    border-color: var(--whatsapp-green);
    color: white;
}

.btn-primary {
    background: var(--secondary-gradient);
    border: none;
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-warning {
    background: var(--warning-gradient);
    border: none;
    color: white;
}

.btn-info {
    background: var(--success-gradient);
    border: none;
    color: white;
}

/* Button sizes */
.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: 12px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* Icon buttons */
.btn i {
    font-size: 1.1em;
}

.btn-lg i {
    font-size: 1.5rem;
}

/* WhatsApp-like Colors */
.text-whatsapp {
    color: #25d366 !important;
}

.bg-whatsapp {
    background-color: #25d366 !important;
}

.text-whatsapp-dark {
    color: #128c7e !important;
}

.bg-whatsapp-dark {
    background-color: #128c7e !important;
}

/* Message Composer */
.message-composer {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.message-preview {
    background: #f0f2f5;
    border-radius: 10px;
    padding: 1rem;
    border-left: 4px solid #25d366;
}

/* Contact Selection */
.contact-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: white;
    transition: all 0.2s ease;
    cursor: pointer;
}

.contact-item:hover {
    border-color: #25d366;
    transform: translateX(2px);
}

.contact-item.selected {
    border-color: #25d366;
    background: #f0fff4;
}

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

.progress-bar {
    border-radius: 4px;
}

/* File Upload */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #25d366;
    background: #f0fff4;
}

.upload-area.dragover {
    border-color: #25d366;
    background: #f0fff4;
}

/* Tables */
.table th {
    font-weight: 600;
    color: #495057;
    border-top: none;
}

.table-hover tbody tr:hover {
    background-color: rgba(37, 211, 102, 0.05);
}

/* Badges */
.badge {
    font-size: 0.75em;
    font-weight: 500;
    border-radius: 6px;
}

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

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .main-content {
        margin-top: 56px;
        min-height: calc(100vh - 56px);
    }
    
    .login-card {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

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

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

/* Status Indicators */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-active { background-color: #28a745; }
.status-inactive { background-color: #dc3545; }
.status-pending { background-color: #ffc107; }

/* Message Status Icons */
.message-status {
    font-size: 0.875rem;
}

.message-status.sent { color: #6c757d; }
.message-status.delivered { color: #007bff; }
.message-status.read { color: #007bff; }
.message-status.failed { color: #dc3545; }

/* Wizard Steps */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.wizard-step {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 1rem 0.5rem;
}

.wizard-step::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e9ecef;
    z-index: 1;
}

.wizard-step:first-child::before {
    display: none;
}

.wizard-step .step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    position: relative;
    z-index: 2;
    font-weight: bold;
}

.wizard-step.active .step-number {
    background: #25d366;
    color: white;
}

.wizard-step.completed .step-number {
    background: #28a745;
    color: white;
}

.wizard-step.completed::before {
    background: #28a745;
}

/* Form Enhancements */
.form-control:focus {
    border-color: #25d366;
    box-shadow: 0 0 0 0.2rem rgba(37, 211, 102, 0.25);
}

.form-select:focus {
    border-color: #25d366;
    box-shadow: 0 0 0 0.2rem rgba(37, 211, 102, 0.25);
}

/* Utility Classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.user-select-none {
    user-select: none;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #2d3748;
        color: #e2e8f0;
    }
    
    .form-control {
        background-color: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .table {
        color: #e2e8f0;
    }
}