/* Global Styles */
body { 
    font-family: system-ui; 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 20px; 
}

/* Header */
.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 20px 0; 
    border-bottom: 2px solid #ddd; 
}

.welcome { 
    font-size: 1.2em; 
    color: #333; 
    margin-right: 15px; 
}

.logout-btn { 
    padding: 8px 16px; 
    background: #dc3545; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
}

.logout-btn:hover { 
    background: #c82333; 
}

/* Navigation */
.nav { 
    display: flex; 
    gap: 20px; 
    margin: 20px 0; 
}

.nav a { 
    padding: 10px 20px; 
    background: #f8f9fa; 
    color: #333; 
    text-decoration: none; 
    border-radius: 4px; 
}

.nav a:hover { 
    background: #e9ecef; 
}

.nav a.active { 
    background: #007bff; 
    color: white; 
}

/* Content */
.content { 
    margin-top: 30px; 
}

/* Links */
.back-link { 
    color: #007bff; 
    text-decoration: none; 
    margin-bottom: 20px; 
    display: inline-block; 
}

.back-link:hover { 
    text-decoration: underline; 
}

/* Campaigns */
.campaigns-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Filters */
.filters { 
    background: #f8f9fa; 
    padding: 15px; 
    border-radius: 4px; 
    margin-bottom: 20px; 
}

.filters select, .filters input { 
    margin: 0 10px 0 5px; 
    padding: 5px; 
}

/* Campaign Table */
.campaign-table { 
    width: 100%; 
    border-collapse: collapse; 
}

.campaign-table th, .campaign-table td { 
    padding: 12px; 
    text-align: left; 
    border-bottom: 1px solid #ddd; 
}

.campaign-table th { 
    background: #f8f9fa; 
    font-weight: 600; 
}

.campaign-table tr:hover { 
    background: #f8f9fa; 
}

/* Status and Type Badges */
.status { 
    padding: 4px 8px; 
    border-radius: 3px; 
    color: white; 
    font-size: 0.8em; 
    text-transform: uppercase; 
}

.status-new { background: #6c757d; }
.status-active { background: #28a745; }
.status-paused { background: #ffc107; color: #000; }
.status-completed { background: #17a2b8; }
.status-error { background: #dc3545; }
.status-blocked { background: #dc3545; }
.status-archived { background: #6c757d; }
.status-idle { background: #6f42c1; }
.status-inactive { background: #6c757d; }

.type-badge { 
    padding: 2px 6px; 
    border-radius: 3px; 
    font-size: 0.8em; 
}

.type-targeted { 
    background: #e7f3ff; 
    color: #0066cc; 
}

.type-idle { 
    background: #fff2e7; 
    color: #cc6600; 
}

/* Progress Bar */
.progress-bar { 
    width: 60px; 
    height: 6px; 
    background: #e9ecef; 
    border-radius: 3px; 
    overflow: hidden; 
}

.progress-fill { 
    height: 100%; 
    background: #28a745; 
    transition: width 0.3s; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: white; 
    font-weight: bold; 
    font-size: 0.9em; 
}

/* Entity Name Links */
.entity-name-link {
    color: #007bff;
    text-decoration: none;
}

.entity-name-link:hover {
    text-decoration: underline;
}

/* Profile Actions Alignment */
.profile-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Actions */
.actions { 
    display: flex; 
    gap: 8px; 
}

/* Buttons */
.btn { 
    padding: 10px 20px; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: 600; 
    text-decoration: none; 
    display: inline-block; 
    text-align: center; 
}

.btn:hover { 
    opacity: 0.8; 
}

.btn:disabled { 
    opacity: 0.6; 
    cursor: not-allowed; 
}

.btn-sm { 
    padding: 4px 8px; 
    font-size: 0.8em; 
    border: none;
    border-radius: 3px;
}

.btn-primary { background: #007bff; color: white; }
.btn-success { background: #28a745; color: white; }
.btn-warning { background: #ffc107; color: #000; }
.btn-danger { background: #dc3545; color: white; }
.btn-secondary { background: #6c757d; color: white; }

/* Forms */
.form-group { 
    margin-bottom: 15px; 
}

.form-group label { 
    display: block; 
    margin-bottom: 5px; 
    font-weight: 600; 
}

.form-group input, .form-group select, .form-group textarea { 
    width: 100%; 
    padding: 8px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    box-sizing: border-box;
    font-family: inherit;
}

.form-group textarea { 
    resize: vertical; 
}

/* Campaign Detail Page */
.campaign-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 30px; 
}

.campaign-title { 
    margin: 0; 
}

.campaign-status { 
    padding: 8px 16px; 
    border-radius: 6px; 
    color: white; 
    font-weight: 600; 
    text-transform: uppercase; 
}

.campaign-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 30px; 
    margin-bottom: 30px; 
}

.campaign-section { 
    background: #f8f9fa; 
    padding: 20px; 
    border-radius: 8px; 
}

.campaign-section h3 { 
    margin-top: 0; 
    color: #333; 
}

.detail-row { 
    display: flex; 
    justify-content: space-between; 
    margin: 10px 0; 
    padding: 8px 0; 
    border-bottom: 1px solid #dee2e6; 
}

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

.detail-label { 
    font-weight: 600; 
    color: #666; 
}

.detail-value { 
    color: #333; 
}

.progress-section { 
    grid-column: 1 / -1; 
}

.progress-bar.large { 
    width: 100%; 
    height: 20px; 
    border-radius: 10px; 
    margin: 10px 0; 
}

.domains-list { 
    background: #fff; 
    border: 1px solid #dee2e6; 
    border-radius: 4px; 
    padding: 15px; 
    max-height: 200px; 
    overflow-y: auto; 
}

.domain-item { 
    padding: 5px 0; 
    border-bottom: 1px solid #f1f3f4; 
}

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

/* Login Page */
.login-form { 
    max-width: 400px; 
    margin: 50px auto; 
    padding: 40px; 
    border: 1px solid #ddd; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
}

.login-form h2 { 
    text-align: center; 
    margin-bottom: 30px; 
    color: #333; 
}

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

.login-form .btn { 
    width: 100%; 
    margin-bottom: 15px; 
}

.login-links { 
    text-align: center; 
    margin-top: 20px; 
}

.login-links a { 
    color: #007bff; 
    text-decoration: none; 
    margin: 0 10px; 
}

.login-links a:hover { 
    text-decoration: underline; 
}

/* Success and Error Messages */
.success {
    color: #155724;
    background: #d4edda;
    padding: 10px 15px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin: 15px 0;
}

.error {
    color: #721c24;
    background: #f8d7da;
    padding: 10px 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 15px 0;
}

/* RTB Specific Styles */
.status-active { background: #28a745; }
.status-inactive { background: #6c757d; }

.url-link {
    color: #007bff;
    text-decoration: none;
    font-family: monospace;
    font-size: 0.9em;
}

.url-link:hover {
    text-decoration: underline;
}

/* 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: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 10px;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

