/* Main Styles for Warehouse Inventory Management */

/* ========== Base Styles ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #0078d4;
    --primary-dark: #106ebe;
    --secondary-color: #f0f0f0;
    --secondary-dark: #e0e0e0;
    --success-color: #107c10;
    --warning-color: #ffb900;
    --error-color: #e81123;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --bg-color: #f0f0f0;
    --white: #fff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-large: 0 4px 20px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s ease;
    --border-radius: 4px;
}

html, body {
    height: 100%;
    background-color: #666;
    overflow: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-color);
    font-weight: 500;
}

/* ========== Layout Styles ========== */
.app-container {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    max-height: 800px;
    margin: 0 auto;
    background-color: var(--bg-color);
    border-radius: 8px;
    box-shadow: var(--shadow-large);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

@media (max-width: 1200px) {
    .app-container {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

/* Header */
.header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.header h1 {
    font-size: 20px;
    font-weight: 500;
    color: var(--white);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Screens */
.screen {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px;
    display: none;
    background-color: var(--bg-color);
    overflow-y: auto;
}

.screen.active {
    display: block;
}

.screen-title {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--text-color);
}

/* Setup Screen */
.setup-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.setup-container h2 {
    text-align: center;
    margin-bottom: 20px;
}

.setup-container p {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-light);
}

.file-upload-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(0, 120, 212, 0.05);
}

.file-upload-area i {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.file-upload-area p {
    margin-bottom: 0;
}

.file-requirements {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.file-requirements h3 {
    margin-bottom: 10px;
}

.file-requirements ul {
    padding-left: 20px;
}

.file-requirements li {
    margin-bottom: 5px;
}

.file-preview {
    margin-top: 30px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.file-preview h3 {
    margin-bottom: 15px;
}

/* Home Screen */
.home-screen {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    padding-top: 40px;
}

.card-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    width: 100%;
    max-width: 800px;
}

.card {
    width: 220px;
    height: 220px;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 20px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.card-icon {
    width: 60px;
    height: 60px;
    background-color: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--primary-color);
}

.card-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.card-description {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.4;
}

/* Form Layouts */
.form-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.form-left, .form-right {
    flex: 1;
    min-width: 300px;
}

/* Table Layouts */
.table-container {
    margin-top: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: var(--white);
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #f5f5f5;
    border-bottom: 1px solid var(--border-color);
    padding: 10px;
    text-align: left;
    font-weight: 500;
}

td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

tr:last-child td {
    border-bottom: none;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Scanner Container */
.scanner-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: none;
    flex-direction: column;
}

.scanner-container.active {
    display: flex;
}

.scanner-header {
    padding: 15px;
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scanner-body {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.scanner-viewport {
    width: 280px;
    height: 280px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    position: relative;
}

.scanner-corners {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 4px solid var(--primary-color);
    border-radius: 2px;
}

.corner-top-left {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
}

.corner-top-right {
    top: -2px;
    right: -2px;
    border-left: none;
    border-bottom: none;
}

.corner-bottom-left {
    bottom: -2px;
    left: -2px;
    border-right: none;
    border-top: none;
}

.corner-bottom-right {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
}

.scanner-message {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--white);
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    font-size: 14px;
}

.scanner-footer {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* Report Screen */
.report-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.report-filters .form-group {
    flex: 1;
    min-width: 200px;
}

.report-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.summary-card {
    flex: 1;
    min-width: 150px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 15px;
    box-shadow: var(--shadow);
}

.summary-title {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.summary-value {
    font-size: 24px;
    font-weight: 500;
}

/* Item View */
.tree-view {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 20px;
    background-color: var(--white);
    max-height: 300px;
    overflow-y: auto;
}

.tree-item {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.tree-item:last-child {
    border-bottom: none;
}

.tree-item:hover {
    background-color: #f5f5f5;
}

.tree-item.selected {
    background-color: #deecf9;
}

.item-details {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--white);
}

.item-details h3 {
    margin-bottom: 16px;
    font-weight: 500;
}

.detail-row {
    display: flex;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.detail-label {
    width: 150px;
    font-weight: 500;
    color: var(--text-light);
}

.detail-value {
    flex: 1;
    min-width: 150px;
}

.placeholder-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    padding: 30px 0;
}

.placeholder-message i {
    font-size: 30px;
    margin-bottom: 15px;
    opacity: 0.7;
}

/* Search container */
.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-container input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background-color: #323130;
    color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateX(120%);
    transition: transform 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    max-width: 350px;
}

.notification.show {
    transform: translateX(0);
}

.notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.notification-message {
    flex: 1;
}

.close-notification {
    background: none;
    border: none;
    color: var(--white);
    opacity: 0.7;
    cursor: pointer;
}

.close-notification:hover {
    opacity: 1;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--white);
    border-radius: var(--border-radius);
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 500;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

/* Loading indicator */
.loading-indicator {
    padding: 20px;
    text-align: center;
    color: var(--text-light);
}

.loading-indicator i {
    margin-right: 10px;
}

/* Helper Classes */
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-32 { margin-top: 32px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.text-center { text-align: center; }
.align-self-end { align-self: flex-end; }

/* Media Queries */
@media (max-width: 768px) {
    .card-container {
        flex-direction: column;
        align-items: center;
    }
    
    .form-left, .form-right {
        min-width: 100%;
    }
    
    .report-filters .form-group,
    .summary-card {
        min-width: 100%;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    .app-container {
        max-width: 100%;
        max-height: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    .screen {
        padding: 15px 10px;
    }
    
    .screen-title {
        font-size: 20px;
    }
    
    .card {
        width: 100%;
        max-width: 280px;
    }
    
    .button-container {
        flex-direction: column;
        width: 100%;
    }
    
    .button-container button {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .search-container input {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .search-container button {
        width: 100%;
    }
    
    .table-container {
        max-width: 100%;
        overflow-x: auto;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .header {
        flex-direction: column;
        padding: 10px;
        gap: 10px;
        align-items: flex-start;
    }
    
    .detail-label {
        width: 120px;
    }
    
    .notification {
        max-width: calc(100% - 20px);
        left: 10px;
        right: 10px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 80vh;
    }
    
    .file-upload-area {
        padding: 20px 10px;
    }
    
    .file-requirements ul {
        padding-left: 15px;
    }
    
    .scanner-viewport {
        width: 220px;
        height: 220px;
    }
}
