/* Main Styles for WhatsApp Bulk Portal */

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    background-color: #f5f7fb;
    color: #333;
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.logo-container {
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.logo img {
    max-width: 150px;
    transition: filter 0.3s ease;
}

.logo:hover img {
    filter: brightness(0) invert(1); /* Changes yellow to white on hover */
}

.nav-menu ul {
    list-style: none;
}

.nav-menu ul li {
    padding: 10px 20px;
    margin: 5px 0;
    position: relative;
}

.nav-menu ul li.spacer {
    height: 20px;
    opacity: 0;
    pointer-events: none;
}

.nav-menu ul li a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.nav-menu ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.nav-menu ul li.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-left: 4px solid white;
}

.nav-menu .dropdown .fa-chevron-down {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.nav-menu .dropdown.open .fa-chevron-down {
    transform: rotate(180deg);
}

.submenu {
    display: none;
    padding-left: 30px;
    margin-top: 10px;
}

.submenu li {
    padding: 8px 0;
}

.dropdown.open .submenu {
    display: block;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 20px;
}

header {
    background-color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-weight: 600;
    color: #333;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Dashboard Content Styles */
.dashboard-content {
    display: grid;
    gap: 20px;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stat-card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background-color: rgba(37, 211, 102, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.stat-icon i {
    font-size: 24px;
    color: #25d366;
}

.stat-info h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.stat-info p {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

/* WhatsApp Section Styles */
.whatsapp-section {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.view-all {
    color: #25d366;
    text-decoration: none;
    font-weight: 500;
}

.whatsapp-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.whatsapp-status {
    display: flex;
    align-items: center;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
}

.status-indicator.connected {
    background-color: #25d366;
}

.status-indicator.not-connected {
    background-color: #ff5252;
}

.btn {
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn {
    background-color: #25d366;
    color: white;
}

.primary-btn:hover {
    background-color: #128c7e;
}

.close-btn {
    background-color: transparent;
    color: #666;
    padding: 5px;
}

.whatsapp-frame {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.frame-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.whatsapp-frame iframe {
    width: 100%;
    height: 500px;
    border: none;
}

/* Recent Campaigns Styles */
.recent-campaigns {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.campaigns-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table th {
    font-weight: 600;
    color: #666;
    background-color: #f9f9f9;
}

.status {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status.completed {
    background-color: rgba(37, 211, 102, 0.1);
    color: #25d366;
}

.status.failed {
    background-color: rgba(255, 82, 82, 0.1);
    color: #ff5252;
}

.status.pending {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.action-btn {
    color: #25d366;
    text-decoration: none;
    font-weight: 500;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 20px;
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#qr-code {
    width: 200px;
    height: 200px;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .sidebar {
        width: 220px;
    }
    .main-content {
        margin-left: 220px;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .main-content {
        margin-left: 0;
    }
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .user-profile {
        width: 100%;
        justify-content: space-between;
    }
}