* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.email-generator {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.email-display {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.email-text {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    word-break: break-all;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-copy {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.btn-copy:hover {
    background: #218838;
}

.email-info {
    background: #fff3cd;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    border-left: 4px solid #ffc107;
}

.email-info p {
    margin: 5px 0;
    color: #856404;
}

.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.tab-btn {
    flex: 1;
    padding: 20px;
    background: none;
    border: none;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s;
    color: #6c757d;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

.tab-content {
    display: none;
    padding: 30px;
    min-height: 400px;
}

.tab-content.active {
    display: block;
}

.email-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.email-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid #667eea;
}

.email-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.email-item.unread {
    background: #e7f3ff;
    border-left-color: #007bff;
    font-weight: 600;
}

.email-from {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 5px;
}

.email-subject {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 5px;
}

.email-preview {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.email-date {
    color: #adb5bd;
    font-size: 0.85em;
}

.no-emails {
    text-align: center;
    color: #6c757d;
    padding: 60px 20px;
    font-size: 1.1em;
}

.send-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover {
    color: #000;
}

#emailContent {
    margin-top: 20px;
}

#emailContent h2 {
    color: #667eea;
    margin-bottom: 10px;
}

#emailContent .email-meta {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

#emailContent .email-body {
    line-height: 1.6;
    color: #333;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .email-display {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-copy {
        width: 100%;
    }
    
    .tabs {
        flex-direction: column;
    }
}
/* Стили для отображения писем в модальном окне */
#emailContent {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

#emailContent h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

#emailContent .email-meta {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid #667eea;
}

#emailContent .email-meta p {
    margin: 8px 0;
    color: #495057;
    font-size: 0.95em;
}

#emailContent .email-meta strong {
    color: #212529;
    font-weight: 600;
    min-width: 60px;
    display: inline-block;
}

#emailContent .email-body {
    background: white;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    line-height: 1.8;
    color: #212529;
    font-size: 1em;
    min-height: 100px;
    max-height: 500px;
    overflow-y: auto;
}

/* Стили для HTML контента внутри письма */
#emailContent .email-body div {
    margin-bottom: 10px;
}

#emailContent .email-body p {
    margin: 10px 0;
}

#emailContent .email-body a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid #667eea;
}

#emailContent .email-body a:hover {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

#emailContent .email-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

#emailContent .email-body blockquote {
    border-left: 4px solid #667eea;
    padding-left: 15px;
    margin: 15px 0;
    color: #6c757d;
    font-style: italic;
}

#emailContent .email-body pre {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

#emailContent .email-body code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

#emailContent .email-body hr {
    border: none;
    border-top: 2px solid #e9ecef;
    margin: 20px 0;
}

#emailContent .email-body ul,
#emailContent .email-body ol {
    padding-left: 25px;
    margin: 10px 0;
}

#emailContent .email-body li {
    margin: 5px 0;
}

#emailContent .email-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

#emailContent .email-body table td,
#emailContent .email-body table th {
    border: 1px solid #dee2e6;
    padding: 10px;
    text-align: left;
}

#emailContent .email-body table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* Скроллбар для тела письма */
#emailContent .email-body::-webkit-scrollbar {
    width: 8px;
}

#emailContent .email-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#emailContent .email-body::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

#emailContent .email-body::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Адаптивность для модального окна */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
        max-height: 85vh;
    }
    
    #emailContent h2 {
        font-size: 1.4em;
    }
    
    #emailContent .email-meta {
        padding: 15px;
    }
    
    #emailContent .email-body {
        padding: 15px;
        font-size: 0.95em;
    }
}

/* Защита от вредоносного CSS в письмах */
#emailContent .email-body * {
    max-width: 100% !important;
}

#emailContent .email-body script,
#emailContent .email-body iframe {
    display: none !important;
}
