/* =============================================================================
 * Hardware Reporter - Application Stylesheet
 * Following Adwaita/GNOME Human Interface Guidelines (HIG)
 * =============================================================================
 */

/* NOTE: GTK4 CSS does not support the 'cursor' property.
 * Pointer cursor for clickable elements is set programmatically
 * via the _set_cursor_pointer() method in main_window.py.
 */

/* === Admin Required Clickable Widget === */
.admin-required-clickable {
    padding: 8px 16px;
    border-radius: 8px;
    background-color: alpha(@warning_color, 0.1);
    border: 1px dashed alpha(@warning_color, 0.4);
    transition: all 150ms ease;
}

.admin-required-clickable:hover {
    background-color: alpha(@warning_color, 0.18);
    border-color: alpha(@warning_color, 0.6);
}

.admin-required-clickable label {
    font-size: 0.9em;
    font-weight: 500;
}

/* === Base Card Styles - Following Adwaita/GNOME HIG === */
.card {
    background-color: @card_bg_color;
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid alpha(@borders, 0.2);
}

.card-elevated {
    background-color: @card_bg_color;
    border-radius: 12px;
    padding: 16px;
    border: none;
    box-shadow: 0 1px 3px alpha(black, 0.08);
}

/* === Stat Cards - Compact === */
.stat-card {
    padding: 12px 16px;
    min-width: 120px;
}



.stat-icon {
    font-size: 20px;
    margin-bottom: 4px;
    opacity: 0.85;
}

.stat-value {
    font-size: 1.5em;
    font-weight: 600;
    margin: 2px 0;
}

.stat-label {
    font-size: 0.8em;
    font-weight: 500;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* === Hero Card (Main Info) - Compact design following GNOME HIG === */
.hero-card {
    border: 1px solid alpha(@accent_color, 0.12);
    border-radius: 12px;
    padding: 16px 20px;
}

.hero-title {
    font-size: 1.25em;
    font-weight: 600;
    margin-bottom: 8px;
}

/* === Core Speed Grid === */
.core-box {
    border-radius: 12px;
    padding: 12px 16px;
    min-width: 100px;
    border: 1px solid alpha(@accent_color, 0.15);
}

.core-label {
    font-size: 0.75em;
    font-weight: 600;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.core-speed {
    font-size: 1.1em;
    font-weight: 600;
    color: @accent_color;
}

/* === Device Cards - Compact === */
.device-card {
    padding: 6px 10px;
    margin-bottom: 4px;
    border-radius: 8px;
}



.device-icon {
    font-size: 24px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 8px;
    padding: 6px;
}

.device-title {
    font-size: 0.95em;
    font-weight: 500;
}

.device-subtitle {
    font-size: 0.82em;
    opacity: 0.6;
}

.device-badge {
    font-size: 0.72em;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: alpha(@accent_bg_color, 0.1);
    color: @accent_color;
}

.device-badge.success-badge {
    background-color: alpha(@success_color, 0.12);
    color: @success_color;
}

.device-badge.warning-badge {
    background-color: alpha(@warning_color, 0.12);
    color: @warning_color;
}

.device-badge.error-badge {
    background-color: alpha(@error_color, 0.12);
    color: @error_color;
}

/* === Info Grid === */
.info-grid {
    padding: 2px 0;
}

.info-row {
    padding: 4px 0;
    border-bottom: 1px solid alpha(@borders, 0.08);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    opacity: 0.6;
    font-size: 0.9em;
}

.info-value {
    font-weight: 500;
}

/* === Section Headers - Reduced bottom margin per Task #1 === */
.section-title {
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 4px;
    margin-top: 12px;
    opacity: 0.85;
}

/* === Progress Bars === */
/* Use Adwaita semantic colors for proper theming */
.usage-bar {
    border-radius: 6px;
    min-height: 8px;
}

.usage-bar trough {
    background-color: alpha(@view_fg_color, 0.12);
    border-radius: 6px;
    min-height: 8px;
}

.usage-bar progress {
    border-radius: 6px;
    min-height: 8px;
}

/* Use Adwaita semantic colors */
.usage-bar.success progress {
    background-color: @success_color;
}

.usage-bar.warning progress {
    background-color: @warning_color;
}

.usage-bar.error progress {
    background-color: @error_color;
}

/* Default accent color for neutral progress */
.usage-bar.accent progress {
    background-color: @accent_bg_color;
}

/* === Storage Cards - Compact === */
.storage-card {
    padding: 12px 16px;
    border-radius: 10px;
}

.storage-icon {
    font-size: 28px;
    padding: 8px;
    background-color: alpha(@accent_bg_color, 0.08);
    border-radius: 8px;
}

.storage-name {
    font-size: 0.95em;
    font-weight: 500;
}

.storage-size {
    font-size: 1.1em;
    font-weight: 600;
    color: @accent_color;
}

.storage-type {
    font-size: 0.75em;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: alpha(@success_color, 0.1);
    color: @success_color;
}

/* === Memory Module Cards - Compact === */
.memory-slot {
    padding: 10px 14px;
    border-radius: 8px;
    border-left: 3px solid @accent_color;
}

/* === Raw Text / Code Blocks === */
.raw-text {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
    font-size: 0.85em;
    padding: 12px;
    border-radius: 8px;
    line-height: 1.6;
}

/* === Terminal Style for More Info (Task #7) === */
.terminal-text {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
    font-size: 0.95em;
    padding: 16px;
    background-color: alpha(@shade_color, 0.5);
    color: @view_fg_color;
    border-radius: 8px;
    line-height: 1.5;
}

.terminal-card {
    border-radius: 8px;
    border: 1px solid alpha(@borders, 0.3);
    margin-bottom: 8px;
}

.terminal-title {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
    font-size: 0.95em;
    font-weight: 600;
    color: @accent_color;
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid alpha(@borders, 0.3);
}

/* === Sidebar Styling === */
.sidebar {
    /* Default background */
}

.sidebar-search {
    margin: 12px;
    border-radius: 12px;
}

/* === Category Row Styling === */
.category-row {
    padding: 0px 8px;
    margin: 0px 4px;
    border-radius: 6px;
    transition: background-color 150ms ease;
}

.category-row:hover {
    background-color: alpha(currentColor, 0.07);
}

.category-row.active-category {
    background-color: alpha(@accent_bg_color, 0.15);
}

.category-icon {
    opacity: 0.85;
}

.category-label {
    font-weight: 500;
}

/* === Accent Colors === */
.accent {
    color: @accent_color;
}

.success {
    color: @success_color;
}

.warning {
    color: @warning_color;
}

.error {
    color: @error_color;
}

/* === Navigation Sidebar === */
.navigation-sidebar row {
    border-radius: 6px;
    margin: 0px 4px;
}

.navigation-sidebar row:selected {
    background-color: alpha(@accent_bg_color, 0.12);
}

.raw-text-card {
    padding: 16px;
    border-radius: 8px;
}

progressbar.success trough progress {
    background-color: @success_color;
}

progressbar.warning trough progress {
    background-color: @warning_color;
}

progressbar.error trough progress {
    background-color: @error_color;
}

/* === Superuser Required Widget === */
.superuser-required {
    padding: 4px 10px;
    border-radius: 6px;
    background-color: alpha(@warning_color, 0.12);
    border: 1px dashed alpha(@warning_color, 0.4);
    transition: background-color 150ms ease, border-color 150ms ease;
}

.superuser-required:hover {
    background-color: alpha(@warning_color, 0.18);
    border-color: alpha(@warning_color, 0.6);
}

.superuser-required label {
    font-size: 0.85em;
    font-weight: 500;
}

/* === Caption Text Style === */
.caption {
    font-size: 0.85em;
}

/* === Two-Column Layout - Consistent Alignment === */

/* Columns container - horizontal layout */
.two-columns {
    margin-top: 8px;
}

/* Separator styling in cards */
.two-columns>separator,
.card>box>separator,
separator {
    margin-left: 20px;
    margin-right: 20px;
    margin-top: 0;
    margin-bottom: 0;
    opacity: 0.2;
    min-height: 0;
}

/* Generic card columns alignment - ensure columns stretch */
.card>box {
    min-height: 0;
}

/* Columns should expand equally */
.card>box>box {
    min-width: 0;
    min-height: 0;
}

/* Hero card specific alignment */
.hero-card>box>separator {
    margin-left: 24px;
    margin-right: 24px;
    opacity: 0.15;
}

/* Spec items in columns should have consistent spacing */
.card box>box {
    margin-bottom: 6px;
}

/* Section separators */
.section-separator {
    margin-top: 6px;
    margin-bottom: 6px;
    opacity: 0.12;
}

/* Expander card spacing */
expander.card>box {
    padding-top: 8px;
}

/* Collapsed device rows in expanders */
expander.card box {
    padding: 4px 0;
}

/* === Title-4 Style for Card Headers === */
.title-4 {
    font-weight: 600;
    font-size: 0.95em;
}

/* === Terminal Title Bar - Horizontal Layout Fix === */
.terminal-title {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
    font-size: 0.95em;
    font-weight: 600;
    color: @accent_color;
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid alpha(@borders, 0.3);
}

.terminal-title button {
    padding: 4px;
    min-width: 24px;
    min-height: 24px;
}