* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.email-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.email-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.label {
    color: #666;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.email-address {
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
    word-break: break-all;
    flex: 1;
}

.copy-btn {
    background: none;
    border: none;
    font-size: 1.4em;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #f0f0f0;
}

.timer-container {
    margin-bottom: 20px;
}

.timer {
    text-align: center;
    font-size: 1.2em;
    color: #28a745;
    margin-bottom: 5px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 100%;
    transition: width 1s linear;
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

.inbox-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: white;
}

.inbox-header h2 {
    font-size: 1.5em;
}

.badge {
    background: #ffc107;
    color: #333;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: bold;
}

.inbox {
    background: white;
    border-radius: 10px;
    padding: 20px;
    min-height: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.message {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: box-shadow 0.3s;
}

.message:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #666;
    font-size: 0.9em;
}

.message-from {
    font-weight: 600;
    color: #333;
}

.message-subject {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.message-body {
    color: #666;
    line-height: 1.6;
    max-height: 200px;
    overflow: hidden;
    position: relative;
}

.message-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(transparent, white);
}

.loading {
    text-align: center;
    color: #999;
    padding: 40px;
}

.no-messages {
    text-align: center;
    color: #999;
    padding: 40px;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    opacity: 0.8;
    font-size: 0.9em;
}

.message {
    cursor: pointer;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 750px;
    margin: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: #999;
    line-height: 1;
    z-index: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-subject {
    font-size: 1.3em;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    padding-right: 30px;
}

.modal-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85em;
    color: #666;
    flex-wrap: wrap;
}

.modal-body {
    padding: 20px 24px 24px;
}

#modal-iframe {
    width: 100%;
    border: none;
    min-height: 300px;
    display: none;
}

#modal-text {
    white-space: pre-wrap;
    color: #444;
    line-height: 1.7;
    font-size: 0.95em;
}

@media (max-width: 600px) {
    .email-address {
        font-size: 1.1em;
    }

    .email-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .copy-btn {
        align-self: flex-end;
    }
}