.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.checkbox-label:hover {
    background-color: #f5f5f5;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

.search-summary {
    background: #e8f5e8;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.search-criteria {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.search-criteria pre {
    background: #fff;
    padding: 10px;
    border-radius: 3px;
    border: 1px solid #dee2e6;
    font-size: 12px;
    overflow-x: auto;
}

.email-item {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    background: #fff;
}

.email-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.placement-inbox { color: #28a745; font-weight: bold; }
.placement-spam { color: #dc3545; font-weight: bold; }
.placement-sent { color: #007bff; font-weight: bold; }
.placement-drafts { color: #6c757d; font-weight: bold; }
.placement-trash { color: #6c757d; font-weight: bold; }
.placement-promotions { color: #fd7e14; font-weight: bold; }
.placement-social { color: #20c997; font-weight: bold; }
.placement-updates { color: #6f42c1; font-weight: bold; }
.placement-forums { color: #e83e8c; font-weight: bold; }
.placement-other { color: #6c757d; font-weight: bold; }

/* Улучшенные стили для form-group */
.form-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-group:hover {
    background: #f1f3f4;
    border-color: #dee2e6;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    outline: none;
}

/* Стили для кнопки с загрузкой */
.search-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 150px;
}

.search-button:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.search-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

.search-button:disabled .spinner {
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Группировка результатов по почтовым ящикам */
.mailbox-group {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mailbox-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mailbox-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
}

.mailbox-emails {
    padding: 0;
}

.email-item {
    border: none;
    border-bottom: 1px solid #f1f3f4;
    margin-bottom: 0;
    border-radius: 0;
    background: #fff;
}

.email-item:last-child {
    border-bottom: none;
}

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

/* Стили для таблицы результатов */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.results-table th {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    color: #495057;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border: none;
}

.results-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: top;
    font-size: 14px;
}

.results-table tr:hover {
    background: #f8f9fa;
}

.results-table tr:last-child td {
    border-bottom: none;
}

.subject-cell {
    font-weight: 600;
    color: #2c3e50;
    max-width: 200px;
    word-wrap: break-word;
}

.from-cell, .to-cell {
    font-family: monospace;
    font-size: 13px;
    color: #495057;
    max-width: 200px;
    word-wrap: break-word;
    line-height: 1.4;
}

.date-cell {
    font-size: 13px;
    color: #6c757d;
    white-space: nowrap;
}

.placement-cell {
    text-align: center;
}

.mailbox-cell {
    font-family: monospace;
    font-size: 13px;
    color: #007bff;
    font-weight: 600;
}

.provider-cell {
    text-align: center;
    vertical-align: middle;
}

.provider-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.provider-icon-small {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
}

.provider-name-small {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
}

.folder-cell {
    font-size: 13px;
    color: #6c757d;
    font-style: italic;
}

.uid-cell {
    font-family: monospace;
    font-size: 12px;
    color: #6c757d;
    text-align: center;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .results-table {
        font-size: 12px;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 6px;
    }
    
    .subject-cell {
        max-width: 150px;
    }
    
    .from-cell, .to-cell {
        font-size: 11px;
        max-width: 120px;
        word-wrap: break-word;
        white-space: normal;
        line-height: 1.3;
    }
    
    .date-cell {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .results-table th:nth-child(6),
    .results-table td:nth-child(6),
    .results-table th:nth-child(7),
    .results-table td:nth-child(7) {
        display: none;
    }
}

/* Дополнительные улучшения */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5rem;
}

.search-summary {
    background: linear-gradient(135deg, #e8f5e8, #d4edda);
    border-left: 4px solid #28a745;
}

.search-criteria {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-left: 4px solid #2196f3;
}

.results h3 {
    color: #2c3e50;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

/* Стили для кнопки документации */
.documentation-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.documentation-button:hover {
    background: #218838;
    color: white;
    text-decoration: none;
}

.navigation-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    z-index: 1000;
}

.mailbox-management-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.mailbox-management-button:hover {
    background: #218838;
}

.documentation-item {
    display: block;
    padding: 12px 16px;
    color: #495057;
    text-decoration: none;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s;
}

.documentation-item:hover {
    background: #f8f9fa;
    color: #007bff;
}

.documentation-item:last-child {
    border-bottom: none;
}

.documentation-item .icon {
    margin-right: 8px;
    font-size: 16px;
}

/* Стили для кнопки авторизации */
.auth-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.auth-button.authenticated {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.auth-button.authenticated:hover {
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Модальное окно авторизации */
.auth-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 ease;
}

.auth-modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.auth-modal-header h2 {
    color: #333;
    margin: 0;
    font-size: 24px;
}

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

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

.auth-form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.auth-form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.auth-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.auth-btn-secondary {
    background: #6c757d;
    color: white;
}

.auth-btn-secondary:hover {
    background: #5a6268;
}

.auth-error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    display: none;
}

.auth-success {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    display: none;
}

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

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

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

/* Стили для кнопок импорт/экспорт */
.mailbox-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mailbox-actions .btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mailbox-actions .btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

.mailbox-actions .btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.4);
}

.mailbox-actions .btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

.mailbox-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.mailbox-actions .btn:disabled:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

/* Кнопка PDF в блоке результатов */
.results-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

/* Стили для переключателя вида отображения */
.view-toggle {
    display: flex;
    gap: 8px;
    background: #f8f9fa;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.toggle-label:hover {
    background: #e9ecef;
}

.toggle-label input[type="radio"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.toggle-label input[type="radio"]:checked + span {
    color: #aaaaaa;
    font-weight: 600;
}

.toggle-label:has(input[type="radio"]:checked) {
    background: #007bff;
    color: white;
}

.toggle-label:has(input[type="radio"]:checked):hover {
    background: #0056b3;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.4);
}

.btn-secondary:disabled,
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Стили для секции провайдеров */
.providers-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.providers-section h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.providers-icons {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.provider-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-width: 100px;
}

.provider-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.provider-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
}

.provider-name {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    text-align: center;
}

/* Адаптивность для секции провайдеров */
@media (max-width: 768px) {
    .providers-icons {
        gap: 20px;
    }
    
    .provider-item {
        min-width: 80px;
        padding: 12px;
    }
    
    .provider-icon {
        width: 28px;
        height: 28px;
    }
    
    .provider-name {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .providers-icons {
        gap: 15px;
    }
    
    .provider-item {
        min-width: 70px;
        padding: 10px;
    }
    
    .provider-icon {
        width: 24px;
        height: 24px;
    }
    
    .provider-name {
        font-size: 11px;
    }
}
