/**
 * Encios WP Mail - Ver Enviados Styles
 * Clean, modern styling for email logs viewer
 */

/* Container */
.encioswpmail-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 100%;
    margin: 20px 0;
}

/* Error Message */
.encioswpmail-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left: 4px solid #dc2626;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.encioswpmail-error p {
    margin: 5px 0;
    color: #991b1b;
}

/* Search Form */
.encioswpmail-search-form {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.encioswpmail-search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.encioswpmail-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.encioswpmail-search-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.encioswpmail-search-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.encioswpmail-clear-search {
    padding: 12px 16px;
    background: #f1f5f9;
    color: #64748b;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: background 0.2s;
}

.encioswpmail-clear-search:hover {
    background: #e2e8f0;
    color: #475569;
}

.search-hint {
    margin: 10px 0 0 0;
    font-size: 13px;
    color: #64748b;
}

/* No Results */
.encioswpmail-no-results {
    text-align: center;
    padding: 40px 20px;
    background: #f8fafc;
    border-radius: 12px;
    color: #64748b;
}

/* Table Wrapper */
.encioswpmail-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Table */
.encioswpmail-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
}

.encioswpmail-table thead {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.encioswpmail-table th {
    padding: 14px 16px;
    text-align: left;
    color: white;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.encioswpmail-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s;
}

.encioswpmail-table tbody tr:hover {
    background: #f8fafc;
}

.encioswpmail-table tbody tr:last-child {
    border-bottom: none;
}

.encioswpmail-table td {
    padding: 14px 16px;
    color: #334155;
    vertical-align: top;
}

/* Column specific styles */
.col-date {
    white-space: nowrap;
    color: #64748b;
    font-size: 13px;
}

.col-subject {
    font-weight: 500;
    max-width: 300px;
    word-wrap: break-word;
}

.col-recipients {
    max-width: 250px;
    word-wrap: break-word;
    font-size: 13px;
    color: #64748b;
}

.col-status {
    white-space: nowrap;
}

.col-mailer {
    font-size: 13px;
    color: #64748b;
}

.col-content {
    max-width: 200px;
}

.content-preview {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-sent {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.status-delivered {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}

.status-waiting {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.status-failed {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

.error-icon {
    margin-left: 5px;
    cursor: help;
}

/* Pagination */
.encioswpmail-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding: 15px 20px;
    background: #f8fafc;
    border-radius: 12px;
}

.pagination-info {
    font-size: 14px;
    color: #64748b;
}

.pagination-links {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.page-link {
    display: inline-block;
    padding: 8px 14px;
    background: white;
    color: #334155;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.page-link:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.page-link.current {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: #3b82f6;
    font-weight: 600;
}

.page-link.first,
.page-link.last {
    font-weight: 600;
}

.page-dots {
    padding: 8px 5px;
    color: #94a3b8;
}

/* Actions Column */
.encioswpmail-table th:last-child,
.encioswpmail-table td:last-child {
    text-align: center;
    width: 120px;
}

.encios-btn-view,
.encios-btn-resend {
    margin: 0 4px !important;
    padding: 2px 8px !important;
    min-height: auto !important;
    line-height: 1.5 !important;
}

/* Modals */
.encios-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.encios-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: slideIn 0.3s;
}

.encios-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
}

.encios-modal-close:hover,
.encios-modal-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.encios-modal-content h2 {
    margin: 0;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
    border-radius: 8px 8px 0 0;
}

.encios-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

#encios-view-content-area {
    background: #fff;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.spinner {
    background: url(images/spinner.gif) no-repeat;
    background-size: 20px 20px;
    display: inline-block;
    visibility: hidden;
    float: none;
    vertical-align: middle;
    opacity: 0.7;
    filter: alpha(opacity=70);
    width: 20px;
    height: 20px;
    margin: 0 10px;
}

#encios-resend-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

#encios-resend-message.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#encios-resend-message.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0
    }

    to {
        transform: translateY(0);
        opacity: 1
    }
}

/* Responsive */
@media (max-width: 768px) {
    .encioswpmail-search-form {
        padding: 15px;
    }

    .search-input-group {
        flex-direction: column;
    }

    .encioswpmail-search-input {
        min-width: 100%;
    }

    .encioswpmail-search-button,
    .encioswpmail-clear-search {
        width: 100%;
        text-align: center;
    }

    .encioswpmail-table th,
    .encioswpmail-table td {
        padding: 10px 12px;
    }

    .encioswpmail-pagination {
        flex-direction: column;
        text-align: center;
    }

    .pagination-links {
        justify-content: center;
    }

    /* Hide some columns on mobile */
    .col-mailer {
        display: none;
    }

    .col-content {
        display: none;
    }
}

@media (max-width: 480px) {
    .encioswpmail-table {
        font-size: 13px;
    }

    .page-link {
        padding: 6px 10px;
        font-size: 13px;
    }

    .page-link.first,
    .page-link.last {
        display: none;
    }
}

/* View Modal Header Styles */
.encios-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    padding-right: 30px;
    /* Space for close button */
}

.encios-view-header h2 {
    margin: 0;
    border-bottom: none;
    /* Remove default border from h2 */
    padding: 0;
    background: none;
}

.encios-copy-wrapper {
    display: flex;
    align-items: center;
}

#encios-copy-msg {
    margin-left: 10px;
    font-size: 0.9em;
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
    padding: 3px 8px;
    border-radius: 4px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}