/* ComputerSystems specific styles */
.table-wrapper {
    position: relative;
    width: 100%;
    min-height: 200px;
    height: auto;
    max-height: calc(100vh - 200px);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.table-body-container {
    width: 100%;
    flex: 1;
    overflow: auto;
    position: relative;
}

.data-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    table-layout: fixed;
}

/* Table header */
.data-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
}

.data-table th {
    position: sticky;
    top: 0;
    background-color: #f8fafc;
    padding: 4px 6px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    height: 32px;
    font-size: 0.875rem;
}

/* Make the action column sticky */
.data-table th:last-child {
    position: sticky;
    right: 0;
    z-index: 3;
    background-color: #f8fafc;
    border-left: 2px solid #e2e8f0;
}

.data-table td:last-child {
    position: sticky;
    right: 0;
    background-color: #fff;
    border-left: 2px solid #e2e8f0;
    z-index: 1;
}

/* Table body */
.data-table tbody tr {
    height: 32px;
}

.data-table td {
    padding: 4px 6px;
    border-bottom: 1px solid #e2e8f0;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.875rem;
    background-color: #fff;
}

/* Adjust table height based on content */
@media screen and (min-height: 600px) {
    .table-wrapper {
        height: auto;
        min-height: 300px;
    }
}

@media screen and (min-height: 800px) {
    .table-wrapper {
        height: auto;
        min-height: 400px;
    }
}

@media screen and (min-height: 1000px) {
    .table-wrapper {
        height: auto;
        min-height: 500px;
    }
}

/* Custom scrollbar styles */
.table-body-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

.table-body-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-body-container::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.table-body-container::-webkit-scrollbar-corner {
    background: #f8fafc;
}

/* Hover styles */
.data-table tr:hover td {
    background-color: #f8fafc;
}

.data-table tr:hover td:last-child {
    background-color: #f8fafc;
}

/* Fixed column widths */
.data-table th:nth-child(1), .data-table td:nth-child(1) { min-width: 80px; width: 80px; } /* ID */
.data-table th:nth-child(2), .data-table td:nth-child(2) { min-width: 150px; width: 150px; } /* Name */
.data-table th:nth-child(3), .data-table td:nth-child(3) { min-width: 150px; width: 150px; } /* Manufacturer */
.data-table th:nth-child(4), .data-table td:nth-child(4) { min-width: 150px; width: 150px; } /* Serial Number */
.data-table th:nth-child(5), .data-table td:nth-child(5) { min-width: 120px; width: 120px; } /* Category */
.data-table th:nth-child(6), .data-table td:nth-child(6) { min-width: 150px; width: 150px; } /* Motherboard */
.data-table th:nth-child(7), .data-table td:nth-child(7) { min-width: 150px; width: 150px; } /* Processor */
.data-table th:nth-child(8), .data-table td:nth-child(8) { min-width: 100px; width: 100px; } /* RAM */
.data-table th:nth-child(9), .data-table td:nth-child(9) { min-width: 150px; width: 150px; } /* Storage */
.data-table th:nth-child(10), .data-table td:nth-child(10) { min-width: 100px; width: 100px; } /* Graphics */
.data-table th:nth-child(11), .data-table td:nth-child(11) { min-width: 120px; width: 120px; } /* Purchase Date */
.data-table th:nth-child(12), .data-table td:nth-child(12) { min-width: 100px; width: 100px; } /* Status */
.data-table th:nth-child(13), .data-table td:nth-child(13) { min-width: 120px; width: 120px; } /* Location */
.data-table th:nth-child(14), .data-table td:nth-child(14) { min-width: 120px; width: 120px; } /* OS */
.data-table th:nth-child(15), .data-table td:nth-child(15) { min-width: 120px; width: 120px; } /* Designation */
.data-table th:nth-child(16), .data-table td:nth-child(16) { min-width: 120px; width: 120px; } /* Assigned To */
.data-table th:nth-child(17), .data-table td:nth-child(17) { min-width: 200px; width: 200px; } /* Notes */
.data-table th:last-child, .data-table td:last-child { min-width: 100px; width: 100px; } /* Actions */

/* Action buttons container */
.data-table td:last-child {
    padding: 4px;
    text-align: center;
}

/* Rest of the styles remain the same */
.add-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #3b82f6;
    color: white;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.add-button:hover {
    background-color: #2563eb;
}

.add-button-icon {
    width: 20px;
    height: 20px;
}

/* Modal styles */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

/* Form grid layout */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

/* Status colors */
.status-available {
    color: #059669;
}

.status-in-use {
    color: #d97706;
}

.status-maintenance {
    color: #dc2626;
}

.status-reserved {
    color: #6366f1;
}

/* Settings button */
.settings-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #374151;
    font-weight: 500;
    transition: all 0.2s;
}

.settings-button:hover {
    background-color: #e5e7eb;
}

.settings-button svg {
    width: 20px;
    height: 20px;
}

/* Mobile optimizations */
@media (max-width: 1024px) {
    .table-wrapper {
        margin: 0 -20px;
        padding: 0 20px;
        width: calc(100% + 40px);
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .table-wrapper {
        margin: 0 -10px;
        padding: 0 10px;
        width: calc(100% + 20px);
    }

    .modal-form {
        padding: 10px;
    }
}

/* Animation classes */
.row-animation {
    animation: rowFadeIn 0.3s ease-out;
}

@keyframes rowFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-animation {
    animation: successHighlight 1s ease-out;
}

@keyframes successHighlight {
    0% {
        background-color: #86efac;
    }
    100% {
        background-color: transparent;
    }
}

/* Modal animations */
.modal-animation {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.overlay-animation {
    animation: overlayFadeIn 0.3s ease-out;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
