/**
 * Public styles for WP Remote Logs
 */

/* Basic body styling for the log viewer */
.wp-remote-logs-body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: #212529;
}

/* Sidebar styling */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    background-color: #fff;
    overflow-y: auto;
    max-width: 100%;
    transition: transform 0.3s ease-in-out;
    display: block;
}

@media (max-width: 767.98px) {
    .sidebar {
        width: 85%;
        max-width: 300px;
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        width: 100%;
        max-width: 100%;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

.sidebar-header {
    padding: 0 1rem;
}

/* Log container styling */
.log-container {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 300px;
    max-height: 70vh;
    position: relative;
}

.log-display {
    padding: 0.5rem;
    overflow-y: auto;
    min-height: 300px;
    max-height: 70vh;
}

/* Log entries styling */
.log-entries {
    font-family: Consolas, Monaco, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.log-entry {
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid #f1f1f1;
    white-space: pre-wrap;
    word-break: break-word;
}

.log-entry:hover {
    background-color: #f8f9fa;
}

.log-timestamp {
    margin-right: 0.5rem;
    font-size: 0.8rem;
}

.log-level {
    font-weight: bold;
    margin-right: 0.5rem;
}

.log-message {
    display: inline;
    color: #f1f1f1;
}

/* Badge customizations */
.badge {
    font-size: 0.75rem;
    font-weight: normal;
    padding: 0.25em 0.5em;
}

/* Loading indicator */
#loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

/* Filter section */
.filter-section {
    padding: 0 1rem;
    color: #f1f1f1;
}

.filter-section h6,
.log-files-list h6,
.refresh-settings h6 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #f1f1f1;
    margin-bottom: 0.75rem;
}

/* Log files list */
.log-files-list {
    padding: 0 1rem;
}

.list-group-item-log {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.list-group-item-log.active {
    background-color: #007bff;
    border-color: #007bff;
}

.list-group-item-log.active h6 {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.list-group-item-log.active small {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Refresh settings */
.refresh-settings {
    padding: 0 1rem;
}

#refresh-countdown {
    font-size: 0.75rem;
}

/* Form element customizations */
.form-control,
.form-select {
    font-size: 0.875rem;
}

.form-check-label {
    font-size: 0.875rem;
    color: #f1f1f1;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .log-container {
        max-height: 60vh;
    }
    
    .log-display {
        max-height: 60vh;
    }
    
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wp-remote-logs-body {
        background-color: #212529;
        color: #f8f9fa;
    }
    
    .sidebar,
    .log-container,
    .card {
        background-color: #343a40;
        border-color: #495057;
    }
    
    .text-muted {
        color: #adb5bd !important;
    }
    
    .log-entry {
        border-bottom-color: #495057;
    }
    
    .log-entry:hover {
        background-color: #495057;
    }
    
    .form-control,
    .form-select {
        background-color: #343a40;
        border-color: #495057;
        color: #f8f9fa;
    }
    
    .list-group-item {
        background-color: #343a40;
        border-color: #495057;
        color: #f8f9fa;
    }
    
    .list-group-item.active {
        background-color: #0d6efd;
        border-color: #0d6efd;
    }
    
    .card-header {
        border-bottom-color: #495057;
    }
    
    .border-bottom {
        border-bottom-color: #495057 !important;
    }
}

/* Specific control customizations */
#filter-type, 
#search-term,
#lines-number {
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
}

/* For smaller screens, adjust the height of the log viewer */
@media (max-height: 700px) {
    .log-container, 
    .log-display {
        max-height: 50vh;
        min-height: 200px;
    }
}

/* For tablets in portrait mode */
@media (min-width: 768px) and (max-width: 991.98px) {
    .sidebar {
        width: 25%;
    }
    
    .main-content {
        width: 75%;
    }
}

/* Password form styling */
.card-login {
    max-width: 400px;
    margin: 2rem auto;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

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

.log-entry {
    animation: fadeIn 0.3s ease-in-out;
}

/* Accessibility improvements */
.btn:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: 0;
}

/* Print styles */
@media print {
    .sidebar,
    .btn-toolbar,
    .footer-notes,
    #toggle-sidebar,
    #toggle-sidebar-desktop-logs {
        display: none !important;
    }
    
    .main-content {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .log-container {
        max-height: none !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    .log-display {
        max-height: none !important;
        overflow: visible !important;
    }
    
    .log-entry {
        page-break-inside: avoid;
    }
}
