/* assets/css/styles.css */

/* Base Styles */
body { 
    font-family: Arial, sans-serif; 
    background: #dfdfdf; 
    margin: 0; 
    padding: 0; 
}
.container {
    width: 90%;
    max-width: 1500px;
    margin: 2rem auto;
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
h1, h2, h3 {
    color: #555;
}
a {
    text-decoration: none;
    color: #007bff;
}
a:hover {
    text-decoration: underline;
}

/* Table Styles */
table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 1rem;
}
table th, table td { 
    padding: 12px; 
    border-bottom: 1px solid #ddd; 
    text-align: left;
}
table th { 
    background: #5b9bd5; 
    color: #fff;
}
table tr:nth-child(even) { 
    background: #f9f9f9; 
}
table tr:hover { 
    background: #f1f1f1; 
}

/* Form Styles */
form input, form button, form select, form textarea {
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

form textarea {
    min-height: 100px;
    width: 100%;
}

form label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
    color: #555;
}

/* Button Styles */
button, .button {
    padding: 8px 16px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    display: inline-block;
    text-decoration: none;
}
button:hover, .button:hover {
    background: #0056b3;
    text-decoration: none;
}

.button.secondary {
    background: #6c757d;
}
.button.secondary:hover {
    background: #5a6268;
}

.button.success {
    background: #28a745;
}
.button.success:hover {
    background: #218838;
}

.button.warning {
    background: #ffc107;
    color: #212529;
}
.button.warning:hover {
    background: #e0a800;
}

.button.danger {
    background: #dc3545;
}
.button.danger:hover {
    background: #c82333;
}

/* Card Styles */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-title {
    margin: 0;
    color: #333;
    font-size: 1.25rem;
}

.card-body {
    padding: 0.5rem 0;
}

.card-footer {
    border-top: 1px solid #eee;
    padding-top: 1rem;
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Message Styles */
.message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 0.25rem;
    text-align: center;
}

.badge-primary {
    background-color: #007bff;
    color: #fff;
}

.badge-secondary {
    background-color: #6c757d;
    color: #fff;
}

.badge-success {
    background-color: #28a745;
    color: #fff;
}

.badge-danger {
    background-color: #dc3545;
    color: #fff;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-info {
    background-color: #17a2b8;
    color: #fff;
}

/* Status Colors */
.status-recent {
    background-color: #a8e6cf; /* Green */
}

.status-moderate {
    background-color: #ffd3b6; /* Yellow/Orange */
}

.status-overdue {
    background-color: #ffaaa5; /* Red */
}

.status-unknown {
    background-color: #d8d8d8; /* Gray */
}

/* Item Label Styles */
.item-label {
    width: 300px;
    padding: 15px;
    border: 1px solid #000;
    background-color: #fff;
    font-family: Arial, sans-serif;
}

.label-header {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
    border-bottom: 1px solid #000;
    padding-bottom: 5px;
}

.label-part-number {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
}

.label-serial {
    font-size: 16px;
    text-align: center;
    margin-bottom: 10px;
}

.label-qr {
    text-align: center;
    margin: 15px 0;
    min-height: 150px;
}

.label-location, .label-date {
    font-size: 14px;
    margin-top: 5px;
}

/* Responsive Table */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Tooltip */
.tooltip {
    position: absolute;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #000;
}

/* Scanner Styles */
.scanner-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 300px;
    margin: 0 auto;
    overflow: hidden;
}

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

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-target {
    width: 80%;
    height: 150px;
    border: 2px solid #fff;
    border-radius: 10px;
    box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.3);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 1rem;
        margin: 1rem auto;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .card-footer {
        flex-direction: column;
    }
    
    .card-footer .button {
        margin-bottom: 0.5rem;
        width: 100%;
        text-align: center;
    }
    
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}

/* Print Styles */
@media print {
    body {
        background: #fff;
    }
    
    .container {
        width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }
    
    .no-print {
        display: none !important;
    }
    
    .item-label {
        page-break-inside: avoid;
    }
}