/**
 * Дополнительные стили для новой системы рейтинга
 * Версия: 1.0.9
 */

/* Исправление центрирования контента */
.main {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Контейнер контента */
.content_rating {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
}

.content_rating_content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px 0;
}

/* Заголовок */
.content_rating_content h1 {
    font-size: 28px;
    margin-bottom: 30px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 15px;
}

/* Компания в списке */
.binary_box {
    margin-bottom: 25px;
    border-radius: 10px;
    overflow: visible;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.binary_box:hover {
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.binary_box_r {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
}

.binary_box_l {
    background: white;
    margin: 2px;
    border-radius: 8px;
}

.binary_box_c {
    padding: 20px !important;
}

/* Основной рейтинг - компактный вид */
.main_rating_container {
    position: relative;
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.main_rating_container:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.main_rating label {
    font-weight: bold;
    color: #495057;
    font-size: 13px;
    margin: 0;
}

.rating_display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stars_display {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 18px;
    transition: all 0.2s ease;
}

.star.filled {
    color: #ffc107;
    text-shadow: 0 0 3px rgba(255, 193, 7, 0.3);
}

.star.half {
    color: #ffc107;
    opacity: 0.6;
}

.star.empty {
    color: #dee2e6;
}

.rating_number {
    font-weight: bold;
    font-size: 14px;
    color: #495057;
    padding: 2px 8px;
    background: white;
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

/* Расширяемый контейнер рейтинга */
.rating_summary {
    padding: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.rating_summary:hover {
    background: #f8f9fa;
}

/* Детальные рейтинги - расширяемые */
.detailed_ratings_content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    background: #f8f9fa;
}

/* Расширенное состояние */
.main_rating_container.expanded .detailed_ratings_content {
    max-height: 300px;
    opacity: 1;
    padding: 15px;
    border-top: 1px solid #dee2e6;
}

/* Стрелка индикатора */
.expand_indicator {
    font-size: 12px;
    color: #6c757d;
    transition: transform 0.3s ease;
    margin-left: 10px;
}

.main_rating_container.expanded .expand_indicator {
    transform: rotate(180deg);
}

.detailed_rating_item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f8f9fa;
}

.detailed_rating_item:last-child {
    border-bottom: none;
}

.detailed_rating_item .label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.detailed_rating_item .value {
    font-size: 12px;
    font-weight: bold;
    color: #495057;
    padding: 2px 6px;
    background: #f8f9fa;
    border-radius: 10px;
}

/* Информация о компании */
.company_info {
    flex: 1;
    padding: 0 15px;
}

.company_title {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.ad_marker {
    background: #e74c3c;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 10px;
}

.company_details {
    font-size: 11px;
    line-height: 1.4;
}

.detail_row {
    margin-bottom: 5px;
}

.detail_row strong {
    color: #555;
    margin-right: 5px;
}

.detail_row a {
    color: #3498db;
    text-decoration: none;
}

.detail_row a:hover {
    text-decoration: underline;
}

/* Логотип компании */
.company_logo {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-right: 15px;
}

.company_logo img {
    max-width: 70px;
    max-height: 70px;
    object-fit: contain;
}

/* Placeholder для отсутствующих логотипов */
.company_logo_placeholder {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
    border-radius: 5px;
}

/* Действия */
.company_actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    min-width: 150px;
}

.votes_count {
    font-size: 11px;
    color: #666;
    font-weight: bold;
}

.reviews_button, .add_review_button {
    padding: 8px 15px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 11px;
    transition: background 0.3s;
    display: inline-block;
    text-align: center;
}

.reviews_button:hover, .add_review_button:hover {
    background: #2980b9;
    text-decoration: none;
}

.add_review_button {
    background: #27ae60;
}

.add_review_button:hover {
    background: #229954;
}

.rate_button {
    background: #ff6b35;
    border: none;
    font-size: 12px;
    font-weight: bold;
}

.rate_button:hover {
    background: #e55a2b;
    text-decoration: none;
    transform: translateY(-1px);
}

.rate_button span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.auth_required {
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-align: center;
}

.auth_required small {
    color: #6c757d;
    font-size: 11px;
}

/* Пагинация */
.pagination {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
}

.pagination a, .pagination .current_page {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 3px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 12px;
}

.pagination a:hover {
    background: #f5f5f5;
    text-decoration: none;
}

.pagination .current_page {
    background: #3498db;
    color: white;
    border-color: #3498db;
    font-weight: bold;
}

/* Фильтры */
.filter_container {
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.filter_form_select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    color: #333;
}

/* Информация о пользователе */
.user_info {
    color: #333;
    font-size: 12px;
}

.user_info a {
    color: #3498db;
    text-decoration: none;
    margin-left: 10px;
}

.user_info a:hover {
    text-decoration: underline;
}

/* Сообщения рейтинга */
.rating-message {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Версия в футере */
.version {
    font-size: 10px;
    color: #999;
    margin-top: 5px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .ratings_container {
        grid-template-columns: 1fr;
    }
    
    .binary_box_c {
        flex-direction: column;
    }
    
    .company_actions {
        align-items: center;
        margin-top: 15px;
    }
    
    .company_logo {
        margin-bottom: 15px;
    }
}

/* Модальное окно оценки */
.rating_modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal_overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.modal_content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px;
    border-bottom: 1px solid #e9ecef;
}

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

.modal_close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal_close:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal_body {
    padding: 20px 25px 25px;
}

.rating_form_item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f8f9fa;
}

.rating_form_item:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.rating_form_item label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin: 0;
    min-width: 120px;
}

.rating_stars_input {
    display: flex;
    gap: 5px;
    cursor: pointer;
}

.rating_stars_input .star {
    font-size: 20px;
    color: #dee2e6;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.rating_stars_input .star:hover,
.rating_stars_input .star.hover {
    color: #ffc107;
    transform: scale(1.1);
}

.rating_stars_input .star.selected {
    color: #ffc107;
    text-shadow: 0 0 5px rgba(255, 193, 7, 0.4);
}

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

.cancel_button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.cancel_button:hover {
    background: #5a6268;
    text-decoration: none;
}

.submit_button {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.submit_button:hover {
    background: #218838;
    text-decoration: none;
    transform: translateY(-1px);
}

.submit_button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Адаптивность модального окна */
@media (max-width: 576px) {
    .modal_content {
        width: 95%;
        margin: 10px;
    }
    
    .modal_header, .modal_body {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .rating_form_item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .rating_form_item label {
        min-width: auto;
    }
}

/* Стили для шапки и навигации */
header {
    background: url(./images/ratings/header.png) repeat-x;
    height: 88px;
    padding: 0 32px;
    margin-bottom: 20px;
}

.f_left {
    float: left;
}

.f_right {
    float: right;
}

.logo {
    float: left;
    font-size: 24px;
    font-weight: bold;
    line-height: 88px;
    color: white;
}

.logo a {
    color: white;
    text-decoration: none;
}

.logo a:hover {
    text-decoration: none;
    color: #3498db;
}

/* Форма входа */
.log_form {
    float: right;
    display: flex;
    align-items: center;
    height: 88px;
    gap: 10px;
}

.log_inp {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    width: 120px;
    background: white;
    color: #333;
}

.log_inp:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* Кнопки в шапке */
.button {
    position: relative;
    display: inline-block;
    padding: 8px 15px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button:hover {
    background: #2980b9;
    text-decoration: none;
    color: white;
    transform: translateY(-1px);
}

.p_rel {
    position: relative;
}

.p_abs {
    position: absolute;
}

.btn_hover {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.button:hover .btn_hover {
    opacity: 1;
}

.z9 {
    z-index: 9;
    position: relative;
}

/* Навигация для авторизованных пользователей */
nav {
    float: right;
    display: flex;
    align-items: center;
    height: 88px;
    gap: 15px;
}

.back_forum {
    background: #27ae60;
    margin-right: 20px;
}

.back_forum:hover {
    background: #229954;
}

.main_menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2px;
}

.main_menu_it {
    list-style: none;
}

.main_menu_it a {
    display: block;
    padding: 10px 15px;
    color: white;
    text-decoration: none;
    font-size: 11px;
    font-weight: bold;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.main_menu_it a:hover {
    background: rgba(255,255,255,0.1);
    text-decoration: none;
    color: white;
}

.main_menu_it.current a {
    background: #3498db;
}

.log_name a {
    background: #e74c3c !important;
    font-weight: bold;
}

.log_name a:hover {
    background: #c0392b !important;
}

.d_in-block {
    display: inline-block;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Футер */
footer {
    background: #2c3e50;
    color: white;
    padding: 30px 0;
    margin-top: 40px;
}

.footer_content {
    text-align: center;
}

.footer_content p {
    margin: 5px 0;
    font-size: 13px;
}

/* Адаптивность для шапки */
@media (max-width: 768px) {
    header {
        height: auto;
        padding: 15px 20px;
    }
    
    .logo {
        line-height: 1.2;
        font-size: 20px;
        margin-bottom: 15px;
        float: none;
        text-align: center;
    }
    
    .log_form {
        float: none;
        height: auto;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    nav {
        float: none;
        height: auto;
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }
    
    .main_menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    
    .back_forum {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Исправление проблем с переполнением */
body {
    overflow-x: hidden;
}

#content {
    min-height: 500px;
}

.al_center {
    text-align: center;
}
