/**
 * Kiosk Styles - Bootstrap Compatible
 * Label Kiosk & Admin System
 */

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    overflow-x: hidden;
}

/* Kiosk Body */
.kiosk-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Kiosk Header */
.kiosk-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: block;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.kiosk-topbar {
    display: flex;
    gap: 12px;
    align-items: center;
}

.kiosk-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.kiosk-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.kiosk-topbar-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.1;
}

.kiosk-topbar-search {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.kiosk-topbar-search input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 14px;
    font-size: 1.05rem;
    background: rgba(255,255,255,0.98);
    color: #111;
}

.kiosk-topbar-search input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.9);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.18);
}

.kiosk-topbar-search button {
    padding: 14px 18px;
    background: rgba(0,0,0,0.10);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 14px;
    font-size: 1.05rem;
    cursor: pointer;
}

.kiosk-topbar-search button:active {
    transform: scale(0.98);
}

/* Kiosk Main Content */
.kiosk-main {
    flex: 1;
    padding: 20px;
}

/* Category Card */
.category-card {
    background: white;
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
}

.category-card:active {
    transform: scale(0.95);
}

.category-card .icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.category-card .name {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 10px;
}

.search-bar input {
    flex: 1;
    padding: 15px 20px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 1.1rem;
}

.search-bar input:focus {
    outline: none;
    border-color: #667eea;
}

.search-bar button {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
}

/* Alphabet Filter */
.alphabet-filter button {
    min-width: 55.6px;
    padding: 12px 14px;
    font-size: 1.15rem;
    font-weight: 600;
}

.alphabet-filter a.btn {
    min-width: 56px;
    padding: 12px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Better wrapping for 1366x768 (2+ rows naturally) */
.alphabet-filter {
    row-gap: 10px;
}

/* Toast */
.toast-container {
    z-index: 9999;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #666;
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Card Styles */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Ensure kiosk label cards stretch full width on all browsers (Edge) */
.label-card {
    display: block;
    width: 100%;
}

.label-card .card-body {
    width: 100%;
}

.card:active {
    transform: scale(0.98);
}

/* Label Preview in Modal */
.label-preview-modal {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    text-align: center;
}

/* Ensure each preview line takes the full width (requested) */
.label-preview-modal > div {
    width: 100%;
}

/* Meta line under subtitle: force exact font size */
.label-preview-modal .modal-label-meta {
    color: #111;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.1;
    white-space: nowrap;
}

/* Attribute (variant) tag selector */
.attribute-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.attribute-tag {
    appearance: none;
    border: 2px solid #667eea;
    background: #fff;
    color: #333;
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.05s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.attribute-tag:active {
    transform: scale(0.98);
}

.attribute-tag.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: #1f2937;
    box-shadow: 0 0 0 2px rgba(31, 41, 55, 0.15);
}

/* Modal Enhancements */
.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-header {
    border-bottom: 1px solid #eee;
}

.modal-footer {
    border-top: 1px solid #eee;
}

/* Input Group Large */
.input-group-lg input {
    font-size: 1.25rem;
    padding: 0.75rem 1rem;
}

/* Responsive */
@media (max-width: 576px) {
    .kiosk-header {
        padding: 12px 15px;
    }
    
    .kiosk-header h1 {
        font-size: 1.2rem;
    }
    
    .kiosk-main {
        padding: 15px;
    }
    
    .search-bar input,
    .search-bar button {
        padding: 12px 15px;
    }
    
    .modal-dialog {
        margin: 10px;
    }
}

/* Back Button Override */
.btn-back {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-home {
    padding: 8px 12px;
}

/* Match home button sizing for fullscreen button in the header */
.btn-fullscreen {
    padding: 8px 12px;
}

/* Fullscreen icon is visually a bit smaller than home; bump it slightly */
.btn-fullscreen i {
    font-size: 1.1em;
}

/* Floating home button (bottom-right) */
.kiosk-fab-home {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 10px 24px rgba(0,0,0,0.25);
    z-index: 9998;
    font-size: 24px;
}

/* Floating home button (bottom-left) */
.kiosk-fab-home.kiosk-fab-home-left {
    right: auto;
    left: 16px;
}

.kiosk-fab-home:active {
    transform: scale(0.97);
}

/* Keep content clear of the floating button */
.kiosk-main {
    padding-bottom: 15px;
}

/* Disable text selection on touch elements */
.category-card,
.label-card,
.btn {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* Custom Label Button */
.btn-custom-label {
    display: block;
    padding: 18px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

/* Print Quantity Button */
.quantity-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    padding: 0;
}

/* Preview Image */
.preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Grid utilities */
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

/* Modal nav tabs */
.modal-nav-tabs {
    border-bottom: none;
    gap: 3px;
    flex-wrap: nowrap;
}
.modal-nav-tabs .nav-link {
    border-radius: 8px 8px 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 8px 10px;
    color: #555;
    border: 1px solid transparent;
    background: #f0f0f0;
    white-space: nowrap;
}
.modal-nav-tabs .nav-link.active {
    color: #0d6efd;
    background: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
}

/* Toast — krupno za touch ekrane */
.toast-container .toast {
    min-width: 320px;
    font-size: 1.25rem;
    padding: 6px 4px;
}
.toast-container .toast .toast-body {
    padding: 14px 18px;
    font-weight: 600;
}
