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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    margin-bottom: 30px;
    text-align: center;
    color: #241c15;
    font-size: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-export {
    background-color: #28a745;
    color: white;
}

.btn-export:hover {
    background-color: #218838;
}

.error-message {
    color: #dc3545;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 4px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

/* Campaigns Page Styles */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #241c15;
    font-size: 28px;
}

.controls {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: inline-block;
    margin-right: 10px;
    font-weight: 500;
    color: #555;
}

.search-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
}

.year-filter {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
    cursor: pointer;
    min-width: 150px;
}

.year-filter:focus {
    outline: none;
    border-color: #007bff;
}

.selection-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.selection-info span {
    font-weight: 500;
    color: #555;
}

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

.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: #ffffff; /* Reverted to pure white */
    position: sticky;
    top: 0;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #241c15;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 25px;
}

.sortable:hover {
    background-color: #e9ecef;
}

.sort-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
}

.sort-icon::before {
    content: '⇅';
    font-size: 14px;
}

.sortable.sort-asc .sort-icon {
    opacity: 1;
}

.sortable.sort-asc .sort-icon::before {
    content: '↑';
}

.sortable.sort-desc .sort-icon {
    opacity: 1;
}

.sortable.sort-desc .sort-icon::before {
    content: '↓';
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
}

tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

tbody tr.selected {
    background-color: #e7f3ff;
}

.checkbox-col {
    width: 50px;
    text-align: center;
}

.checkbox-col input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-sent {
    background-color: #d4edda;
    color: #155724;
}

.status-draft {
    background-color: #fff3cd;
    color: #856404;
}

.status-scheduled {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-sending {
    background-color: #cce5ff;
    color: #004085;
}

.status-paused {
    background-color: #f8d7da;
    color: #721c24;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Groups Page Styles */
.groups-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

#groupsList {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.group-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.group-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.group-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.group-header h3 {
    margin: 0;
    color: #241c15;
    font-size: 18px;
}

.group-count {
    margin: 5px 0 0 0;
    color: #666;
    font-size: 14px;
}

.group-campaigns {
    padding: 15px 20px;
}

.campaign-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.campaign-item:last-child {
    border-bottom: none;
}

.campaign-title {
    font-weight: 500;
    color: #241c15;
    margin-bottom: 5px;
}

.campaign-meta {
    font-size: 13px;
    color: #666;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.export-group-btn {
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
    }
    
    .selection-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px;
    }
}
