/* 
 * Clean minimal component styles
 * Functional hierarchy, clear boundaries
 */

/* Sessions Components */
.create-session-form {
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
    padding: 24px;
    margin-bottom: 24px;
}

.create-session-form h3 {
    margin-bottom: 16px;
    color: #111;
}

.sessions-list-container {
    margin-top: 24px;
}

.session-item {
    border: 1px solid #e5e5e5;
    margin: 16px 0;
    padding: 24px;
    background: #fff;
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.session-info {
    flex: 1;
}

.session-name {
    color: #111;
    margin-bottom: 8px;
    font-weight: 600;
}

.session-details {
    margin: 0;
    line-height: 1.5;
    color: #555;
    font-size: 14px;
}

.session-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* QR Code Components */
.qr-code-container {
    text-align: center;
    padding: 24px;
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
    margin-top: 16px;
}

.qr-code-container h4 {
    margin-bottom: 16px;
    color: #111;
}

.qr-code-image {
    max-width: 250px;
    border: 1px solid #ddd;
}

.qr-code-info {
    margin-top: 16px;
    font-size: 12px;
    color: #666;
}

.qr-code-info button {
    margin: 0 4px;
}

.qr-error-container {
    text-align: center;
    padding: 24px;
    margin-top: 16px;
    border: 1px solid #fed7d7;
    background: #fff5f5;
    color: #c53030;
}

/* Chat Components */
.chat-item {
    border-bottom: 1px solid #f0f0f0;
    padding: 16px 0;
}

.chat-item:last-child {
    border-bottom: none;
}

.chat-header {
    font-weight: 600;
    margin-bottom: 4px;
    color: #111;
}

.chat-contact {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.chat-last-message {
    margin: 8px 0;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.chat-meta {
    font-size: 11px;
    color: #999;
}

/* Bulk Job Components */
.bulk-job-item {
    border: 1px solid #e5e5e5;
    margin: 16px 0;
    padding: 24px;
    background: #fff;
}

.bulk-job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.bulk-job-info {
    flex: 1;
}

.bulk-job-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bulk-progress-bar {
    background: #f0f0f0;
    height: 8px;
    margin: 16px 0;
    overflow: hidden;
}

.bulk-progress-fill {
    background: #38a169;
    height: 100%;
    transition: width 0.3s ease;
}

/* Schedule Components */
.schedule-item {
    border: 1px solid #e5e5e5;
    margin: 16px 0;
    padding: 24px;
    background: #fff;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.schedule-info {
    flex: 1;
}

.schedule-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.schedule-countdown {
    background: #fffbeb;
    color: #d69e2e;
    padding: 12px;
    margin-top: 16px;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
    border: 1px solid #fbd38d;
}

/* Media Components */
.media-item {
    border: 1px solid #e5e5e5;
    margin: 12px 0;
    padding: 16px;
    background: #fff;
}

.media-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.media-info {
    flex: 1;
    font-weight: 500;
}

.media-actions {
    display: flex;
    gap: 8px;
}

.media-preview {
    max-width: 100px;
    max-height: 100px;
    object-fit: cover;
    margin-right: 16px;
    border: 1px solid #e5e5e5;
}

/* Template Components */
.template-item {
    border: 1px solid #e5e5e5;
    margin: 16px 0;
    padding: 24px;
    background: #fff;
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.template-info {
    flex: 1;
}

.template-content {
    background: #f8f8f8;
    padding: 16px;
    border: 1px solid #e5e5e5;
    margin: 12px 0;
    font-family: ui-monospace, 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.4;
}

.template-variables {
    margin: 12px 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.template-meta {
    font-size: 12px;
    color: #999;
    margin-top: 12px;
}

/* Message Components */
.message-group {
    border: 1px solid #e5e5e5;
    margin: 16px 0;
    padding: 20px;
    background: #fff;
}

.message-group h5 {
    margin-bottom: 16px;
    color: #111;
    font-weight: 600;
}

.message-item {
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #e5e5e5;
}

.message-item.outgoing {
    background: #f0fff4;
    border-color: #c6f6d5;
    margin-left: 20px;
}

.message-item.incoming {
    background: #f7fafc;
    border-color: #e2e8f0;
    margin-right: 20px;
}

.message-header {
    font-weight: 600;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.message-content {
    margin: 8px 0;
    line-height: 1.4;
}

.message-timestamp {
    float: right;
    font-size: 11px;
    color: #999;
}

/* Form Sections */
.form-section {
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
    padding: 24px;
    margin-bottom: 24px;
}

.form-section h3 {
    margin-bottom: 16px;
    color: #111;
}

.form-section.hidden {
    display: none;
}

.form-toggle-sections .form-section {
    margin-top: 16px;
}

/* Stats and Info Panels */
.stats-panel {
    background: #fff;
    border: 1px solid #e5e5e5;
    padding: 24px;
    margin: 16px 0;
}

.stats-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.stats-item {
    flex: 1;
    min-width: 140px;
    padding: 12px;
    background: #f8f8f8;
    border: 1px solid #f0f0f0;
}

.stats-item strong {
    display: block;
    color: #111;
    font-size: 16px;
    font-weight: 600;
}

/* Popup/Modal Components */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-content {
    background: #fff;
    padding: 32px;
    border: 1px solid #ddd;
    max-width: 80vw;
    max-height: 80vh;
    overflow-y: auto;
}

.popup-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.popup-actions {
    text-align: right;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

/* Table Components */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    border: 1px solid #e5e5e5;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.data-table th {
    background: #f8f8f8;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.data-table code {
    background: #f1f1f1;
    padding: 2px 6px;
    font-size: 12px;
    font-family: ui-monospace, 'SF Mono', monospace;
    border: 1px solid #e5e5e5;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #666;
    background: #f8f8f8;
    border: 1px solid #f0f0f0;
}

.empty-state h3 {
    margin-bottom: 12px;
    color: #333;
}

/* Loading States */
.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.loading-spinner {
    border: 2px solid #f0f0f0;
    border-top: 2px solid #666;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .session-header,
    .bulk-job-header,
    .schedule-header,
    .template-header,
    .media-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .session-actions,
    .bulk-job-actions,
    .schedule-actions {
        align-self: stretch;
    }
    
    .stats-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .popup-content {
        margin: 20px;
        max-width: calc(100vw - 40px);
    }
    
    .message-item.outgoing {
        margin-left: 12px;
    }
    
    .message-item.incoming {
        margin-right: 12px;
    }
}