/* AHA Mail SMTP Admin Styles v2.0.0 */

.aha-mail-smtp-admin {
    max-width: 1200px;
}

.aha-mail-smtp-admin h1 {
    margin-bottom: 20px;
    color: #1d2327;
    font-size: 23px;
    font-weight: 400;
    line-height: 1.3;
}

/* Enhanced Navigation Tabs with Smooth Transitions */
.nav-tab-wrapper {
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 30px;
    background: #fff;
    padding: 0 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    position: relative;
    border-radius: 8px 8px 0 0;
}

.nav-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6b7280;
    text-decoration: none;
    padding: 16px 28px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    display: inline-block;
    margin: 0 8px 0 0;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
}

.nav-tab:hover {
    background: rgba(59, 130, 246, 0.05);
    color: #3b82f6;
    border-bottom-color: rgba(59, 130, 246, 0.3);
}

.nav-tab-active {
    background: transparent;
    border-bottom: 3px solid #3b82f6;
    color: #3b82f6;
    font-weight: 600;
}

.nav-tab-active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    animation: tabSlideIn 0.3s ease;
}

@keyframes tabSlideIn {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* Toast Notification Styles */
.aha-toast-container {
    position: fixed;
    top: 32px;
    right: 20px;
    z-index: 999999;
    pointer-events: none;
}

.aha-toast {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 16px 20px;
    margin-bottom: 12px;
    min-width: 320px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: right center;
    border-left: 4px solid #3b82f6;
}

.aha-toast.toast-success {
    border-left-color: #10b981;
}

.aha-toast.toast-error {
    border-left-color: #ef4444;
}

.aha-toast.toast-warning {
    border-left-color: #f59e0b;
}

.aha-toast.toast-info {
    border-left-color: #3b82f6;
}

.aha-toast.toast-hiding {
    animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100px) scale(0.8);
    }
}

.aha-toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

.toast-success .aha-toast-icon {
    background: #d1fae5;
    color: #10b981;
}

.toast-error .aha-toast-icon {
    background: #fee2e2;
    color: #ef4444;
}

.toast-warning .aha-toast-icon {
    background: #fef3c7;
    color: #f59e0b;
}

.toast-info .aha-toast-icon {
    background: #dbeafe;
    color: #3b82f6;
}

.aha-toast-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
}

.aha-toast-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.aha-toast-message {
    font-size: 13px;
    color: #6b7280;
}

.aha-toast-close {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.aha-toast-close:hover {
    opacity: 1;
}

/* Tab Content Fade In Animation */
.tab-content {
    animation: fadeInContent 0.4s ease;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card Layout */
.aha-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.aha-card-header {
    padding: 20px 20px 0;
    border-bottom: none;
}

.aha-card-header h2 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.aha-card-header p {
    margin: 0 0 20px;
    color: #646970;
    font-size: 14px;
    line-height: 1.5;
}

.aha-card-body {
    padding: 0 20px 20px;
}

/* Provider Selection Grid - 4 Columns Layout */
.provider-selection-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 20px 0;
}

.provider-card {
    height: 130px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.provider-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.2);
    transform: translateY(-3px);
}

.provider-card.selected {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25);
    transform: translateY(-3px);
}

.provider-icon {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 26px;
    color: #fff;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.provider-icon i {
    font-size: 28px;
}

.provider-icon-text {
    font-size: 26px;
    font-weight: bold;
    color: #fff;
    line-height: 1;
}

.provider-info {
    text-align: center;
}

.provider-name {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0;
    line-height: 1.3;
}

.provider-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
    margin-top: 4px;
}

.api-badge {
    background: #10b981;
}

/* Mode Selection - Same Style as Provider Selection */
.mode-selection-card {
    margin-top: 20px;
    display: none;
}

.mode-selection-card.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.mode-selection-grid {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.mode-card {
    flex: 1;
    min-height: 140px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mode-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.mode-card.selected {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.mode-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.mode-icon i {
    font-size: 22px;
}

.mode-info {
    flex: 1;
}

.mode-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px;
}

.mode-description {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
    margin: 0 0 12px;
}

.mode-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.recommended-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #fff;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
    border: 1px solid #f59e0b;
}

.api-recommended-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #fff;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
    border: 1px solid #f59e0b;
    display: inline-block;
}

.smtp-recommended-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #fff;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
    border: 1px solid #f59e0b;
    display: inline-block;
}

/* Provider Colors - Matching Reference Image */
.provider-card[data-provider="generic"] .provider-icon {
    background: #3b82f6;
}

.provider-card[data-provider="amazon_ses"] .provider-icon {
    background: #ff9900;
}

.provider-card[data-provider="sendgrid"] .provider-icon {
    background: #00d4ff;
}

.provider-card[data-provider="mailgun"] .provider-icon {
    background: #e91e63;
}

.provider-card[data-provider="brevo"] .provider-icon {
    background: #00bcd4;
}

.provider-card[data-provider="gmail"] .provider-icon {
    background: #ea4335;
}

.provider-card[data-provider="outlook"] .provider-icon {
    background: #0078d4;
}

.provider-card[data-provider="zoho"] .provider-icon {
    background: #c9302c;
}

.provider-card[data-provider="smtp2go"] .provider-icon {
    background: #4caf50;
}

/* Mode Colors */
.mode-card[data-mode="smtp"] .mode-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.mode-card[data-mode="api"] .mode-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Form Elements */
.form-table {
    margin-top: 0;
}

.form-table th {
    width: 200px;
    padding: 15px 10px 15px 0;
    vertical-align: top;
    font-weight: 600;
}

.form-table td {
    padding: 15px 0;
    vertical-align: top;
}

.form-table input[type="text"],
.form-table input[type="email"],
.form-table input[type="password"],
.form-table input[type="number"],
.form-table select,
.form-table textarea {
    border: 1px solid #8c8f94;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.2s ease;
}

.form-table input[type="text"]:focus,
.form-table input[type="email"]:focus,
.form-table input[type="password"]:focus,
.form-table input[type="number"]:focus,
.form-table select:focus,
.form-table textarea:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.form-table .regular-text {
    width: 25em;
}

.form-table .small-text {
    width: 6em;
}

.form-table .large-text {
    width: 100%;
    max-width: 500px;
}

.form-table .description {
    margin: 5px 0 0;
    color: #646970;
    font-size: 13px;
    font-style: italic;
}

/* Checkboxes */
.form-table input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

.form-table label {
    display: inline-flex;
    align-items: center;
    font-weight: 400;
}

/* Buttons */
.button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.button {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    color: #2c3338;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.button:hover {
    background: #fff;
    border-color: #8c8f94;
    color: #1d2327;
}

/* Status Messages */
.notice {
    background: #fff;
    border-left: 4px solid #00a32a;
    padding: 12px;
    margin: 15px 0;
    border-radius: 0 4px 4px 0;
}

.notice.notice-error {
    border-left-color: #d63638;
}

.notice.notice-warning {
    border-left-color: #dba617;
}

.notice.notice-info {
    border-left-color: #72aee6;
}

.notice p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Loading States */
.button.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.button.loading::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Email Logs Table */
.wp-list-table {
    margin-top: 15px;
}

.wp-list-table th,
.wp-list-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #c3c4c7;
}

.wp-list-table th {
    background: #f6f7f7;
    font-weight: 600;
}

.wp-list-table tbody tr:hover {
    background: #f6f7f7;
}

/* Status Indicators */
.status-success {
    color: #00a32a;
    font-weight: 600;
}

.status-failed {
    color: #d63638;
    font-weight: 600;
}

.status-pending {
    color: #dba617;
    font-weight: 600;
}

/* SMTP Auth Fields Toggle */
.smtp-auth-fields {
    transition: opacity 0.3s ease;
}

.smtp-auth-fields.disabled {
    opacity: 0.5;
}

.smtp-auth-fields.disabled input {
    background: #f6f7f7;
    cursor: not-allowed;
}

/* Import/Export Section */
#import-file {
    margin-right: 10px;
    padding: 6px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
}

/* Test Email Form */
#test-email-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
}

#test-email-result.success {
    background: #d1e7dd;
    border: 1px solid #badbcc;
    color: #0f5132;
}

#test-email-result.error {
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    color: #842029;
}

/* Settings Sections Visibility */
.smtp-settings-section {
    display: block;
}

.api-settings-section {
    display: none;
}

.api-settings-section.show {
    display: block;
}

/* Responsive Design for 4-Column Grid */
@media screen and (max-width: 1024px) {
    .provider-selection-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .mode-selection-grid {
        gap: 15px;
    }
}

@media screen and (max-width: 782px) {
    .aha-card-header,
    .aha-card-body {
        padding: 15px;
    }
    
    .provider-selection-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .provider-card {
        height: 110px;
        padding: 15px;
    }
    
    .provider-icon {
        width: 44px;
        height: 44px;
        font-size: 22px;
        margin-bottom: 8px;
    }
    
    .provider-icon i {
        font-size: 24px;
    }
    
    .provider-icon-text {
        font-size: 22px;
    }
    
    .provider-name {
        font-size: 13px;
    }
    
    .mode-selection-grid {
        flex-direction: column;
        gap: 12px;
    }
    
    .mode-card {
        padding: 20px;
        flex-direction: column;
        text-align: center;
        gap: 12px;
        min-height: auto;
    }
    
    .mode-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
        align-self: center;
    }
    
    .form-table th,
    .form-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }
    
    .form-table th {
        border-bottom: none;
        padding-bottom: 5px;
    }
    
    .form-table .regular-text,
    .form-table .large-text {
        width: 100%;
    }
    
    .nav-tab {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .aha-toast-container {
        right: 10px;
        left: 10px;
    }
    
    .aha-toast {
        min-width: auto;
        max-width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .provider-selection-grid {
        grid-template-columns: 1fr;
    }
}

/* Enhanced Provider Selection */
#provider {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 30px;
}

/* Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1d2327;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Setup Wizard Styles (for future implementation) */
.aha-wizard {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    overflow: hidden;
}

.aha-wizard-header {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff;
    padding: 30px;
    text-align: center;
}

.aha-wizard-steps {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: #f6f7f7;
    border-bottom: 1px solid #c3c4c7;
}

.aha-wizard-step {
    display: flex;
    align-items: center;
    margin: 0 15px;
    color: #646970;
}

.aha-wizard-step.active {
    color: #2271b1;
    font-weight: 600;
}

.aha-wizard-step.completed {
    color: #00a32a;
}

.aha-wizard-content {
    padding: 30px;
    min-height: 400px;
}

.aha-wizard-footer {
    padding: 20px 30px;
    background: #f6f7f7;
    border-top: 1px solid #c3c4c7;
    text-align: right;
}

.aha-wizard-footer .button {
    margin-left: 10px;
}

/* ============================================
   Wizard Overlay Styles (moved from inline PHP)
   ============================================ */
.aha-wizard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aha-wizard-overlay .aha-wizard {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.provider-option {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.provider-option:hover,
.provider-option.selected {
    border-color: #2271b1;
    background: #f0f6fc;
}

.provider-logo img {
    max-width: 60px;
    max-height: 40px;
    margin-bottom: 10px;
}

.oauth-badge {
    display: inline-block;
    background: #00a32a;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-top: 5px;
}

.wizard-step-icon {
    text-align: center;
    margin-bottom: 20px;
}

.wizard-step-icon .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #2271b1;
}

.wizard-step-icon.success .dashicons {
    color: #00a32a;
}
