/* General Styles */
body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Container */
.email-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px 30px;
}

/* Dashboard Navigation */
.dashboard-nav {
    margin-bottom: 20px;
}

.btn-dashboard {
    background-color: #495057;
    border-color: #495057;
    color: white;
    padding: 8px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-dashboard:hover {
    background-color: #343a40;
    border-color: #343a40;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-dashboard i {
    margin-right: 6px;
}

/* Header */
.email-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.email-header h1 {
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.email-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Email Box */
.email-box {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    height: 100%;
}

.email-box h4 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.email-box h4 i {
    margin-right: 8px;
    color: #667eea;
}

/* Form Controls */
.form-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.form-control {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.input-group .btn-outline-secondary {
    border-color: #dee2e6;
}

.input-group .btn-outline-secondary:hover {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #667eea;
    border-color: #667eea;
}

.btn-primary:hover {
    background-color: #5a67d8;
    border-color: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Inbox Styles */
#inboxList {
    max-height: 450px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

/* Custom scrollbar for inbox */
#inboxList::-webkit-scrollbar {
    width: 6px;
}

#inboxList::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#inboxList::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

#inboxList::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}

.inbox-item {
    border-bottom: 1px solid #e9ecef;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.inbox-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.inbox-item:last-child {
    border-bottom: none;
}

.email-subject {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 1.05rem;
}

.email-from {
    color: #666;
    font-size: 0.9rem;
}

.email-date {
    color: #999;
    font-size: 0.85rem;
    position: absolute;
    right: 15px;
    top: 15px;
}

/* Message Viewer */
.message-viewer {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.message-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.message-header h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.message-header p {
    margin-bottom: 8px;
    color: #555;
}

.message-header strong {
    color: #333;
    font-weight: 600;
}

.message-body {
    line-height: 1.6;
    color: #333;
    font-size: 1rem;
}

.message-body pre {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* Attachment Styles */
.attachment-item {
    display: inline-block;
    margin: 5px;
    padding: 8px 15px;
    background-color: #e9ecef;
    border-radius: 5px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.attachment-item:hover {
    background-color: #dee2e6;
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.attachment-item i {
    margin-right: 5px;
}

/* Loading and Empty States */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.empty-inbox {
    text-align: center;
    padding: 60px;
    color: #999;
}

.empty-inbox i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-inbox p {
    font-size: 1.1rem;
}

/* Welcome Message */
#welcomeMessage {
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

#welcomeMessage i {
    font-size: 4rem;
    color: #667eea;
    opacity: 0.5;
}

#welcomeMessage h3 {
    color: #333;
    margin-top: 20px;
}

#welcomeMessage p {
    color: #666;
    font-size: 1.1rem;
}

/* Alert Messages */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
    border: 1px solid #f5c6cb;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
}

.alert {
    border-radius: 6px;
    margin-bottom: 20px;
}

/* Make columns equal height */
.row {
    display: flex;
    flex-wrap: wrap;
}

.row > [class*='col-'] {
    display: flex;
    flex-direction: column;
}

/* Responsive Design */
@media (max-width: 991px) {
    .email-container {
        max-width: 100%;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .email-container {
        padding: 10px;
    }
    
    .email-header {
        padding: 20px;
    }
    
    .email-header h1 {
        font-size: 2rem;
    }
    
    .email-box {
        padding: 15px;
    }
    
    .message-viewer {
        padding: 20px;
    }
    
    .email-date {
        position: static;
        display: block;
        margin-top: 5px;
    }
    
    .inbox-item {
        padding: 12px;
    }
    
    .inbox-item:hover {
        transform: none;
    }
    
    /* Adjust inbox height for mobile */
    #inboxList {
        max-height: 300px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.email-box, .message-viewer {
    animation: fadeIn 0.3s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Email Content Styles */
.email-content-frame {
    margin-top: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background-color: white;
}

#htmlFrame {
    width: 100%;
    border: none;
    min-height: 400px;
    background-color: white;
    display: block;
}

.email-content-text {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.email-content-text pre {
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

/* User Generator Styles */
.user-info-item {
    margin-bottom: 10px;
}

.user-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info-label {
    color: #495057;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 80px;
    flex-shrink: 0;
}

.user-info-input {
    flex: 1;
    margin: 0 8px;
    padding: 6px 10px !important;
    font-size: 0.9rem !important;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

.user-info-input:focus {
    background-color: white;
    border-color: #667eea;
    box-shadow: 0 0 0 0.1rem rgba(102, 126, 234, 0.25);
}

.btn-copy {
    padding: 2px 8px;
    font-size: 0.8rem;
    border: 1px solid #dee2e6;
    background-color: white;
    color: #6c757d;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-copy:hover {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
}

.address-info {
    color: #212529;
    font-size: 0.95rem;
    line-height: 1.5;
}

#userInfo {
    margin-top: 15px;
}

#userPassword {
    font-family: monospace;
}

/* Utility Classes */
.text-muted {
    color: #6c757d !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 0.25rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

.w-100 {
    width: 100% !important;
}

/* Hover Effects */
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.email-box:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Focus States */
button:focus,
.btn:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Notification Popup Styles */
.notification-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    z-index: 9999;
    max-width: 350px;
}

.notification-popup.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-popup i {
    font-size: 20px;
}

.notification-success {
    border-left: 4px solid #28a745;
}

.notification-success i {
    color: #28a745;
}

.notification-error {
    border-left: 4px solid #dc3545;
}

.notification-error i {
    color: #dc3545;
}

/* Mobile responsive for notifications */
@media (max-width: 480px) {
    .notification-popup {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Print Styles */
@media print {
    .email-header,
    .btn,
    .email-box:first-child {
        display: none;
    }
    
    .message-viewer {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}
