/* Canon Toolbox Custom Styles */

body {
    background-color: #f5f5f5;
}

.main-content {
    padding: 2rem 0;
}

/* Device Cards */
.device-card {
    margin-bottom: 1rem !important;
}

.device-card .content .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.device-card .status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.device-card .status-indicator.online {
    background-color: #21ba45;
    box-shadow: 0 0 5px #21ba45;
}

.device-card .status-indicator.offline {
    background-color: #db2828;
}

.device-card .status-indicator.warning {
    background-color: #fbbd08;
}

/* Toner Bars (full size - used on detail pages) */
.toner-bar {
    height: 20px;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.toner-bar .fill {
    height: 100%;
    transition: width 0.3s ease;
}

.toner-bar.black .fill { background-color: #1b1c1d; }
.toner-bar.cyan .fill { background-color: #00b5ad; }
.toner-bar.magenta .fill { background-color: #e03997; }
.toner-bar.yellow .fill { background-color: #fbbd08; }

.toner-bar .label {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: bold;
}

.toner-bar.black .label { color: #fff; }

/* Toner Bars (mini - dashboard cards) */
.toner-section {
    padding-top: 0.5em !important;
    padding-bottom: 0.5em !important;
}

.toner-bar-mini {
    height: 6px;
    margin-bottom: 4px;
    border-radius: 3px;
    background-color: #e8e8e8;
    overflow: hidden;
    cursor: default;
}

.toner-bar-mini:last-child {
    margin-bottom: 0;
}

.toner-bar-mini .fill {
    height: 100%;
    transition: width 0.3s ease;
}

.toner-bar-mini.black .fill { background-color: #1b1c1d; }
.toner-bar-mini.cyan .fill { background-color: #00b5ad; }
.toner-bar-mini.magenta .fill { background-color: #e03997; }
.toner-bar-mini.yellow .fill { background-color: #fbbd08; }

/* Card warning border for low toner */
.device-card.card-warning {
    border-left: 3px solid #fbbd08 !important;
}

.device-card .extra.content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Paper Tray Indicators */
.paper-tray {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.paper-tray .tray-icon {
    width: 40px;
    height: 30px;
    border: 2px solid #ccc;
    border-radius: 4px;
    margin-right: 0.5rem;
    position: relative;
    overflow: hidden;
}

.paper-tray .tray-icon .fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    background-color: #2185d0;
    transition: height 0.3s ease;
}

/* VNC Portal */
.vnc-container {
    position: relative;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}

.vnc-screen {
    width: 100%;
    min-height: 480px;
    background-color: #1a1a1a;
    overflow: auto;
}

/* noVNC wraps canvas in a flex div - target both */
.vnc-screen > div {
    width: 100%;
    min-height: 480px;
}

.vnc-screen canvas {
    max-width: 100%;
    height: auto !important;
    width: auto !important;
    cursor: pointer !important;
}

/* Canon Keypad */
.canon-keypad {
    background-color: #2c3e50;
    padding: 1rem;
    border-radius: 8px;
}

.canon-keypad .keypad-row {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.canon-keypad .key {
    width: 50px;
    height: 50px;
    margin: 0.25rem;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.canon-keypad .key:hover {
    transform: scale(1.05);
}

.canon-keypad .key:active {
    transform: scale(0.95);
}

.canon-keypad .key.number {
    background-color: #ecf0f1;
    color: #2c3e50;
}

.canon-keypad .key.function {
    background-color: #3498db;
    color: white;
}

.canon-keypad .key.start {
    background-color: #27ae60;
    color: white;
}

.canon-keypad .key.stop {
    background-color: #e74c3c;
    color: white;
}

.canon-keypad .key.reset {
    background-color: #f39c12;
    color: white;
}

/* Meter Display */
.meter-display {
    background-color: #1b1c1d;
    color: #fff;
    padding: 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.meter-display .meter-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #444;
}

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

.meter-display .meter-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #21ba45;
}

/* DCM Accordion */
.dcm-accordion.ui.styled.accordion .title {
    font-size: 1.05em;
    font-weight: 600;
}

.dcm-accordion.ui.styled.accordion .content.active {
    padding: 1.25em 1.5em 1.75em;
}

.dcm-accordion .content .field {
    margin-bottom: 1.25em !important;
}

.dcm-accordion .content .field:last-child {
    margin-bottom: 0 !important;
}

.dcm-password-footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
    border-top: 2px solid #e8e8e8 !important;
    margin-top: 1em !important;
    background: #fff;
}

/* Discovery Wizard */
.discovery-wizard .step-content {
    min-height: 300px;
}

.discovery-results {
    max-height: 400px;
    overflow-y: auto;
}

/* Loading Overlay (deprecated - prefer inline loaders) */

/* Print Jobs Table */
.print-jobs-table {
    font-size: 0.9rem;
}

.print-jobs-table .status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-grid .device-card.ui.card {
    display: flex;
    flex-direction: column;
    width: calc(33.333% - 0.75rem);
    min-width: 280px;
    flex-grow: 1;
    margin: 0 !important;
}

.dashboard-grid .device-card.ui.card > .content:first-child {
    flex: 1;
}

/* Quick Actions */
.quick-actions {
    margin-top: 1rem;
}

.quick-actions .ui.button {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .canon-keypad .key {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .dashboard-grid .device-card.ui.card {
        width: 100%;
    }
}

/* MEAP Cards */
.meap-detail-panel {
    margin-top: 0.5em;
    padding: 0.5em 0.75em;
    background-color: #f8f8f8;
    border-radius: 4px;
    border: 1px solid #e8e8e8;
}

.meap-license-item {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.3em 0;
}

.meap-license-filename {
    flex: 1;
    font-size: 0.9em;
}

/* Collapsible Section Headers */
.collapsible-section .section-toggle {
    cursor: pointer;
    user-select: none;
    margin-bottom: 0.75em;
    display: flex !important;
    align-items: center;
}

.collapsible-section .section-toggle > i.icon:first-child {
    display: inline-block !important;
    font-size: 1.1em;
    margin-right: 0.4em;
    width: auto !important;
}

.collapsible-section .section-toggle:hover {
    color: #2185d0;
}

.collapsible-section .section-toggle .angle.icon {
    font-size: 0.85em;
    color: #999;
    margin-left: auto;
    margin-right: 0 !important;
}

/* Form Styles */
.form-section {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

/* Jobs Indicator */
.jobs-indicator-wrapper {
    position: relative;
}

.jobs-badge {
    position: absolute !important;
    top: 50%;
    right: 0;
    transform: translate(40%, -80%);
    font-size: 0.6em !important;
    padding: 0.3em 0.5em !important;
    z-index: 1;
}

/* Jobs Dropdown Panel */
.jobs-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 380px;
    max-height: 70vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    padding: 1em;
}

.jobs-dropdown .ui.indicating.progress {
    height: 4px;
    border-radius: 2px;
    background: #e8e8e8;
    margin: 0;
}

.jobs-dropdown .ui.indicating.progress .bar {
    height: 100%;
    border-radius: 2px;
    background: #2185d0;
}

/* Status Tags */
.status-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-tag.idle { background-color: #21ba45; color: white; }
.status-tag.printing { background-color: #2185d0; color: white; }
.status-tag.warmup { background-color: #fbbd08; color: #333; }
.status-tag.error { background-color: #db2828; color: white; }
.status-tag.unknown { background-color: #767676; color: white; }
