/* eGun Auction Monitor - Custom Styles */

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Login Panel */
.login-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-form {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-bottom: 20px;
}

/* Dashboard Cards */
.dashboard-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin: 10px;
    text-align: center;
}

.dashboard-card .number {
    font-size: 48px;
    font-weight: bold;
    color: #667eea;
}

.dashboard-card .label {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

.dashboard-card.watched .number {
    color: #4CAF50;
}

.dashboard-card.running .number {
    color: #2196F3;
}

.dashboard-card.expired .number {
    color: #9E9E9E;
}

.dashboard-card.api-calls .number {
    color: #FF9800;
}

/* User-selectable text in detail windows */
.x-panel-body .user-selectable,
.x-window-body table,
.x-window-body td,
.x-panel-body div {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
}

/* API Chart Panel */
#apiChart {
    min-height: 180px;
}

/* Status badges */
.status-registered {
    background: #FFF3E0;
    color: #E65100;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.status-running {
    background: #E3F2FD;
    color: #1565C0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.status-expired {
    background: #ECEFF1;
    color: #546E7A;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.status-bid_placed {
    background: #E8F5E9;
    color: #2E7D32;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.status-watching {
    background: #E3F2FD;
    color: #1565C0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.status-deleted {
    background: #ffebee;
    color: #c62828;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    text-decoration: line-through;
}

/* Auction detail */
.auction-detail-thumbnail {
    max-width: 300px;
    max-height: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.auction-detail-field {
    margin-bottom: 15px;
}

.auction-detail-label {
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
}

.auction-detail-value {
    color: #333;
}

/* Grid enhancements */
.auction-thumbnail-cell img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

/* Auction comment inline edit */
.auction-comment-row {
    margin-top: 3px;
}

.auction-comment-display:hover {
    background: #f5f5f5;
    border-radius: 3px;
    padding: 1px 4px;
    margin: -1px -4px;
}

.auction-comment-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Price column */
.price-column {
    font-weight: bold;
    color: #2E7D32;
}

.price-exceeded {
    color: #C62828 !important;
}

/* Timer column */
.time-critical {
    color: #C62828;
    font-weight: bold;
    animation: pulse 1s infinite;
}

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

/* User panel */
.user-info {
    padding: 5px 10px;
    color: #fff;
}

.user-role-admin {
    background: #C62828;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 5px;
}

.user-role-operator {
    background: #1565C0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 5px;
}

/* Import errors */
.import-errors {
    max-height: 200px;
    overflow-y: auto;
    background: #FFF3E0;
    border: 1px solid #FFB74D;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
}

.import-error-item {
    color: #E65100;
    font-size: 12px;
    margin-bottom: 5px;
}

/* Activity log */
.activity-item {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

.activity-item:hover {
    background: #f5f5f5;
}

.activity-time {
    color: #999;
    font-size: 11px;
}

.activity-action {
    font-weight: bold;
    color: #333;
}

/* Header styling */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.app-logo {
    font-size: 20px;
    font-weight: bold;
    color: white;
    padding: 10px 20px;
}

/* Clock display */
.clock-container {
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 8px 15px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.clock-row {
    display: flex;
    align-items: center;
    color: white;
    font-size: 12px;
    line-height: 1.6;
}

.clock-label {
    width: 55px;
    color: rgba(255,255,255,0.7);
}

#serverClock, #egunClock {
    font-weight: bold;
    letter-spacing: 0.5px;
}

.clock-offset {
    margin-left: 8px;
    font-size: 11px;
}

/* Navigation */
.nav-button {
    margin: 0 5px;
}

.nav-button-active {
    background: rgba(255,255,255,0.2) !important;
}

/* Form styling */
.form-section-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
}

/* Mobile auction card view */
.mobile-auction-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 10px;
    padding: 15px;
    border-left: 4px solid #667eea;
}

.mobile-auction-card.status-expired {
    border-left-color: #9E9E9E;
    opacity: 0.7;
}

.mobile-auction-card.status-running {
    border-left-color: #2196F3;
}

.mobile-auction-card.status-bid_placed {
    border-left-color: #4CAF50;
}

.mobile-auction-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.mobile-auction-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.mobile-auction-thumb-placeholder {
    width: 70px;
    height: 70px;
    background: #f0f0f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 24px;
    flex-shrink: 0;
}

.mobile-auction-info {
    flex: 1;
    min-width: 0;
}

.mobile-auction-title {
    font-weight: bold;
    color: #333;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-auction-id {
    font-size: 11px;
    color: #999;
}

.mobile-auction-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 12px;
}

.mobile-auction-detail {
    display: flex;
    flex-direction: column;
}

.mobile-auction-label {
    color: #999;
    font-size: 10px;
    text-transform: uppercase;
}

.mobile-auction-value {
    color: #333;
    font-weight: 500;
}

.mobile-auction-value.price {
    color: #2E7D32;
    font-weight: bold;
}

.mobile-auction-value.countdown {
    font-family: 'Consolas', monospace;
}

.mobile-auction-value.countdown.critical {
    color: #d32f2f;
    font-weight: bold;
}

.mobile-auction-value.countdown.warning {
    color: #E65100;
}

.mobile-auction-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.mobile-auction-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
}

.mobile-auction-btn.primary {
    background: #667eea;
    color: white;
}

.mobile-auction-btn.secondary {
    background: #f0f0f0;
    color: #333;
}

/* Mobile navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    color: #666;
    text-decoration: none;
    font-size: 11px;
    cursor: pointer;
}

.mobile-nav-item.active {
    color: #667eea;
}

.mobile-nav-item .nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Header adjustments */
    .app-header {
        height: auto !important;
        min-height: 50px;
        padding: 8px;
    }
    
    .app-logo {
        font-size: 16px;
        padding: 5px 10px;
    }
    
    .clock-container {
        display: none;
    }
    
    .user-info {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    /* Hide desktop navigation */
    .x-panel-west {
        display: none !important;
    }
    
    /* Show mobile navigation */
    .mobile-nav {
        display: block;
    }
    
    /* Dashboard cards */
    .dashboard-card {
        margin: 5px;
        padding: 15px;
    }
    
    .dashboard-card .number {
        font-size: 32px;
    }
    
    /* Login form */
    .login-form {
        margin: 10px;
        width: calc(100% - 20px) !important;
    }
    
    /* Modal windows */
    .x-window {
        width: 95% !important;
        max-width: 95% !important;
        left: 2.5% !important;
    }
    
    /* Grid adjustments */
    .x-grid {
        font-size: 12px;
    }
    
    .x-grid-cell {
        padding: 4px 6px !important;
    }
    
    /* Auction detail window */
    .auction-detail-window {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
    }
}

@media (max-width: 480px) {
    .app-logo {
        font-size: 14px;
    }
    
    .dashboard-card .number {
        font-size: 28px;
    }
    
    .dashboard-card .label {
        font-size: 12px;
    }
    
    /* Stack auction details vertically */
    .mobile-auction-details {
        grid-template-columns: 1fr;
    }
}

/* Safe area for notch devices */
@supports (padding: max(0px)) {
    .app-header {
        padding-top: max(8px, env(safe-area-inset-top));
    }
    
    .mobile-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

/* Touch-friendly buttons */
@media (pointer: coarse) {
    .x-btn {
        min-height: 44px;
    }
    
    .x-form-field {
        min-height: 44px;
    }
    
    .mobile-auction-btn {
        min-height: 44px;
    }
}

/* Watched auctions flag colors */
.flag-none { background: #ccc; }
.flag-red { background: #f44336; }
.flag-yellow { background: #ffeb3b; }
.flag-green { background: #4caf50; }
.flag-purple { background: #9c27b0; }
.flag-blue { background: #2196f3; }
.flag-orange { background: #ff9800; }

/* Watched auction inline editing */
.watched-comment-input,
.estimated-input {
    border: 1px solid #667eea !important;
    border-radius: 3px;
    padding: 2px 4px;
}

.watched-comment-input:focus,
.estimated-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* Watched grid row hover */
.x-grid-item:hover .watched-comment-display {
    background: #f5f5f5;
    border-radius: 3px;
    padding: 2px 6px;
}

/* Auction type badge */
.auction-type-bid {
    background: #E3F2FD;
    color: #1565C0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
}

.auction-type-sofort {
    background: #FFF3E0;
    color: #E65100;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
}

.auction-type-both {
    background: #F3E5F5;
    color: #7B1FA2;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
}
