/* Email Access Container - Ferozo Webmail */
.email-access-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 40px 20px;
}

.email-access-card {
    background: white;
    border-radius: 12px;
    padding: 60px 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.email-access-icon {
    font-size: 64px;
    color: #3b82f6;
    margin-bottom: 24px;
}

.email-access-card h3 {
    font-size: 24px;
    color: #1e293b;
    margin-bottom: 16px;
    font-weight: 600;
}

.email-access-card p {
    color: #64748b;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.email-access-note {
    background: #f1f5f9;
    border-left: 4px solid #3b82f6;
    padding: 12px 16px;
    margin: 24px 0;
    border-radius: 4px;
    font-size: 14px;
    color: #475569;
    text-align: left;
}

.email-access-note i {
    color: #3b82f6;
    margin-right: 8px;
}

.btn-large {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 24px;
}

.btn-large i {
    margin-right: 8px;
}

/* Email Client Styles - Roundcube Style */

.email-client-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    height: calc(100vh - 200px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Email Sidebar */
.email-sidebar {
    background: #f8f9fa;
    border-right: 1px solid #e5e7eb;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.email-accounts-section h3,
.email-folders-section h3 {
    margin: 0 0 0.75rem 0;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.email-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.email-account-item {
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.email-account-item:hover {
    background: #f3f4f6;
    border-color: #3b82f6;
}

.email-account-item.active {
    background: #dbeafe;
    border-color: #3b82f6;
}

.email-account-info {
    flex: 1;
}

.email-account-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.email-account-email {
    font-size: 0.75rem;
    color: #6b7280;
}

.email-account-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #ef4444;
    color: white;
    border-radius: 12px;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.email-account-actions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.email-empty-accounts {
    text-align: center;
    padding: 2rem 1rem;
    color: #6b7280;
}

.email-empty-accounts i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.email-folders-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.email-folder {
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #374151;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.email-folder:hover {
    background: #f3f4f6;
}

.email-folder.active {
    background: #dbeafe;
    color: #3b82f6;
    font-weight: 600;
}

.email-folder i {
    margin-right: 0.5rem;
    width: 16px;
}

.email-folder-count {
    background: #e5e7eb;
    color: #6b7280;
    border-radius: 12px;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
}

.email-folder.active .email-folder-count {
    background: #3b82f6;
    color: white;
}

/* Email Main Content */
.email-main-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.email-list-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.email-list-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.email-list-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.email-list-search {
    flex: 1;
    max-width: 300px;
}

.email-list-search input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
}

.email-list {
    flex: 1;
    overflow-y: auto;
}

.email-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b7280;
    padding: 2rem;
}

.email-empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.email-item {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: start;
    gap: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.email-item:hover {
    background: #f9fafb;
}

.email-item.unread {
    background: #eff6ff;
    font-weight: 600;
}

.email-item.selected {
    background: #dbeafe;
}

.email-item-checkbox {
    padding-top: 0.25rem;
}

.email-item-content {
    flex: 1;
    min-width: 0;
}

.email-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.email-item-from {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
}

.email-item-date {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
}

.email-item-subject {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.email-item.unread .email-item-subject {
    font-weight: 700;
}

.email-item-preview {
    font-size: 0.75rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-item-attachment {
    color: #6b7280;
    font-size: 0.75rem;
    padding-top: 0.25rem;
}

/* Email Viewer */
.email-viewer-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.email-viewer-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.email-viewer-header-info {
    flex: 1;
}

.email-viewer-subject {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.email-viewer-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.email-viewer-meta strong {
    color: #374151;
    margin-right: 0.5rem;
}

.email-viewer-actions {
    display: flex;
    gap: 0.5rem;
}

.email-viewer-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    line-height: 1.6;
    color: #374151;
}

.email-viewer-body pre {
    white-space: pre-wrap;
    font-family: inherit;
}

.email-viewer-attachments {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.email-viewer-attachments h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.email-attachments-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.email-attachment-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.email-attachment-item i {
    color: #6b7280;
}

.email-attachment-size {
    margin-left: auto;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Email Configuration Section */
.email-config-section {
    margin-bottom: 30px;
}

.config-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.config-card h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.email-folders h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.email-folders ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.email-folders li {
    margin-bottom: 5px;
}

.email-folders a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.email-folders a:hover {
    background: #e9ecef;
    color: #2c3e50;
}

.email-folders a.active {
    background: #007bff;
    color: white;
}

.email-folder-count {
    background: #6c757d;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.email-folder-count.unread {
    background: #dc3545;
}

.email-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.email-actions .btn {
    width: 100%;
    justify-content: center;
}

/* Email Main Area */
.email-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Email Toolbar */
.email-toolbar {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.email-search {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 400px;
}

.email-search input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px 0 0 6px;
    border-right: none;
    font-size: 14px;
}

.email-search button {
    padding: 8px 12px;
    background: #007bff;
    color: white;
    border: 1px solid #007bff;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.email-search button:hover {
    background: #0056b3;
}

.email-filters select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

/* Email List */
.email-list {
    flex: 1;
    overflow-y: auto;
    background: white;
}

.email-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.email-item:hover {
    background: #f8f9fa;
}

.email-item.unread {
    background: #f0f8ff;
    border-left: 3px solid #007bff;
}

.email-item.selected {
    background: #e3f2fd;
}

.email-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.email-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.email-content {
    flex: 1;
    min-width: 0;
}

.email-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

.email-sender {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.email-date {
    color: #6c757d;
    font-size: 12px;
}

.email-subject {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-preview {
    color: #6c757d;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-actions-item {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.email-item:hover .email-actions-item {
    opacity: 1;
}

.email-action-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #f8f9fa;
    color: #6c757d;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 12px;
}

.email-action-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.email-action-btn.danger:hover {
    background: #dc3545;
    color: white;
}

/* Email Detail Modal */
.email-detail {
    max-height: 70vh;
    overflow-y: auto;
}

.email-detail-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.email-detail-subject {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.email-detail-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    color: #6c757d;
}

.email-detail-body {
    padding: 20px;
    line-height: 1.6;
    color: #495057;
}

.email-detail-body pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Attachments */
.email-attachments {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.email-attachments h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #495057;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 8px;
}

.attachment-icon {
    color: #6c757d;
    font-size: 16px;
}

.attachment-info {
    flex: 1;
}

.attachment-name {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.attachment-size {
    color: #6c757d;
    font-size: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .email-interface {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .email-sidebar {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .email-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .email-search {
        max-width: none;
    }
    
    .email-item {
        padding: 12px 15px;
    }
    
    .email-avatar {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
}

/* Loading States */
.email-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6c757d;
}

.email-loading i {
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Empty State */
.email-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6c757d;
    text-align: center;
}

.email-empty i {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.email-empty h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #495057;
}

.email-empty p {
    margin: 0;
    font-size: 14px;
}

/* Status Indicators */
.email-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.email-status.unread {
    background: #007bff;
}

.email-status.read {
    background: #6c757d;
}

.email-status.important {
    background: #dc3545;
}

/* Form Enhancements */
.form-group label input[type="checkbox"] {
    margin-right: 8px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}
