/**
 * P7 Team Manager - Campaigns Add-On Styles
 * Mobile-First & Responsive Design
 */

/* ===== KAMPAGNEN-SENDER ===== */
.p7tmc-sender {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    color: #2C2C2C;
    max-width: 100%;
    margin: 0;
}

.p7tmc-sender * {
    box-sizing: border-box;
}

/* Header */
.p7tmc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 10px;
    flex-wrap: wrap;
    gap: 1rem;
}

.p7tmc-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2C2C2C;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.p7tmc-back-link {
    font-size: 0.9rem;
    color: #5C6B55;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.p7tmc-back-link:hover {
    background: #e2e8f0;
}

/* Steps */
.p7tmc-step {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.p7tmc-step h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2C2C2C;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Template Selector */
.p7tmc-template-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: all 0.2s;
}

.p7tmc-template-select:focus {
    outline: none;
    border-color: #5C6B55;
    box-shadow: 0 0 0 3px rgba(92, 107, 85, 0.1);
}

/* Info Boxes */
.p7tmc-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.p7tmc-info-box {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.p7tmc-info-box .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #5C6B55;
    display: block;
    margin-bottom: 0.25rem;
}

.p7tmc-info-box .label {
    font-size: 0.85rem;
    color: #666;
}

/* Empfänger-Liste */
.p7tmc-recipients {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.p7tmc-recipients-toggle {
    background: transparent;
    border: none;
    color: #5C6B55;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.p7tmc-recipients-list {
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.p7tmc-recipient-item {
    padding: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

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

/* Vorschau */
.p7tmc-preview {
    margin-top: 1rem;
}

.p7tmc-preview-subject,
.p7tmc-preview-body {
    margin-bottom: 1rem;
}

.p7tmc-preview-subject strong,
.p7tmc-preview-body strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #2C2C2C;
    font-weight: 600;
}

#p7tmc-preview-subject-text {
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 6px;
    font-size: 0.95rem;
}

#p7tmc-preview-body-text {
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Campaign Name Input */
.p7tmc-campaign-name {
    margin-top: 1rem;
}

.p7tmc-campaign-name label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2C2C2C;
}

.p7tmc-campaign-name input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

.p7tmc-campaign-name input:focus {
    outline: none;
    border-color: #5C6B55;
    box-shadow: 0 0 0 3px rgba(92, 107, 85, 0.1);
}

.p7tmc-campaign-name .description {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Send Button */
.p7tmc-send-button {
    margin-top: 1.5rem;
    text-align: center;
}

.p7tmc-send-button button {
    background: #5C6B55;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.p7tmc-send-button button:hover {
    background: #4a5744;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(92, 107, 85, 0.2);
}

.p7tmc-send-button button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

/* Progress Section */
.p7tmc-progress {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.p7tmc-progress-bar {
    background: #e2e8f0;
    border-radius: 999px;
    height: 30px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}

.p7tmc-progress-fill {
    background: linear-gradient(90deg, #5C6B55 0%, #7a9070 100%);
    height: 100%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.p7tmc-progress-info {
    text-align: center;
    font-size: 0.95rem;
    color: #666;
}

.p7tmc-progress-status {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* Success/Error */
.p7tmc-success,
.p7tmc-error {
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: center;
}

.p7tmc-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.p7tmc-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* Notices */
.p7tm-notice {
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.p7tm-notice-info {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #1e40af;
}

/* ===== TEMPLATE VERWALTUNG ===== */
.p7tmc-templates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.p7tmc-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.p7tmc-template-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
    transition: all 0.2s;
}

.p7tmc-template-card:hover {
    border-color: #5C6B55;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.p7tmc-template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.p7tmc-template-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2C2C2C;
    margin: 0;
}

.p7tmc-template-actions {
    display: flex;
    gap: 0.5rem;
}

.p7tmc-template-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.p7tmc-template-btn:hover {
    background: #f7fafc;
    border-color: #5C6B55;
}

.p7tmc-template-preview {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.p7tmc-template-meta {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

/* Template Editor */
.p7tmc-editor {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.5rem;
}

.p7tmc-form-group {
    margin-bottom: 1.25rem;
}

.p7tmc-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2C2C2C;
}

.p7tmc-form-group input,
.p7tmc-form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

.p7tmc-form-group textarea {
    min-height: 300px;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
}

.p7tmc-form-group input:focus,
.p7tmc-form-group textarea:focus {
    outline: none;
    border-color: #5C6B55;
    box-shadow: 0 0 0 3px rgba(92, 107, 85, 0.1);
}

.p7tmc-form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.p7tmc-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.p7tmc-btn-primary {
    background: #5C6B55;
    color: white;
}

.p7tmc-btn-primary:hover {
    background: #4a5744;
}

.p7tmc-btn-secondary {
    background: #e2e8f0;
    color: #2C2C2C;
}

.p7tmc-btn-secondary:hover {
    background: #cbd5e0;
}

.p7tmc-btn-danger {
    background: #ef4444;
    color: white;
}

.p7tmc-btn-danger:hover {
    background: #dc2626;
}

/* Placeholders Help */
.p7tmc-placeholders {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.p7tmc-placeholders h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e40af;
    margin: 0 0 0.5rem 0;
}

.p7tmc-placeholder-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.p7tmc-placeholder {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #1e40af;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .p7tmc-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .p7tmc-header h2 {
        font-size: 1.25rem;
    }
    
    .p7tmc-info-grid {
        grid-template-columns: 1fr;
    }
    
    .p7tmc-step {
        padding: 1rem;
    }
    
    .p7tmc-step h3 {
        font-size: 1.1rem;
    }
    
    .p7tmc-templates-grid {
        grid-template-columns: 1fr;
    }
    
    .p7tmc-form-actions {
        flex-direction: column;
    }
    
    .p7tmc-btn {
        width: 100%;
        justify-content: center;
    }
    
    #p7tmc-preview-body-text {
        max-height: 250px;
    }
    
    .p7tmc-send-button button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .p7tmc-step {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .p7tmc-info-box .value {
        font-size: 1.5rem;
    }
    
    .p7tmc-template-card {
        padding: 1rem;
    }
}

/* ===== UTILITY ===== */
.p7tmc-hidden {
    display: none !important;
}

.p7tmc-text-center {
    text-align: center;
}

.p7tmc-mb-0 {
    margin-bottom: 0 !important;
}

.p7tmc-mt-1 {
    margin-top: 1rem;
}

.p7tmc-mt-2 {
    margin-top: 2rem;
}
