* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #f5f5f5;
}

/* Login page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    margin-bottom: 30px;
    color: #333;
    text-align: center;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-box button:hover {
    background: #5568d3;
}

.error {
    color: #e74c3c;
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
}

/* Dashboard */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

header h1 {
    color: #333;
}

.logout-btn {
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.logout-btn:hover {
    background: #c0392b;
}

main {
    display: grid;
    gap: 20px;
}

.status-card, .campaigns-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.status-card h2, .campaigns-card h2 {
    margin-bottom: 20px;
    color: #333;
}

.campaign-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.campaign-item:last-child {
    border-bottom: none;
}

.status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status.active {
    background: #2ecc71;
    color: white;
}

.status.inactive {
    background: #95a5a6;
    color: white;
}

/* Header updates */
.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.last-update {
    color: #666;
    font-size: 14px;
}

.refresh-btn {
    padding: 8px 15px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.refresh-btn:hover {
    background: #2980b9;
}

/* Campaign item enhanced */
.campaign-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.campaign-item:hover {
    background: #f8f9fa;
}

.campaign-item:last-child {
    border-bottom: none;
}

.campaign-info {
    flex: 1;
}

.campaign-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.campaign-id {
    font-size: 12px;
    color: #999;
}

.campaign-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-action {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-activate {
    background: #2ecc71;
    color: white;
}

.btn-activate:hover:not(:disabled) {
    background: #27ae60;
}

.btn-pause {
    background: #e74c3c;
    color: white;
}

.btn-pause:hover:not(:disabled) {
    background: #c0392b;
}

.btn-primary {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:hover {
    background: #5568d3;
}

.campaigns-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Status badges */
.badge {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

.badge.success {
    background: #d4edda;
    color: #155724;
}

.badge.error {
    background: #f8d7da;
    color: #721c24;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.status-item:last-child {
    border-bottom: none;
}

/* Logs card */
.logs-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.log-item {
    display: flex;
    gap: 15px;
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.log-item:last-child {
    border-bottom: none;
}

.log-time {
    color: #999;
    min-width: 150px;
}

.log-action {
    font-weight: 600;
    min-width: 80px;
}

.log-action.activated {
    color: #2ecc71;
}

.log-action.paused {
    color: #e74c3c;
}

.log-campaign {
    color: #666;
}

.log-empty {
    text-align: center;
    color: #999;
    padding: 20px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    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: #2ecc71;
}

.notification.error {
    background: #e74c3c;
}

/* Empty states */
.empty-state, .error-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.error-state {
    color: #e74c3c;
}

/* Calendar card */
.calendar-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.info-item {
    display: flex;
    justify-content: space-between;
}

.calendar-preview {
    min-height: 100px;
}

.calendar-condensed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.calendar-day {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    text-align: center;
}

.calendar-date {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.calendar-slots {
    color: #666;
    font-size: 14px;
}

.calendar-more {
    padding: 15px;
    text-align: center;
    color: #999;
}

/* TV Stations card */
.tv-stations-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.stations-grid {
    display: grid;
    gap: 15px;
}

..station-mapping {
    display: grid;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 15px;
}

.mapping-campaign {
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
}

.campaign-name-map {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.campaign-id-map {
    font-size: 12px;
    color: #999;
}

.stations-multiselect {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.station-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.station-checkbox:hover {
    background: #f0f2ff;
    border-color: #667eea;
}

.station-checkbox input[type="checkbox"] {
    cursor: pointer;
}

.station-checkbox input[type="checkbox"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.station-checkbox span {
    font-size: 14px;
}

.mapping-campaign {
    font-weight: 500;
}

.station-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 30px;
}

.upload-instructions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.upload-instructions h3 {
    margin-top: 0;
}

.upload-instructions ul {
    margin: 10px 0;
    padding-left: 20px;
}

.download-template {
    display: inline-block;
    margin-top: 10px;
    color: #667eea;
    text-decoration: none;
}

.download-template:hover {
    text-decoration: underline;
}

.upload-zone {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-zone:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-zone.drag-over {
    border-color: #667eea;
    background: #f0f2ff;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.upload-hint {
    color: #999;
    font-size: 14px;
}

.parse-preview {
    margin-top: 20px;
}

.preview-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.preview-table {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 5px;
}

.preview-table table {
    width: 100%;
    border-collapse: collapse;
}

.preview-table th,
.preview-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.preview-table th {
    background: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    padding: 10px 20px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #7f8c8d;
}