/* Modern Email Referred Reports Styles */

.email-reports-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 20px;
    animation: fadeInUp 0.5s ease;
}

.email-reports-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
    color: white;
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.email-reports-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.email-reports-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    color: white !important;
}

.email-reports-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 8px 0 0 0;
    position: relative;
    z-index: 1;
}

/* Configuration Panels Grid */
.config-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    padding: 24px 32px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

/* Individual Config Panels */
.config-panel {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.config-panel:hover {
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(45, 90, 61, 0.1);
}

/* Panel Headers */
.panel-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: white;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-green);
    margin: 0 0 8px 0;
}

.panel-icon {
    font-size: 1.4rem;
    padding: 8px;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.panel-description {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

/* Panel Content */
.panel-content {
    padding: 20px 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--primary-green);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    color: #1e293b;
    cursor: pointer;
}

.modern-select:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.1);
    transform: translateY(-2px);
}

/* Clients Panel */
.clients-panel {
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

.clients-panel .panel-header {
    padding: 24px 32px 20px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.clients-stats {
    display: flex;
    gap: 24px;
}

.stats-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stats-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-green);
    line-height: 1;
}

.stats-label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.clients-list-container {
    padding: 24px 32px;
}

.clients-list {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    padding: 16px;
}

.clients-list label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-weight: 500;
    color: #334155;
}

.clients-list label:hover {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-color: var(--primary-green);
    transform: translateX(4px);
}

.clients-list input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-green);
    cursor: pointer;
}

.clients-list label:has(input:checked) {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border-color: #10b981;
    font-weight: 600;
}

/* Preview Panel */
.preview-panel {
    background: white;
}

.preview-panel .panel-header {
    padding: 24px 32px 20px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

.preview-container {
    padding: 24px 32px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    align-items: start;
}

.pdf-viewer-container {
    background: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    position: relative;
    height: 600px;
}

.pdf-viewer {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.no-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #64748b;
    background: white;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.no-preview-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-preview-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #334155;
}

.no-preview-text {
    font-size: 1rem;
    opacity: 0.8;
}

/* Send Controls */
.send-controls {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.email-summary {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 16px;
    padding: 20px;
    border: 2px solid #e2e8f0;
}

.summary-item {
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.summary-item strong {
    color: var(--primary-green);
    font-weight: 600;
}

.send-email-btn {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(45, 90, 61, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 56px;
}

.send-email-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(45, 90, 61, 0.4);
}

.send-email-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    box-shadow: none;
}

.btn-icon {
    font-size: 1.2rem;
}

/* Legacy Panel Styles (for compatibility) */
.panel {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.panel h3 {
    margin: 0 0 16px 0;
    color: var(--primary-green);
    font-weight: 700;
    font-size: 1.2rem;
}

.list {
    max-height: 200px;
    overflow: auto;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    background: #f8fafc;
}

.list label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.list label:hover {
    background: white;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .preview-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .pdf-viewer-container {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .email-reports-container {
        margin: 10px;
        border-radius: 12px;
    }

    .email-reports-header {
        padding: 24px 20px;
    }

    .email-reports-title {
        font-size: 2rem;
    }

    .config-panels {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
    }

    .clients-panel .panel-header {
        padding: 20px;
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }

    .clients-stats {
        justify-content: space-around;
        width: 100%;
    }

    .clients-list-container,
    .preview-container {
        padding: 20px;
    }

    .pdf-viewer-container {
        height: 300px;
    }

    .no-preview-icon {
        font-size: 3rem;
    }

    .no-preview-title {
        font-size: 1.2rem;
    }

    .panel-title {
        font-size: 1.1rem;
    }

    .panel-icon {
        min-width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
}