* {
    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;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #e8e8e8;
    color: #333;
}

.tab-btn.active {
    color: #25D366;
    border-bottom-color: #25D366;
    background: white;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 25px;
}

.card h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.8em;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #25D366;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 0.9em;
}

.form-group label input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

#template-group {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
}

#template-variables-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.customer-selector {
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    background: #fafafa;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-box input {
    flex: 1;
}

.usergroup-filter {
    width: 200px;
}

.customer-list-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    padding: 10px;
}

.customer-list {
    display: grid;
    gap: 8px;
}

.customer-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.customer-item:hover {
    background: #f5f5f5;
    border-color: #25D366;
}

.customer-item.selected {
    background: #e8f5e9;
    border-color: #25D366;
}

.customer-item input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.customer-info {
    flex: 1;
}

.customer-name {
    font-weight: 600;
    color: #333;
}

.customer-details {
    font-size: 0.9em;
    color: #666;
    margin-top: 4px;
}

.customer-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.selected-count {
    margin-top: 15px;
    padding: 10px;
    background: #e8f5e9;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    color: #2e7d32;
}

.media-preview {
    margin-top: 10px;
}

.media-preview img {
    max-width: 300px;
    max-height: 300px;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #25D366;
    color: white;
}

.btn-primary:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.campaigns-list {
    display: grid;
    gap: 15px;
}

.campaign-item {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

.campaign-item:hover {
    border-color: #25D366;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.campaign-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.campaign-name {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
}

.campaign-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.status-draft {
    background: #fff3cd;
    color: #856404;
}

.status-sending {
    background: #cfe2ff;
    color: #084298;
}

.status-completed {
    background: #d1e7dd;
    color: #0f5132;
}

.status-failed {
    background: #f8d7da;
    color: #842029;
}

.status-active {
    background: #d1e7dd;
    color: #0f5132;
}

.status-paused {
    background: #fff3cd;
    color: #856404;
}

.campaign-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.campaign-stat {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.campaign-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.report-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.report-stat {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    background: #f5f5f5;
}

.report-stat.success {
    background: #d1e7dd;
    color: #0f5132;
}

.report-stat.failed {
    background: #f8d7da;
    color: #842029;
}

.report-stat.pending {
    background: #fff3cd;
    color: #856404;
}

.report-stat-value {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 5px;
}

.report-stat-label {
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #25D366;
}

.notification.error {
    background: #f44336;
}

.notification.info {
    background: #2196F3;
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 8px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .usergroup-filter {
        width: 100%;
    }
    
    .campaign-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .campaign-info {
        grid-template-columns: 1fr;
    }
}
