/**
 * Campaign View Page Improvements
 * Modern, clean design for campaign management pages
 */

/* ============================================
   1. GENERAL IMPROVEMENTS
   ============================================ */

.campaign-view-wrapper {
    background: #f8f9fc;
    padding: 20px 0;
}

.campaign-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.2);
    color: white;
}

.campaign-header h3 {
    color: white;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.campaign-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.campaign-header-actions .btn {
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.campaign-header-actions .btn i {
    font-size: 11px;
}

.campaign-header-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ============================================
   2. COURSE VARIABLES SECTION
   ============================================ */

.variables-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.variables-section h6 {
    color: #4e73df;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.variables-section h6 {
    /* Icon already in HTML, no need for ::before */
}

.variables-table {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e3e6f0;
}

.variables-table thead {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
}

.variables-table thead th {
    color: white;
    font-weight: 600;
    padding: 12px;
    font-size: 13px;
    border: none;
}

.variables-table tbody tr {
    transition: background 0.2s ease;
}

.variables-table tbody tr:hover {
    background: #f8f9fc;
}

.variables-table tbody td {
    padding: 12px;
    font-size: 13px;
}

.variables-table td {
    padding: 12px 15px;
    vertical-align: middle;
}

/* ============================================
   3. EMAIL CARDS
   ============================================ */

.email-card {
    background: white;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    border: none;
    overflow: hidden;
    transition: all 0.3s ease;
}

.email-card:hover {
    box-shadow: 0 5px 25px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.email-card-header {
    background: linear-gradient(135deg, #36b9cc 0%, #258391 100%);
    color: white;
    padding: 15px 20px;
    border: none;
}

.email-card-header h5,
.email-card-header h6 {
    color: white;
    margin: 0;
    font-weight: 700;
    font-size: 0.875rem;
}

.email-card-header .btn {
    border-radius: 6px;
    font-size: 12px;
    padding: 6px 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.email-card-header .btn:hover {
    transform: scale(1.05);
}

.email-card-header .btn i {
    font-size: 11px;
}

.email-card-body {
    padding: 25px;
}

/* ============================================
   4. EMAIL CONTENT DISPLAY
   ============================================ */

.email-content-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 25px;
    align-items: start;
}

@media (max-width: 768px) {
    .email-content-row {
        grid-template-columns: 1fr;
    }
}

.email-details {
    background: #f8f9fc;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #4e73df;
    position: relative;
    z-index: 1;
}

.email-details p {
    margin-bottom: 15px;
    font-size: 14px;
}

.email-details strong {
    color: #2e59d9;
    font-weight: 700;
    display: inline-block;
    min-width: 80px;
}

.email-image-box {
    text-align: center;
    background: white;
    padding: 15px;
    border-radius: 10px;
    border: 2px dashed #e3e6f0;
    position: relative;
    z-index: 1;
}

.email-image-box img {
    max-height: 200px;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    display: block;
    margin: 0 auto;
}

.email-image-box .btn-danger {
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
}

/* ============================================
   5. QUESTIONS & OPTIONS TABLE
   ============================================ */

.questions-table {
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.question-header-row {
    background: linear-gradient(135deg, #f6c23e 0%, #d4a31c 100%);
}

.question-header-row th {
    padding: 10px 12px;
    border: none;
}

.question-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

.question-title {
    /* No ::before needed - styled by parent elements */
}

.question-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.question-actions .btn {
    border-radius: 6px;
    font-size: 11px;
    padding: 6px 12px;
    font-weight: 600;
}

.question-actions .btn i {
    font-size: 10px;
}

.options-header-row {
    background: #4e73df;
}

.options-header-row th {
    color: white;
    font-weight: 600;
    padding: 8px 10px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.option-row {
    transition: all 0.2s ease;
}

.option-row:hover {
    background: #f8f9fc;
    transform: scale(1.01);
}

.option-row td {
    padding: 12px;
    vertical-align: middle;
    font-size: 13px;
}

.option-badge {
    background: #4e73df;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 11px;
    display: inline-block;
}

.followup-logic {
    background: #f8f9fc;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 3px solid #1cc88a;
    font-size: 13px;
}

.followup-logic a {
    color: #4e73df;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}

.followup-logic a:hover {
    color: #2e59d9;
    text-decoration: underline;
}

.variable-changes {
    background: #fff3cd;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
}

.variable-changes strong {
    color: #856404;
}

/* ============================================
   6. CONTACTS SECTION
   ============================================ */

.contacts-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    overflow: hidden;
}

.contacts-card-header {
    background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%);
    color: white;
    padding: 15px 20px;
}

.contacts-card-header h6 {
    color: white;
    margin: 0;
    font-weight: 700;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.contacts-card-header h6 {
    /* Icon already in HTML at line 201, no ::before needed */
}

.contacts-table {
    margin: 0;
}

.contacts-table thead {
    background: #f8f9fc;
}

.contacts-table thead th {
    padding: 15px;
    font-weight: 700;
    color: #5a5c69;
    border-top: none;
}

.contacts-table tbody tr {
    transition: all 0.2s ease;
}

.contacts-table tbody tr:hover {
    background: #f8f9fc;
    transform: scale(1.005);
}

.contacts-table td {
    padding: 15px;
    vertical-align: middle;
}

.source-badge {
    background: #e2e6ea;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.contact-variables {
    background: #f8f9fc;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
}

/* ============================================
   7. BUTTONS & ACTIONS
   ============================================ */

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-icon i {
    font-size: 14px;
}

.action-buttons {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.action-buttons .btn {
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 11px;
}

.action-buttons .btn i {
    font-size: 10px;
}

/* ============================================
   8. ALERTS & NOTIFICATIONS
   ============================================ */

.alert {
    border-radius: 10px;
    padding: 15px 20px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.alert-success {
    background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #e74a3b 0%, #c92a1d 100%);
    color: white;
}

/* ============================================
   9. BREADCRUMB
   ============================================ */

.breadcrumb {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.breadcrumb-item a {
    color: #4e73df;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: #2e59d9;
}

.breadcrumb-item.active {
    color: #5a5c69;
}

/* ============================================
   10. EMPTY STATES
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fc;
    border-radius: 12px;
    border: 2px dashed #d1d3e2;
}

.empty-state-icon {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state h5 {
    color: #5a5c69;
    font-weight: 700;
    margin-bottom: 15px;
}

.empty-state p {
    color: #858796;
    margin-bottom: 20px;
}

/* ============================================
   11. RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .campaign-header {
        padding: 20px;
    }
    
    .campaign-header h3 {
        font-size: 22px;
    }
    
    .campaign-header-actions {
        flex-direction: column;
    }
    
    .campaign-header-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .email-content-row {
        grid-template-columns: 1fr;
    }
    
    .question-actions {
        flex-direction: column;
    }
    
    .question-actions .btn {
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}

/* ============================================
   12. ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.email-card {
    animation: fadeInUp 0.5s ease;
}

.email-card:nth-child(2) {
    animation-delay: 0.1s;
}

.email-card:nth-child(3) {
    animation-delay: 0.2s;
}

/* ============================================
   13. LOADING STATES
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4e73df;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   14. UTILITY CLASSES
   ============================================ */

.shadow-sm-custom {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
}

.shadow-md-custom {
    box-shadow: 0 3px 15px rgba(0,0,0,0.08) !important;
}

.shadow-lg-custom {
    box-shadow: 0 5px 25px rgba(0,0,0,0.12) !important;
}

.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) 1;
}
