/* ===================================
   Newsletter Observatorio - Styles
   Compact grid layout - no scroll
   =================================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 15px;
    color: #333;
    overflow: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    height: calc(100vh - 30px);
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 8px;
}

.control-panel-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

header h1 {
    color: #2d3748;
    font-size: 22px;
    margin: 0;
}

.subtitle {
    color: #718096;
    font-size: 12px;
    margin-bottom: 8px;
}

/* API Status Banner */
.api-status-banner {
    margin-top: 10px;
    padding: 8px 12px;
    background: #f7fafc;
    border-radius: 4px;
    border-left: 4px solid #718096;
}

.api-status-banner.connected {
    background: #d4edda;
    border-left-color: #28a745;
}

.api-status-banner.disconnected {
    background: #f8d7da;
    border-left-color: #dc3545;
}

#apiStatus {
    font-size: 12px;
    font-weight: 600;
}

/* Status Messages */
#statusMessages {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    max-width: 400px;
    pointer-events: none;
}

.message {
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 12px;
    animation: slideIn 0.3s ease;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.message-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.message-error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.message-info {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grid Layout */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    /* Important for grid items to respect parent height */
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Fixed height based on grid */
    min-height: 0;
    /* Allow shrinking */
}

.card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: #f7fafc;
    padding: 12px 15px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.card-header h2 {
    font-size: 16px;
    color: #2d3748;
}

.step-status {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.step-status.pending {
    background: #e2e8f0;
    color: #718096;
}

.step-status.active {
    background: #bee3f8;
    color: #2c5282;
}

.step-status.completed {
    background: #c6f6d5;
    color: #22543d;
}

.card-body {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.step-description {
    font-size: 12px;
    color: #718096;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-block {
    width: 100%;
    margin-top: 8px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

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

/* Button Colors */
.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
}

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

.btn-primary:hover:not(:disabled) {
    background: #0056b3;
}

.btn-danger {
    background: #dc3545;
    color: white;
    font-size: 16px;
    padding: 14px 28px;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* Form Elements */
.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 12px;
    color: #2d3748;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.form-control-sm {
    padding: 6px 10px;
    font-size: 12px;
}

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

.form-control:disabled {
    background: #f7fafc;
    cursor: not-allowed;
}

.form-text {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: #718096;
}

/* Preview */
.preview-info {
    background: #f7fafc;
    padding: 10px;
    border-radius: 4px;
    margin: 8px 0;
    border-left: 3px solid #007bff;
    font-size: 11px;
}

.preview-info p {
    margin: 3px 0;
    font-size: 11px;
}

.preview-info ul {
    margin: 5px 0 0 15px;
    font-size: 11px;
}

.preview-info li {
    margin: 2px 0;
}

/* Campaign Display */
#campaignIdDisplay {
    background: #f7fafc;
    padding: 8px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
    border-left: 3px solid #28a745;
}

.campaign-id-text {
    font-size: 11px;
    margin: 0;
}

#campaignIdDisplay code {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #2d3748;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 22px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}