/* Components Styles for Warehouse Inventory Management */

/* ========== Form Controls ========== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    background-color: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

.form-group input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* ========== Buttons ========== */
button {
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: var(--transition);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.primary-button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
}

.primary-button:hover:not(:disabled) {
    background-color: var(--primary-dark);
}

.secondary-button {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: none;
    border-radius: var(--border-radius);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
}

.secondary-button:hover:not(:disabled) {
    background-color: var(--secondary-dark);
}

.back-button {
    background-color: var(--secondary-color);
    border: none;
    border-radius: var(--border-radius);
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.back-button:hover {
    background-color: var(--secondary-dark);
}

.scan-button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    padding: 10px 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.scan-button:hover {
    background-color: var(--primary-dark);
}

.close-button {
    background: none;
    border: none;
    color: inherit;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.close-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.icon-button {
    background: none;
    border: none;
    color: inherit;
    font-size: 16px;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
}

.icon-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.button-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.action-button {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 2px 5px;
    font-size: 14px;
}

.action-button:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.action-button.delete {
    color: var(--error-color);
}

.action-button.delete:hover {
    color: #b90000;
}

/* ========== Toggle Switch ========== */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* ========== Badge Component ========== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    text-align: center;
}

.badge-info {
    background-color: rgba(0, 120, 212, 0.1);
    color: var(--primary-color);
}

.badge-success {
    background-color: rgba(16, 124, 16, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background-color: rgba(255, 185, 0, 0.1);
    color: var(--warning-color);
}

.badge-error {
    background-color: rgba(232, 17, 35, 0.1);
    color: var(--error-color);
}

/* ========== Tab Component ========== */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 500;
    border-bottom: 3px solid transparent;
}

.tab:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.tab.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========== Dropdown Component ========== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: var(--border-radius);
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    z-index: 100;
    display: none;
    border: 1px solid var(--border-color);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    font-size: 14px;
}

.dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dropdown-item.danger {
    color: var(--error-color);
}

.dropdown-item.danger:hover {
    background-color: rgba(232, 17, 35, 0.08);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 5px 0;
}

/* Admin Menu */
.admin-menu {
    position: relative;
    display: inline-block;
    margin-right: 8px;
}

.admin-menu .dropdown-menu {
    top: calc(100% + 5px);
    right: 0;
}

@media (max-width: 768px) {
    .dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 10px 10px 0 0;
        max-height: 50vh;
        overflow-y: auto;
    }
    
    .dropdown-item {
        padding: 15px;
    }
}

/* ========== Tooltip Component ========== */
.tooltip {
    position: relative;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 120px;
    background-color: #333;
    color: var(--white);
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ========== Responsive Table ========== */
.responsive-table {
    overflow-x: auto;
}

@media (max-width: 768px) {
    .responsive-table table {
        min-width: 600px;
    }
}

/* ========== Custom Scrollbar ========== */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ========== File Actions ========== */
.file-action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.file-action-button {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    cursor: pointer;
}

.file-action-button:hover {
    background-color: var(--secondary-color);
}
