:root {
    /* Primary colors */
    --primary-color: #455a64;        /* Steel blue-grey */
    --primary-dark: #1c313a;         /* Dark gunmetal */
    --primary-light: #718792;        /* Light steel */
    
    /* Accent colors */
    --accent-color: #78909c;         /* Industrial grey */
    --accent-dark: #4b636e;          /* Dark steel */
    
    /* Background colors */
    --bg-light: #eceff1;             /* Light metallic */
    --bg-dark: #263238;              /* Dark iron */
    
    /* Border colors */
    --border-color: #546e7a;         /* Metal grey */
    
    /* Text colors */
    --text-dark: #263238;            /* Dark iron */
    --text-light: #eceff1;           /* Light metallic */
}

/* Global Styles */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.footer {
    margin-top: auto;
    background-color: var(--primary-dark);
    color: var(--text-light);
}

/* Navigation */
.navbar {
    background-color: var(--primary-color);
    border-bottom: 2px solid var(--accent-dark);
    box-shadow: 0 2px 4px rgba(0,0,0,.2);
}

.navbar-dark .navbar-brand,
.navbar-dark .nav-link {
    color: var(--text-light);
}

/* Cards */
.card {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    border: 1px solid var(--border-color);
}

.card-header {
    background-color: var(--primary-color);
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color);
}

/* Tables */
.table th {
    background-color: var(--primary-color);
    color: var(--text-light);
}

/* Forms */
.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(120, 144, 156, .25);
}

/* Buttons */
.btn {
    font-weight: 500;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-dark);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--accent-color);
    border-color: var(--accent-dark);
}

.btn-secondary:hover {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
}

/* Alerts */
.alert {
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* Feature Icons */
.feature-icon {
    background-color: var(--primary-color) !important;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    color: var(--text-light) !important;
    border: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary-dark) !important;
    color: var(--text-light) !important;
    border: none;
}

/* Custom badge colors */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-secondary {
    background-color: var(--accent-color) !important;
}

/* Rating stars */
.rating label {
    color: var(--accent-color);
}

.rating input:checked ~ label {
    color: var(--primary-color);
}

/* List groups */
.list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-dark);
}

/* Modal headers */
.modal-header {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Dropdown menus */
.dropdown-item:hover {
    background-color: var(--bg-light);
}

.dropdown-item.active {
    background-color: var(--primary-color);
}

/* Text utilities */
.text-primary {
    color: var(--primary-color) !important;
}

.text-muted {
    color: var(--accent-color) !important;
}

/* Links */
a {
    color: var(--primary-color);
}

a:hover {
    color: var(--primary-dark);
}

/* Card refinements */
.card-header.bg-transparent {
    background-color: var(--bg-light) !important;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
}

/* List group refinements */
.list-group-item-action:hover {
    background-color: var(--bg-light);
}

.list-group-item-action:active {
    background-color: var(--primary-light);
    color: var(--text-light);
}

/* Badge colors */
.bg-warning {
    background-color: #d4a017 !important; /* Metallic gold */
    color: var(--text-dark);
}

.bg-info {
    background-color: #607d8b !important; /* Blue-grey steel */
    color: var(--text-light);
}

.bg-purple {
    background-color: #4a4e69 !important; /* Dark steel purple */
    color: var(--text-light);
}

.bg-teal {
    background-color: #2f4550 !important; /* Dark teal steel */
    color: var(--text-light);
}

.bg-orange {
    background-color: #b56b45 !important; /* Rusty orange */
    color: var(--text-light);
}

.bg-danger {
    background-color: #984447 !important; /* Dark rust red */
    color: var(--text-light);
}

/* Carousel controls */
.carousel-control-prev,
.carousel-control-next {
    background-color: var(--primary-color);
}

/* Form focus states */
.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(84, 110, 122, 0.25);
}

/* Dropdown refinements */
.dropdown-menu {
    border-color: var(--border-color);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-header {
    color: var(--primary-color);
    font-weight: 600;
}

.dropdown-divider {
    border-top-color: var(--border-color);
}

/* Message bubbles */
.message-bubble.bg-primary::before {
    border-color: transparent transparent transparent var(--primary-color) !important;
}

/* Pagination */
.page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
}

.page-link:hover {
    color: var(--primary-dark);
    background-color: var(--bg-light);
    border-color: var(--border-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-dark);
}

/* Table refinements */
.table {
    border-color: var(--border-color);
}

.table tbody tr:hover {
    background-color: var(--bg-light);
}

/* Alert refinements */
.alert-primary {
    background-color: var(--primary-light);
    color: var(--text-light);
    border-color: var(--primary-color);
}

.alert-warning {
    background-color: #fff3cd !important;
    color: #664d03 !important;
    border-color: #ffecb5 !important;
}

.alert-success {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
    border-color: #badbcc !important;
}

.alert-metal {
    background-color: #e9ecef !important;
    border-left: 4px solid #6c757d !important;
    color: var(--text-dark) !important;
}

/* Hover effects */
.hover-shadow:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2) !important;
}

/* Feature icon refinements */
.feature-icon.bg-gradient {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark)) !important;
}

/* DataTables refinements */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-color: var(--border-color);
}

.dataTables_wrapper .dataTables_info {
    color: var(--accent-color);
}

/* Button outline variants */
.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-light);
}

/* Toast notifications */
.toast {
    background-color: var(--bg-light);
    border-color: var(--border-color);
}

.toast-header {
    background-color: var(--primary-color);
    color: var(--text-light);
}

/* Add these table-specific styles */

/* Table cell width control */
.table th,
.table td {
    vertical-align: middle;
}

/* Specific column widths for certifications table */
#certsTable th:nth-child(1), /* Name */
#certsTable td:nth-child(1) {
    min-width: 200px;
    max-width: 300px;
}

#certsTable th:nth-child(2), /* Brand */
#certsTable td:nth-child(2),
#certsTable th:nth-child(3), /* Model */
#certsTable td:nth-child(3) {
    min-width: 100px;
    max-width: 150px;
}

#certsTable th:nth-child(4), /* Date */
#certsTable td:nth-child(4) {
    min-width: 100px;
    width: 120px;
}

#certsTable th:nth-child(5), /* Certified By */
#certsTable td:nth-child(5) {
    min-width: 120px;
}

#certsTable th:nth-child(6), /* Location */
#certsTable td:nth-child(6) {
    min-width: 150px;
}

#certsTable th:nth-child(7), /* Video */
#certsTable td:nth-child(7) {
    width: 80px;
}

#certsTable th:nth-child(8), /* Notes */
#certsTable td:nth-child(8) {
    min-width: 150px;
    max-width: 250px;
}

#certsTable th:nth-child(9), /* Visibility */
#certsTable td:nth-child(9) {
    width: 90px;
    text-align: center;
}

#certsTable th:nth-child(10), /* Actions */
#certsTable td:nth-child(10) {
    width: 140px;
    white-space: nowrap;
}

/* Prevent text overflow in table cells */
#certsTable td {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action buttons in tables */
.btn-group-table {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
}

/* Compact button styling for tables */
.table .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Stat cards on profile */
.stat-card {
    background-color: var(--bg-light);
    border-color: var(--border-color) !important;
    transition: all 0.2s ease-in-out;
}

.stat-card:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-dark) !important;
    color: var(--text-light);
}

.stat-card:hover h6.text-muted {
    color: var(--text-light) !important;
}

.stat-card h3 {
    color: var(--primary-color);
    font-weight: 600;
}

.stat-card:hover h3 {
    color: var(--text-light);
}

/* Archive/Inactive states */
.alert-metal {
    background-color: #e9ecef; /* Light grey background */
    border-left: 4px solid #6c757d; /* Steel grey accent */
    color: var(--text-dark);
}

.bg-metal {
    background-color: #6c757d !important; /* Steel grey */
    color: var(--text-light);
}

/* Archived item styling */
.archived-item {
    opacity: 0.9;
}

/* Archive icon animation */
.bi-archive-fill {
    animation: archiveShake 1s ease-in-out;
    color: #6c757d; /* Steel grey */
}

@keyframes archiveShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

/* Archived alert refinements */
.alert-metal .text-muted {
    color: #6c757d !important; /* Steel grey */
}

.alert-metal i {
    opacity: 1;
}

/* Add a subtle texture to archived elements */
.alert-metal {
    position: relative;
}

.alert-metal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(45deg, 
        rgba(0, 0, 0, 0.02) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(0, 0, 0, 0.02) 50%, 
        rgba(0, 0, 0, 0.02) 75%, 
        transparent 75%, 
        transparent
    );
    background-size: 3px 3px;
    pointer-events: none;
}

.comment-item {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}

.comment-item:hover {
    background-color: #f0f0f0;
}

.hover-actions .dropdown {
    opacity: 0;
    transition: opacity 0.2s;
}

.hover-actions:hover .dropdown {
    opacity: 1;
}

.reply-form {
    background-color: #fff;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    margin-top: 0.5rem;
}