/* Email Service Wrapper Styles for Tenant */

#email-content {
    width: 100%;
    min-height: calc(100vh - 120px);
    margin: 0;
    padding: 0;
}

/* Loading states */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    background: #f5f5f5;
    font-size: 14px;
}

.status-indicator.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-indicator.error {
    background: #ffebee;
    color: #c62828;
}

/* Email wrapper container */
.email-wrapper-container {
    padding: 20px;
    min-height: calc(100vh - 120px);
}

.email-wrapper-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.email-wrapper-status {
    display: flex;
    align-items: center;
}

.email-content-area {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 500px;
    padding: 20px;
}

/* Compose Modal Styles */
.email-compose-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compose-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.compose-window {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    background: var(--theme-bg-secondary);
    border: 1px solid var(--theme-border-light);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px var(--theme-shadow-dark);
    overflow: hidden;
}

.compose-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--theme-bg-tertiary);
    border-bottom: 1px solid var(--theme-border-light);
}

.compose-title {
    font-weight: 600;
    color: var(--theme-text-heading);
}

.compose-actions {
    display: flex;
    gap: 8px;
}

.compose-actions button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--theme-text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.compose-actions button:hover {
    background: var(--theme-bg-hover);
    color: var(--theme-text-heading);
}

.compose-actions .btn-close:hover {
    background: #e74c3c;
    color: white;
}

.compose-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.compose-field {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--theme-border-light);
}

.compose-field label {
    width: 60px;
    font-size: 13px;
    color: var(--theme-text-muted);
}

.compose-field .field-input {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    color: var(--theme-text-primary);
    font-size: 14px;
}

.compose-field .field-input:focus {
    outline: none;
}

.compose-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--theme-border-light);
    flex-wrap: wrap;
}

.editor-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--theme-text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.editor-btn:hover {
    background: var(--theme-bg-hover);
    color: var(--theme-text-heading);
}

.editor-separator {
    width: 1px;
    height: 20px;
    background: var(--theme-border-light);
    margin: 0 4px;
}

.editor-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    color: var(--theme-text-primary);
    font-size: 14px;
    line-height: 1.6;
}

.editor-body:focus {
    outline: none;
}

.compose-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid var(--theme-border-light);
}

.compose-footer .btn-send {
    padding: 10px 24px;
    background: var(--theme-text-accent);
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.compose-footer .btn-send:hover {
    filter: brightness(1.1);
}

.compose-footer .btn-secondary {
    padding: 10px 16px;
    background: transparent;
    color: var(--theme-text-muted);
    border: 1px solid var(--theme-border-medium);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.compose-footer .btn-secondary:hover {
    background: var(--theme-bg-hover);
    color: var(--theme-text-heading);
}
