/* Main stylesheet - legacy compatibility styles */
/* This file contains styles that haven't been moved to component files yet */

/* Legacy body styles - will be overridden by base.css */
body {
    padding: 20px;
    max-width: none;
}

.header h1 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.stats {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.user-info {
    margin-left: auto;
    background: #34495e;
    color: white;
}

.logout-link {
    color: #f39c12;
    margin-left: 10px;
    text-decoration: none;
    font-weight: bold;
}

.logout-link:hover {
    color: #f1c40f;
    text-decoration: underline;
}

.broadcast-btn {
    padding: 12px 24px;
    background: #e67e22;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.broadcast-btn:hover {
    background: #d35400;
    transform: translateY(-1px);
}

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

.stat {
    padding: 8px 16px;
    background: #ecf0f1;
    border-radius: 4px;
    font-weight: 500;
}

.online-count {
    background: #d5f4e6;
    color: #27ae60;
}

.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #34495e;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

th.sortable:hover {
    background: #2c3e50;
}

.sort-indicator {
    font-size: 12px;
    margin-left: 4px;
    color: #ecf0f1;
}

td {
    padding: 12px 8px;
    border-bottom: 1px solid #ecf0f1;
    font-size: 14px;
}

tr:hover {
    background-color: #f8f9fa;
}

.device-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.device-row:hover {
    background-color: #e3f2fd !important;
}

.device-row.high-temperature {
    background-color: #ffebee !important;
    border-left: 4px solid #f44336;
}

.device-row.high-temperature:hover {
    background-color: #ffcdd2 !important;
}

.device-id {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #2c3e50;
}

.status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status.online {
    background: #d5f4e6;
    color: #27ae60;
}

.status.offline {
    background: #fadbd8;
    color: #e74c3c;
}

.enabled {
    color: #27ae60;
    font-weight: bold;
}

.disabled {
    color: #95a5a6;
}

.no-devices {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 40px;
}

.footer {
    margin-top: 20px;
    text-align: center;
    color: #7f8c8d;
    font-size: 12px;
}

/* Responsive design */
@media (max-width: 1200px) {
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px 4px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
    }
    
    table {
        font-size: 11px;
    }
    
    th, td {
        padding: 6px 3px;
    }
}

/* Device detail page styles */
.back-button {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.back-button:hover {
    text-decoration: underline;
}

.refresh-button {
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-button:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.device-details {
    display: grid;
    gap: 20px;
}

.detail-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.detail-section h2 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.device-title-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #e8f4fd;
    border-radius: 6px;
    border: 1px solid #bee5eb;
}

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

.title-display span {
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
}

.edit-title-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background: #3498db;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.edit-title-btn:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-1px);
}

.edit-title-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.full-width-input {
    width: 100%;
    padding: 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 18px;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 20px;
    min-height: 60px;
}

.full-width-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    gap: 10px;
}

.detail-item span {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 60%;
    line-height: 1.4;
    white-space: pre-wrap;
}

.detail-item label {
    font-weight: 600;
    color: #34495e;
}

.commands-section {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.command-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.restart-btn {
    background: #e74c3c;
    color: white;
}

.restart-btn:hover:not(:disabled) {
    background: #c0392b;
    transform: translateY(-2px);
}

.ping-btn {
    background: #3498db;
    color: white;
}

.ping-btn:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
}

.log-on-btn {
    background: #27ae60;
    color: white;
}

.log-on-btn:hover:not(:disabled) {
    background: #229954;
    transform: translateY(-2px);
}

.log-off-btn {
    background: #f39c12;
    color: white;
}

.log-off-btn:hover:not(:disabled) {
    background: #e67e22;
    transform: translateY(-2px);
}

.log-controls-section {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.log-controls-section h3 {
    margin: 0 0 15px 0;
    color: #34495e;
    font-size: 16px;
}

.log-controls-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.log-level-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #ced4da;
}

.log-level-section label {
    font-weight: 600;
    color: #34495e;
    min-width: 80px;
}

.log-level-select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    min-width: 120px;
}

.log-level-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.log-level-btn {
    background: #9b59b6;
    color: white;
}

.log-level-btn:hover:not(:disabled) {
    background: #8e44ad;
    transform: translateY(-2px);
}

.notif-btn {
    background: #e67e22;
    color: white;
}

.notif-btn:hover:not(:disabled) {
    background: #d35400;
    transform: translateY(-2px);
}

.update-file-btn {
    background: #8e44ad;
    color: white;
}

.update-file-btn:hover:not(:disabled) {
    background: #7d3c98;
    transform: translateY(-2px);
}

.download-fw-btn {
    background: #16a085;
    color: white;
}

.download-fw-btn:hover:not(:disabled) {
    background: #138d75;
    transform: translateY(-2px);
}

.screenshot-btn {
    background: #17a2b8;
    color: white;
}

.screenshot-btn:hover:not(:disabled) {
    background: #138496;
    transform: translateY(-2px);
}

.ssh-tunnel-btn {
    background: #9b59b6;
    color: white;
}

.ssh-tunnel-btn:hover:not(:disabled) {
    background: #8e44ad;
    transform: translateY(-2px);
}

/* Modal styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 90%;
    height: 80vh;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.modal-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
}

.modal-body textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: inherit;
    font-size: 16px;
    resize: none;
    box-sizing: border-box;
    flex: 1;
    min-height: 300px;
}

.modal-body textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.modal-body .help-text {
    margin-top: 15px;
    color: #7f8c8d;
    font-size: 16px;
}

.modal-body code {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 16px;
    color: #e74c3c;
}

.modal-body input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

.modal-body input[type="file"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.confirmation-section {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
}

.confirmation-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.confirmation-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.confirmation-checkbox label {
    font-weight: 600;
    color: #856404;
    cursor: pointer;
    margin: 0;
}

.warning-text {
    color: #856404;
    font-weight: 500;
    margin-bottom: 10px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #ecf0f1;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: #95a5a6;
    color: white;
}

.cancel-btn:hover {
    background: #7f8c8d;
}

.send-btn {
    background: #27ae60;
    color: white;
}

.send-btn:hover {
    background: #229954;
}

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

.offline-message {
    color: #7f8c8d;
    font-style: italic;
    margin: 0;
}

.blocked-message {
    color: #e74c3c;
    font-style: italic;
    margin: 0;
    font-weight: 600;
}

.device-blocked-warning {
    margin-top: 15px;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #721c24;
}

.device-blocked-warning strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.device-blocked-warning p {
    margin: 0;
    font-size: 14px;
}

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

.blocking-control input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.blocking-label {
    cursor: pointer;
    font-weight: 500;
    color: #34495e;
    margin: 0;
}

.blocking-control input[type="checkbox"]:checked + .blocking-label {
    color: #e74c3c;
}

.blocking-control input[type="checkbox"]:not(:checked) + .blocking-label {
    color: #27ae60;
}

.admin-override-warning {
    margin-bottom: 15px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    color: #856404;
}

.admin-override-warning strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.admin-override-warning p {
    margin: 0;
    font-size: 14px;
}

.ssh-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

.form-group input {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-group input[type="password"] {
    font-family: monospace;
}

.command-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    background: #f8f9fa;
}

.command-result h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.success {
    color: #27ae60;
    font-weight: 600;
}

.error {
    color: #e74c3c;
    font-weight: 600;
}

.logs-section {
    margin-top: 15px;
}

.logs-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.logs-container {
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

#logsTextarea {
    width: 100%;
    height: 300px;
    padding: 10px;
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: #f8f9fa;
    color: #2c3e50;
    resize: vertical;
    outline: none;
}

#logsTextarea:focus {
    background: #ffffff;
}

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .detail-item span {
        max-width: 100%;
    }
    
    .commands-section {
        flex-direction: column;
    }
    
    .command-btn {
        width: 100%;
    }
    
    .log-controls-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .log-level-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .log-level-section label {
        min-width: auto;
    }
    
    .log-level-select {
        width: 100%;
    }
    
    .title-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .logs-controls {
        flex-direction: column;
    }
    
    #logsTextarea {
        height: 200px;
        font-size: 11px;
    }
    
    .ssh-form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .form-group input {
        padding: 12px;
        font-size: 16px;
    }
}
