/* inventory.css - Styles for the inventory application */

/* SVG Icon Styles */
.icon {
    display: inline-block;
    vertical-align: middle;
}

.icon-header {
    width: 1.2em;
    height: 1.2em;
}

.icon-inline {
    width: 1em;
    height: 1em;
    margin-right: 0.25em;
    vertical-align: -0.125em;
}

.icon-empty-state {
    width: 4em;
    height: 4em;
}

body.inventory-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    background: #f5f5f5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Header */
.header {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-primary {
    background: #1976d2;
    color: white;
}

.btn-primary:hover {
    background: #1565c0;
}

.btn-secondary {
    background: #757575;
    color: white;
}

.btn-secondary:hover {
    background: #616161;
}

.btn-danger {
    background: #d32f2f;
    color: white;
}

.btn-danger:hover {
    background: #c62828;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Layout */
.main-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}

/* Sidebar */
.sidebar {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: fit-content;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.sidebar h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.inventory-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.inventory-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    border: 1px solid #e0e0e0;
}

.inventory-item:hover {
    background: #f5f5f5;
}

.inventory-item.active {
    background: #e3f2fd;
    border-color: #1976d2;
}

.inventory-name {
    font-weight: 500;
    color: #333;
}

.inventory-count {
    font-size: 12px;
    color: #757575;
    margin-top: 4px;
}

/* Content Area */
.content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.content-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.content-actions {
    display: flex;
    gap: 10px;
}

/* Search */
.search-bar {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
    color: #757575;
}

.breadcrumb-item {
    cursor: pointer;
    color: #1976d2;
    user-select: none;
}

.breadcrumb-item:hover {
    text-decoration: underline;
    background-color: rgba(25, 118, 210, 0.08);
    padding: 2px 4px;
    border-radius: 3px;
    margin: -2px -4px;
}

.breadcrumb-separator {
    color: #bdbdbd;
}

/* Item List */
.item-list {
    display: grid;
    gap: 12px;
}

.item-card {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    transition: box-shadow 0.2s;
    cursor: pointer;
}

.item-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}

.item-name {
    font-weight: 500;
    font-size: 16px;
    color: #333;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.item-description {
    color: #757575;
    font-size: 14px;
    margin-bottom: 8px;
}

.item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #616161;
}

.item-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.item-location {
    color: #1976d2;
}

.item-quantity {
    font-weight: 500;
}

.item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.item-attributes {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.attribute {
    font-size: 12px;
    color: #616161;
    margin-bottom: 4px;
}

.attribute-key {
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    max-width: 900px;
    width: 95%;
    max-height: none;
    margin-bottom: 20px;
}

.modal-content.modal-small {
    max-width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #757575;
    padding: 0;
}

/* Form */
.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 13px;
    color: #333;
}

.form-group small {
    display: block;
    margin-top: 3px;
    font-size: 11px;
}

.form-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #1976d2;
}

textarea.form-input {
    min-height: 60px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Tags Input */
.tags-input-container {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 6px;
    min-height: 36px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.tags-input-container:focus-within {
    border-color: #1976d2;
}

.tag-item {
    background: #e3f2fd;
    color: #1976d2;
    padding: 3px 7px;
    border-radius: 11px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tag-remove {
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
}

.tags-input {
    border: none;
    outline: none;
    padding: 3px;
    flex: 1;
    min-width: 80px;
    font-size: 12px;
}

/* Attributes */
.attributes-container {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px;
}

.attribute-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    margin-bottom: 6px;
}

.attribute-row:last-child {
    margin-bottom: 0;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #757575;
}

.empty-state-icon {
    margin-bottom: 15px;
    opacity: 0.5;
    display: flex;
    justify-content: center;
}

.empty-state-text {
    font-size: 16px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #757575;
}

/* Attachments */
.attachments-list {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 6px;
    margin-bottom: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px;
    border-bottom: 1px solid #f0f0f0;
    gap: 8px;
}

.attachment-item:last-child {
    border-bottom: none;
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-weight: 500;
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-meta {
    font-size: 11px;
    color: #757575;
    margin-top: 2px;
}

.attachment-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.attachment-type-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 6px;
    border-radius: 9px;
    font-size: 10px;
    margin-right: 4px;
}

.item-attachment-badge {
    color: #757575;
    font-size: 13px;
}

/* Mobile back button - hidden by default */
.mobile-back {
    display: none;
    padding: 12px 0;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .container {
        padding: 8px;
    }
    
    .main-layout {
        display: block !important;
        grid-template-columns: none !important;
        gap: 0 !important;
        height: auto;
    }
    
    .sidebar,
    .content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        border-radius: 8px;
        margin-bottom: 0;
        padding: 16px;
        box-sizing: border-box;
    }
    
    /* Hide content by default on mobile */
    .content {
        display: none;
    }
    
    /* Show content when active */
    .content.mobile-active {
        display: block !important;
    }
    
    /* Show sidebar by default, hide when content is active */
    .sidebar {
        display: block;
    }
    
    .sidebar.mobile-hidden {
        display: none !important;
    }
    
    /* Show mobile back button */
    .mobile-back {
        display: block;
    }
    
    /* Adjust content header for mobile */
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .content-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .content-actions button {
        flex: 1;
        min-width: fit-content;
    }
    
    /* Hide header on mobile */
    .header {
        padding: 12px 0;
    }
    
    .header h1 {
        font-size: 20px;
    }
}

