@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400..800&display=swap');

* {
    font-family: "Poppins", sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    min-height: 100vh;
    font-family: "Poppins", sans-serif;
}

h2,
h3 {
    font-family: "Syne", sans-serif;
}

h2 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 700;
}

h3 {
    font-size: 18px;
    color: #25d366;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 600;
}

h4 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    padding: 12px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(37, 211, 102, 0.3);
    position: relative;
    z-index: 10;
}

header img {
    height: 35px;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

header img:hover {
    transform: scale(1.05);
}

/* Main Container */
.container {
    min-height: calc(100vh - 59px);
    display: flex;
    background: white;
}

/* Left Panel with Tabs */
.left {
    flex: 2;
    display: flex;
    flex-direction: column;
    background: white;
    min-height: calc(100vh - 59px);
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    padding: 0;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s ease;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    background: white;
    color: #25d366;
    border-bottom-color: #25d366;
}

.tab-btn:hover:not(.active) {
    background: #e9ecef;
    color: #495057;
}

/* Tab Content */
.tab-content {
    display: none;
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Right Panel */
.right {
    flex: 1;
    min-width: 350px;
    max-width: 400px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    border-left: 2px solid #e9ecef;
    padding: 25px;
    min-height: calc(100vh - 59px);
}

/* Form Styling */
form,
#groupExtractor,
#groupCreator {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

#groupExtractor,
#groupCreator {
    border-top: 3px solid #25d366;
    padding-top: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

/* Input Styling */
input,
select,
button,
textarea {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: "Poppins", sans-serif;
    transition: all 0.3s ease;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #25d366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
    font-family: "Poppins", sans-serif;
}

/* Button Styling */
button {
    background: linear-gradient(135deg, #25d366 0%, #20c997 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4);
}

button:active {
    transform: translateY(0);
}

#downloadExcelBtn,
#shareGroupLinkBtn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    margin-top: 10px;
}

#downloadExcelBtn:hover,
#shareGroupLinkBtn:hover {
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

/* Group Creation Specific Styles */
.participants-preview {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.participants-preview h4 {
    color: #25d366;
    margin-bottom: 10px;
    font-size: 14px;
}

#participantsList {
    font-size: 12px;
    line-height: 1.4;
}

/* Multiple Images Container */
.images-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.image-upload-area {
    border: 2px dashed #dee2e6;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.image-upload-area:hover {
    border-color: #25d366;
    background: rgba(37, 211, 102, 0.05);
}

.image-upload-area.dragover {
    border-color: #25d366;
    background: rgba(37, 211, 102, 0.1);
    transform: scale(1.02);
}

.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.image-preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.image-preview:hover {
    transform: scale(1.05);
}

.image-preview img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.image-preview .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: normal;
    padding: 0;
}

.image-preview .remove-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.image-count {
    color: #25d366;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

/* Message and Image Container */
#messageImageContainer {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

#messageImageContainer .message-area {
    display: flex;
    flex-direction: column;
}

#messageImageContainer label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Container Styling */
.info-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.info-container label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Send Button Container */
#sendButtonContainer {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    border-radius: 8px;
    border: 2px dashed #25d366;
}

#sendMessagesBtn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
}

/* QR Code Styling */
#qrCode {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 250px;
    border: 2px dashed #dee2e6;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#qrCode:hover {
    border-color: #25d366;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.2);
}

.status-message {
    color: #6c757d;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
    padding: 20px;
}

.status-ready {
    color: #fff !important;
    font-weight: bold;
}

.status-error {
    color: #dc3545 !important;
    font-weight: bold;
}

.status-warning {
    color: #ffc107 !important;
    font-weight: bold;
}

/* Logs Section */
.logs-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.logs-header h4 {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#logs {
    flex: 1;
    overflow-y: auto;
    background: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.4;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 1px solid #34495e;
    min-height: 200px;
    max-height: 400px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

#logs::-webkit-scrollbar {
    width: 6px;
}

#logs::-webkit-scrollbar-track {
    background: #34495e;
    border-radius: 3px;
}

#logs::-webkit-scrollbar-thumb {
    background: #25d366;
    border-radius: 3px;
}

#logs .log-entry {
    margin-bottom: 4px;
    padding: 2px 0;
    word-wrap: break-word;
}

/* Clear Logs Button */
#clearLogsBtn {
    background: none;
    color: #dc3545;
    border: 1px solid #dc3545;
    padding: 6px 12px;
    font-size: 11px;
    cursor: pointer;
    border-radius: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

#clearLogsBtn:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-1px);
}

/* File Input Styling */
input[type="file"] {
    border: 2px dashed #dee2e6;
    background: #f8f9fa;
    cursor: pointer;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: #25d366;
    background: rgba(37, 211, 102, 0.05);
}

/* Form Groups */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.form-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Progress Bar */
.progress-container {
    margin-top: 15px;
    display: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #25d366 0%, #20c997 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    margin-top: 5px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #25d366;
}

/* Group Progress Bar */
#groupProgressContainer {
    margin-top: 15px;
    display: none;
}

#groupProgressContainer .progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

#groupProgressFill {
    height: 100%;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    width: 0%;
    transition: width 0.3s ease;
}

#groupProgressText {
    margin-top: 5px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #007bff;
}

/* Success/Error Messages */
.message {
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
    font-weight: 600;
    text-align: center;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Disclaimer */
.disclaimer {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    color: #856404;
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1000;
    margin: 20px auto;
    max-width: 90%;
    text-align: center;
    position: relative;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .right {
        min-width: 300px;
        max-width: 320px;
    }

    header {
        padding: 10px 20px;
    }

    header img {
        height: 30px;
    }

    .tab-btn {
        padding: 12px 15px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        min-height: calc(100vh - 51px);
    }

    .left {
        flex: 1;
        min-height: 60vh;
    }

    .right {
        flex: none;
        height: 40vh;
        min-width: unset;
        max-width: unset;
        border-left: none;
        border-top: 2px solid #e9ecef;
        padding: 15px;
        min-height: 40vh;
    }

    #qrCode {
        height: 150px;
    }

    .tab-content {
        padding: 15px;
    }

    .tab-btn {
        padding: 10px 8px;
        font-size: 11px;
    }

    .disclaimer {
        position: relative;
        bottom: unset;
        left: unset;
        transform: none;
        margin: 10px;
        max-width: none;
    }

    .image-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .image-preview img {
        height: 60px;
    }

    .participants-preview {
        max-height: 150px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    textarea {
        min-height: 80px;
    }
}

@media (max-width: 480px) {
    .tab-nav {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 50%;
        min-width: 0;
        padding: 8px 5px;
        font-size: 10px;
    }

    .container {
        min-height: calc(100vh - 120px);
    }

    h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .tab-content {
        padding: 10px;
    }

    .right {
        padding: 10px;
        height: 35vh;
        min-height: 35vh;
    }

    #qrCode {
        height: 120px;
    }

    .info-container {
        padding: 10px;
    }

    .participants-preview {
        max-height: 120px;
        padding: 10px;
    }
}

/* Hidden/Show classes */
.hidden {
    display: none !important;
}

.show {
    display: block !important;
}

/* Animation for loading states */
.loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #25d366;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Tab-specific styling adjustments */
#createGroup-tab .form-group input[type="text"],
#createGroup-tab .form-group textarea {
    font-size: 14px;
}

#createGroup-tab textarea {
    resize: vertical;
    min-height: 80px;
}

/* Group creation results styling */
#groupCreationResults {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

#groupCreationInfo {
    margin-bottom: 15px;
}

#groupCreationInfo .message {
    margin: 0;
    text-align: left;
}

/* Enhanced button states */
button:disabled {
    background: #6c757d !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

button:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Improved focus states for accessibility */
input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: 2px solid #25d366;
    outline-offset: 2px;
}

/* Better visual feedback for file inputs */
input[type="file"]:focus {
    border-color: #25d366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

/* Smooth transitions for all interactive elements */
.tab-btn,
.form-group input,
.form-group select,
.form-group textarea,
.form-group button,
.info-container,
.progress-container,
.message {
    transition: all 0.3s ease;
}

/* Enhanced scroll behavior */
.tab-content {
    scroll-behavior: smooth;
}

/* Better spacing for form elements in group creation */
#groupCreator .form-group:last-child {
    margin-bottom: 0;
}

/* Improved mobile experience for group creation */
@media (max-width: 768px) {
    #groupCreator {
        padding: 15px;
    }

    .participants-preview {
        font-size: 11px;
    }

    #participantsList {
        font-size: 11px;
    }
}

/* Additional CSS for Multi-Auth Profile Management */

/* Profile Management Enhancements */
.profile-management {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #25d366;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.1);
    transition: all 0.3s ease;
}

.profile-management:hover {
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.15);
    transform: translateY(-2px);
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(37, 211, 102, 0.2);
}

.profile-header h3 {
    color: #25d366;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Enhanced Button Styles */
.btn-small {
    padding: 8px 16px;
    font-size: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-small:disabled {
    background: #6c757d !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.6;
}

/* Profile Cards */
.current-profile-card {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.2);
    transition: all 0.3s ease;
}

.current-profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.current-profile-card h4 {
    color: #28a745;
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-profile-card p {
    margin: 8px 0;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.no-profile-card {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(255, 193, 7, 0.2);
    transition: all 0.3s ease;
}

.no-profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
}

.no-profile-card p {
    margin: 8px 0;
    color: #856404;
    font-weight: 600;
    font-size: 16px;
}

.no-profile-card p:first-child {
    font-size: 18px;
    margin-bottom: 12px;
}

/* Profile Selector */
.profile-selector {
    margin-bottom: 20px;
}

.profile-selector label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-selector select {
    width: 100%;
    margin-bottom: 10px;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: "Poppins", sans-serif;
    background: white;
    transition: all 0.3s ease;
}

.profile-selector select:focus {
    outline: none;
    border-color: #25d366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

/* Profile Creation Form */
.profile-creation-form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.profile-creation-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: "Poppins", sans-serif;
    transition: all 0.3s ease;
}

.profile-creation-form input:focus {
    outline: none;
    border-color: #25d366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.profile-creation-form button {
    white-space: nowrap;
    min-width: 100px;
}

/* Profile Cards List */
.profiles-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.profiles-list::-webkit-scrollbar {
    width: 6px;
}

.profiles-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.profiles-list::-webkit-scrollbar-thumb {
    background: #25d366;
    border-radius: 3px;
}

.profile-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.profile-card:hover {
    border-color: #25d366;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.15);
    transform: translateY(-2px);
}

.profile-card.active {
    border-color: #28a745;
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.profile-card .profile-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(108, 117, 125, 0.2);
}

.profile-card h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-card.active h4 {
    color: #28a745;
}

.profile-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-details p {
    margin: 6px 0;
    font-size: 13px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.profile-card.active .profile-details p {
    color: #495057;
}

.no-profiles {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px 20px;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* Enhanced Status Indicators */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.status-ready {
    background: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.6);
    animation: pulse-success 2s infinite;
}

.status-connecting {
    background: #ffc107;
    animation: pulse-warning 1.5s infinite;
}

.status-disconnected {
    background: #6c757d;
    opacity: 0.7;
}

.status-error {
    background: #dc3545;
    animation: pulse-error 1s infinite;
}

@keyframes pulse-success {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

@keyframes pulse-error {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* QR Code Enhancements for Multi-Auth */
.qr-profile-info {
    margin-top: 12px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    border: 1px solid rgba(37, 211, 102, 0.3);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #25d366;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

#qrCode img.qrcode {
    max-width: 54%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.5s ease;
}

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

/* Enhanced Connection Status */
#connectionStatus {
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#connectionStatus.message.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    color: #155724;
}

#connectionStatus.message.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    color: #856404;
}

#connectionStatus.message.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #dc3545;
    color: #721c24;
}

/* Profile Status Warning */
#profileStatusWarning {
    margin-bottom: 20px;
    animation: slideIn 0.5s ease;
}

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

/* Enhanced Tab Navigation for Profiles */
.tab-btn {
    position: relative;
    overflow: hidden;
}

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

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

.tab-btn.active {
    background: white;
    color: #25d366;
    border-bottom: 3px solid #25d366;
    box-shadow: 0 -2px 10px rgba(37, 211, 102, 0.1);
}

/* Responsive Design Enhancements */
@media (max-width: 1024px) {
    .profile-creation-form {
        gap: 8px;
    }
    
    .profile-actions {
        justify-content: flex-end;
    }
    
    .btn-small {
        font-size: 11px;
        padding: 6px 12px;
    }
}

@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .profile-actions {
        width: 100%;
        justify-content: space-between;
    }

    .profile-creation-form {
        flex-direction: column;
        gap: 12px;
    }

    .profile-creation-form button {
        width: 100%;
        min-width: unset;
    }

    .current-profile-card,
    .no-profile-card {
        padding: 15px;
    }

    .profile-card {
        padding: 15px;
    }

    .profiles-list {
        max-height: 250px;
    }

    #connectionStatus {
        padding: 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .profile-management {
        padding: 15px;
        margin-bottom: 15px;
    }

    .current-profile-card h4,
    .no-profile-card p:first-child {
        font-size: 16px;
    }

    .current-profile-card p,
    .profile-details p {
        font-size: 12px;
    }

    .btn-small {
        font-size: 10px;
        padding: 5px 10px;
        letter-spacing: 0.3px;
    }

    .profile-card h4 {
        font-size: 14px;
    }

    .qr-profile-info {
        font-size: 12px;
        padding: 8px;
    }
}

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

.loading-profile::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #25d366;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

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

/* Enhanced Error States */
.profile-error {
    border-color: #dc3545 !important;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%) !important;
}

.profile-error h4 {
    color: #dc3545 !important;
}

/* Success Animations */
.profile-success {
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Improved Focus States */
.profile-creation-form input:focus,
.profile-selector select:focus {
    border-color: #25d366;
    box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.15);
    transform: translateY(-1px);
}

/* Custom Scrollbar for Profile Lists */
.profiles-list {
    scrollbar-width: thin;
    scrollbar-color: #25d366 #f1f1f1;
}

/* Enhanced Hover Effects */
.profile-card:hover .btn-small {
    transform: scale(1.05);
}

.current-profile-card:hover,
.no-profile-card:hover {
    border-width: 3px;
    padding: 19px; /* Compensate for border width change */
}

/* Accessibility Enhancements */
.btn-small:focus,
.profile-creation-form input:focus,
.profile-selector select:focus {
    outline: 3px solid rgba(37, 211, 102, 0.5);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .profile-management,
    .profile-card,
    .current-profile-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}


/* --- Styles for Message Preview (Updated based on image) --- */
#messagePreviewCard {
    /* Keep existing card styles */
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

#messagePreviewCard h4 {
     /* Keep existing title styles */
     color: #2c3e50;
     margin-bottom: 15px;
     font-weight: 700;
}

#whatsappPreviewContent {
    
    /* --- MODIFIED: Use background image --- */
    background-image: url('./bg.png'); /* Path to your image */
    background-repeat: repeat; /* Typical for chat backgrounds */
    background-color: #e5ddd5; /* Fallback color */
    background-size: cover;

    padding: 10px;
    border-radius: 8px;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.whatsapp-bubble {
    /* --- MODIFIED: Style like a SENT message (right-aligned, light green) --- */
    background-color: #fff; /* Light WhatsApp sent message green */
    border-radius: 8px 8px 8px 0; /* Bottom-right corner flat */
    padding: 8px 10px;
    max-width: 85%;
    width: fit-content;
    margin-right: auto; /* Align to the right */
    margin-right: 0; /* Ensure it's fully right */
    text-align: left; /* Text within the bubble is left-aligned */
    /* END MODIFIED */

    font-size: 14px;
    line-height: 1.4;
    color: #000;
    word-wrap: break-word;
    white-space: pre-wrap;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.whatsapp-preview-image {
     /* Keep existing image styles */
     max-width: 100%;
     height: auto;
     border-radius: 8px;
     display: block;
     margin-bottom: 5px; /* Space below image if text follows */
}

/* If an image is the LAST item in the bubble, remove bottom margin */
.whatsapp-bubble .whatsapp-preview-image:last-child {
    margin-bottom: 0;
}


#whatsappPreviewContent .placeholder {
    text-align: center;
    color: #333;
    font-style: italic;
    padding: 20px;
    font-size: 13px;
}
/* --- End Styles --- */

/* Add media queries for responsive adjustments if needed */
@media (max-width: 768px) {
    #messagePreviewCard {
        padding: 15px;
        margin-bottom: 15px;
    }
    #messagePreviewCard h4 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    #whatsappPreviewContent {
        max-height: 200px; /* Adjust height for smaller screens */
    }
    .whatsapp-bubble,
    .whatsapp-preview-image {
        font-size: 13px; /* Slightly smaller font on smaller screens */
    }
}

@media (max-width: 480px) {
     #messagePreviewCard {
        padding: 10px;
        margin-bottom: 10px;
    }
     #messagePreviewCard h4 {
        font-size: 14px;
    }
    #whatsappPreviewContent {
        max-height: 150px; /* Further adjust height */
    }
     .whatsapp-bubble,
    .whatsapp-preview-image {
        font-size: 12px; /* Even smaller font on small screens */
    }
}