/* === Elevator Status Page Styles === */

/* === Page Layout === */
.page-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    color: #1d1d1f;
}

.page-description {
    text-align: center;
    color: #6e6e73;
    font-size: 1.1rem;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* === Sections === */
.elevator-grid-section,
.elevator-table-section,
.info-block {
    margin-bottom: 4rem;
    background: #fff;
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

section h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1d1d1f;
}

/* === Section Header with Refresh Button === */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-header h2 {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

.refresh-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
}

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

.refresh-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* === Elevator Status Table === */
.elevator-status-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 1rem;
}

.elevator-status-table thead {
    background: #f5f5f7;
}

.elevator-status-table th {
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    color: #1d1d1f;
    border-bottom: 2px solid #e0e0e0;
    font-size: 1.1rem;
}

.elevator-status-table td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

/* Центрирование для ячеек с лифтами */
.elevator-status-table td:nth-child(2),
.elevator-status-table td:nth-child(3) {
    display: table-cell;
    vertical-align: middle;
}

.elevator-status-table tbody tr:hover {
    background-color: #fafafa;
}

/* Первый столбец - номер подъезда */
.elevator-status-table td:first-child {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1d1d1f;
}

/* Цветные блоки статусов */
.elevator-cell {
    display: inline-block;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
}

.elevator-cell.grey {
    background: #9E9E9E;
}

.elevator-cell.green {
    background: #4CAF50;
}

.elevator-cell.red {
    background: #F44336;
}

.elevator-cell.red-blink {
    background: #F44336;
    animation: blink 1s infinite ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #FFD700;
}

.elevator-cell.long-broken {
    background: #D32F2F;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #FFFFFF;
    border: 3px solid #B71C1C;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* === Table Styles === */
.table-wrapper {
    overflow-x: auto;
}

.elevator-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.elevator-table thead {
    background: #f5f5f7;
}

.elevator-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #1d1d1f;
    border-bottom: 2px solid #e0e0e0;
}

.elevator-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    color: #1d1d1f;
}

.elevator-table tbody tr:hover {
    background-color: #fafafa;
}

.status-cell {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    display: inline-block;
}

.status-cell.green {
    background-color: rgba(76, 175, 80, 0.15);
    color: #2e7d32;
}

.status-cell.red {
    background-color: rgba(244, 67, 54, 0.15);
    color: #c62828;
}

.status-cell.red-blink {
    background-color: rgba(244, 67, 54, 0.25);
    color: #b71c1c;
    animation: blink-bg 1s infinite ease-in-out;
}

.status-cell.long-broken {
    background-color: rgba(211, 47, 47, 0.2);
    color: #b71c1c;
    border: 2px solid #d32f2f;
    font-weight: 600;
}

@keyframes blink-bg {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.no-data {
    color: #9e9e9e;
    font-style: italic;
    text-align: center;
}

/* === Info Block === */
.info-content {
    line-height: 1.6;
}

.info-content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #1d1d1f;
}

.info-content p {
    margin-bottom: 1rem;
    color: #1d1d1f;
}

.info-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-content ul li {
    margin-bottom: 0.75rem;
    color: #1d1d1f;
}

.info-content a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s;
}

.info-content a:hover {
    color: #0051a8;
    text-decoration: underline;
}

/* === Status List === */
.status-list {
    list-style: none;
    margin-left: 0;
    margin-bottom: 2rem;
}

.status-item {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.status-item strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.status-item--green {
    background-color: rgba(76, 175, 80, 0.1);
    border-color: #4CAF50;
}

.status-item--red {
    background-color: rgba(244, 67, 54, 0.1);
    border-color: #F44336;
}

.status-item--red-blink {
    background-color: rgba(244, 67, 54, 0.15);
    border-color: #F44336;
}

.status-item--long-broken {
    background-color: rgba(211, 47, 47, 0.15);
    border-color: #D32F2F;
}

.status-item--grey {
    background-color: rgba(158, 158, 158, 0.1);
    border-color: #9E9E9E;
}

/* === Call to Action === */
.call-to-action {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 2rem;
    border-radius: 16px;
    margin-top: 2rem;
    text-align: center;
}

/* === Help Icon (подсказки) === */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #86868b;
    background-color: rgba(0, 0, 0, 0.06);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;
    font-family: inherit;
    line-height: 1;
}

.help-icon:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #1d1d1f;
}

.help-icon:active {
    transform: scale(0.95);
}

/* === Tooltip === */
.tooltip-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tooltip-overlay--visible {
    opacity: 1;
    visibility: visible;
}

.tooltip-box {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: calc(100% - 44px);
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    background-color: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 201;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.tooltip-box--visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.tooltip-box__title {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 12px;
}

.tooltip-box__text {
    font-size: 15px;
    color: #1d1d1f;
    line-height: 1.5;
}

.tooltip-box__text p {
    margin-bottom: 12px;
}

.tooltip-box__text p:last-of-type {
    margin-bottom: 16px;
}

.tooltip-box__text strong {
    color: #1d1d1f;
    font-weight: 600;
}

.tooltip-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    font-weight: 500;
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tooltip-link::after {
    content: '↓';
    font-size: 16px;
    transition: transform 0.2s ease;
}

.tooltip-link:hover {
    text-decoration: underline;
    color: #0051a8;
}

.tooltip-link:hover::after {
    transform: translateY(2px);
}

.call-to-action p {
    color: #fff !important;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.btn-primary {
    display: inline-block;
    background: #fff;
    color: #667eea;
    padding: 0.875rem 2rem;
    border-radius: 24px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    color: #667eea;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }
    
    .page-description {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .section-header h2 {
        width: 100%;
    }
    
    .refresh-button {
        width: 100%;
        padding: 0.875rem 1.5rem;
    }
    
    .elevator-status-table th,
    .elevator-status-table td {
        padding: 0.5rem;
    }
    
    .elevator-cell {
        width: 50px;
        height: 50px;
    }
    
    .elevator-grid-section,
    .elevator-table-section,
    .info-block {
        padding: 1.5rem;
    }
    
    .elevator-table {
        font-size: 0.85rem;
    }
    
    .elevator-table th,
    .elevator-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .call-to-action {
        padding: 1.5rem;
    }
    
    .status-item {
        padding: 0.875rem 1rem;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.75rem;
    }
    
    section h2 {
        font-size: 1.5rem;
    }
    
    .refresh-button {
        font-size: 0.9rem;
        padding: 0.75rem 1.25rem;
    }
    
    .elevator-status-table th {
        padding: 0.5rem 0.25rem;
        font-size: 0.9rem;
    }
    
    .elevator-status-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .elevator-cell {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .elevator-table th,
    .elevator-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
}
