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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
}

header h1 {
    margin-bottom: 20px;
    font-size: 2em;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: white;
    color: #667eea;
    font-weight: bold;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 600px;
}

.messages-panel, .reply-panel {
    padding: 30px;
}

.messages-panel {
    border-right: 2px solid #e0e0e0;
}

.messages-panel h2, .reply-panel h2 {
    margin-bottom: 20px;
    color: #333;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
}

.message-item {
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.message-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateX(5px);
}

.message-item.selected {
    border-color: #667eea;
    background: #f5f7ff;
}

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

.message-type {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

.message-type.email {
    background: #e3f2fd;
    color: #1976d2;
}

.message-type.sms {
    background: #f3e5f5;
    color: #7b1fa2;
}

.message-type.whatsapp {
    background: #e8f5e9;
    color: #388e3c;
}

.message-type.facebook {
    background: #e3f2fd;
    color: #1565c0;
}

.message-time {
    font-size: 12px;
    color: #999;
}

.message-sender {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.message-subject {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-style: italic;
}

.message-preview {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.reply-panel .no-selection {
    text-align: center;
    color: #999;
    padding: 40px;
    font-style: italic;
}

.reply-details {
    background: #f5f7ff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.reply-details h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.reply-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.reply-info-item {
    display: flex;
    gap: 10px;
}

.reply-info-label {
    font-weight: bold;
    color: #555;
    min-width: 80px;
}

.reply-message-content {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    margin-top: 15px;
    line-height: 1.6;
    color: #333;
}

.reply-form {
    margin-top: 20px;
}

.reply-form textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.reply-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.reply-form button {
    margin-top: 15px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.reply-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: #000;
}

#modal-message-info {
    background: #f5f7ff;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

#reply-textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

#reply-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary {
    flex: 1;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    flex: 1;
    padding: 12px 30px;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Scrollbar Styling */
.message-list::-webkit-scrollbar {
    width: 8px;
}

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

.message-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.message-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive Design */
@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .messages-panel {
        border-right: none;
        border-bottom: 2px solid #e0e0e0;
    }
}

/* Delete button styles */
.reply-actions {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

.btn-delete {
    padding: 12px 24px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: #28a745;
}

.notification-error {
    background: #dc3545;
}

.notification-info {
    background: #17a2b8;
}

/* Delete button styles */
.reply-actions {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

.btn-delete {
    padding: 12px 24px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: #28a745;
}

.notification-error {
    background: #dc3545;
}

.notification-info {
    background: #17a2b8;
}

/* Delete button styles */
.reply-actions {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

.btn-delete {
    padding: 12px 24px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: #28a745;
}

.notification-error {
    background: #dc3545;
}

.notification-info {
    background: #17a2b8;
}

/* Webhook Status Styles */
.webhook-status {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-label {
    font-weight: 600;
    font-size: 14px;
}

.status-indicator {
    font-size: 14px;
}

.status-connected {
    color: #4ade80;
}

.status-warning {
    color: #fbbf24;
}

.status-disconnected {
    color: #f87171;
}

.status-online {
    color: #4ade80;
    font-weight: 700;
}

.status-offline {
    color: #f87171;
    font-weight: 700;
}

.status-warning {
    color: #fbbf24;
    font-weight: 700;
}

.test-webhook-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.test-webhook-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Webhook Modal Styles */
.webhook-details-content {
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
}

.webhook-test-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.test-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.test-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.test-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.test-row span:first-child {
    font-weight: 600;
    color: #666;
}

.test-value {
    color: #333;
    font-family: 'Courier New', monospace;
}

.test-result {
    padding: 15px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    font-size: 16px;
}

.test-success {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #10b981;
}

.test-error {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #ef4444;
}

.test-message-preview {
    margin-top: 15px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
}

.config-info {
    font-size: 14px;
}

.config-info p {
    margin: 15px 0 5px 0;
    font-weight: 600;
    color: #333;
}

.config-info code {
    display: block;
    padding: 10px;
    background: white;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #667eea;
    overflow-x: auto;
    margin-bottom: 10px;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

/* Modal improvements */
.modal-content {
    max-width: 700px;
}

/* Webhook Status Styles */
.webhook-status {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-label {
    font-weight: 600;
    font-size: 14px;
}

.status-indicator {
    font-size: 14px;
}

.status-connected {
    color: #4ade80;
}

.status-warning {
    color: #fbbf24;
}

.status-disconnected {
    color: #f87171;
}

.status-online {
    color: #4ade80;
    font-weight: 700;
}

.status-offline {
    color: #f87171;
    font-weight: 700;
}

.status-warning {
    color: #fbbf24;
    font-weight: 700;
}

.test-webhook-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.test-webhook-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Webhook Modal Styles */
.webhook-details-content {
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
}

.webhook-test-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.test-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.test-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.test-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.test-row span:first-child {
    font-weight: 600;
    color: #666;
}

.test-value {
    color: #333;
    font-family: 'Courier New', monospace;
}

.test-result {
    padding: 15px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    font-size: 16px;
}

.test-success {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #10b981;
}

.test-error {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #ef4444;
}

.test-message-preview {
    margin-top: 15px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
}

.config-info {
    font-size: 14px;
}

.config-info p {
    margin: 15px 0 5px 0;
    font-weight: 600;
    color: #333;
}

.config-info code {
    display: block;
    padding: 10px;
    background: white;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #667eea;
    overflow-x: auto;
    margin-bottom: 10px;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

/* Modal improvements */
.modal-content {
    max-width: 700px;
}
