* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8317c5;
    --primary-gradient: linear-gradient(0deg, #8317c5 0%, #a121da 100%);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="chuck" patternUnits="userSpaceOnUse" width="100" height="100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23chuck)"/></svg>');
}

.login-body {
    background: var(--primary-gradient);
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="chuck" patternUnits="userSpaceOnUse" width="100" height="100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23chuck)"/></svg>');
}

.header {
    background: #000000;
    color: white;
    height: 250px;
    padding: 20px;
    margin-bottom: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.inventory-section {
    background: #f0f9ff;
    padding: 30px;
    border-bottom: 1px solid #e0e7ff;
    margin-bottom: 0;
}

.inventory-stat {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.inventory-stat-number {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 8px;
}

.inventory-stat-label {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 500;
}

.controls {
    padding: 30px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.results {
    padding: 30px;
    background: white;
}

/* Ensure Bootstrap grid works properly */
.row {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 0;
    display: flex !important;
    flex-wrap: wrap !important;
    margin-top: calc(var(--bs-gutter-y) * -1);
    margin-right: calc(var(--bs-gutter-x) * -.5);
    margin-left: calc(var(--bs-gutter-x) * -.5);
}

.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: calc(var(--bs-gutter-x) * .5);
    padding-left: calc(var(--bs-gutter-x) * .5);
    margin-top: var(--bs-gutter-y);
}



.results-count {
    font-size: 18px;
    color: var(--gray-700);
    font-weight: 600;
}

.item-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 25px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Ensure grid columns work properly */
.col-lg-4, .col-md-6 {
    position: relative;
    width: 100%;
    padding-right: calc(var(--bs-gutter-x, 1.5rem) * .5);
    padding-left: calc(var(--bs-gutter-x, 1.5rem) * .5);
    margin-bottom: 50px;
}

@media (min-width: 768px) {
    .col-md-6 {
        flex: 0 0 auto;
        width: 50% !important;
    }
}

@media (min-width: 992px) {
    .col-lg-4 {
        flex: 0 0 auto;
        width: 33.33333333% !important;
    }
}

.item-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.item-card.deprecated {
    background: linear-gradient(135deg, #D3D3D3 0%, #bebebe 100%);
    border: 2px solid #bebebe;
}

.item-card.deprecated .item-header {
    background: linear-gradient(135deg, #D3D3D3 0%, #bebebe 100%);
}

.item-card.low-stock {
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 100%);
    border: 2px solid var(--warning-color);
    order: -1;
}

.item-card.low-stock .item-header {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
}

.item-card.out-of-stock {
    background: linear-gradient(135deg, #fee2e2 0%, #fca5a5 100%);
    border: 2px solid var(--danger-color);
    order: -2;
}

.item-card.out-of-stock .item-header {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
}

.item-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 14px;
    padding: 10px;
}

.catalog-item-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f8f9fa;
}

.catalog-item-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.catalog-item-placeholder::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: #8B3F9B;
    border-radius: 50%;
    opacity: 0.1;
}

.file-type-icon {
    font-size: 2.5rem;
    color: #8B3F9B;
    z-index: 1;
    position: relative;
}

.item-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.item-details {
    flex: 1;
}

/* Clickable stock badges */
.stock-badge {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}

.stock-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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

.stock-low-stock {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.stock-out-of-stock {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.stock-loading, .stock-n\/a {
    background: #e2e3e5;
    color: #6c757d;
    border: 1px solid #d6d8db;
}

/* Modal image styling */
.modal-image-container {
    width: 100%;
    max-height: 400px;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.modal-item-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Header styling (consolidated above) */

.header .position-relative {
    width: 100%;
    height: 100%;
}

/* Header logo styling */
.rose-logo {
    max-height: 200px;
    height: auto;
    width: auto;
}

/* Header user controls positioning */
.header-user-controls {
    position: absolute;
    top: 25px;
    right: 25px;
    color: white;
    z-index: 10;
}

/* User info styling */
.user-name {
    font-size: 0.9rem;
    color: #ffffff;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.item-header {
    background: var(--primary-gradient);
    color: white;
    padding: 15px 20px;
    margin: -20px -20px 15px -20px;
}

.item-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.item-sku {
    font-size: 14px;
    opacity: 0.9;
}

.item-details {
    display: grid;
    gap: 8px;
}

.item-detail {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #f1f1f1;
}

.item-detail:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--gray-700);
}

.detail-value {
    color: var(--gray-900);
    text-align: right;
    max-width: 60%;
    word-wrap: break-word;
}

.cost {
    font-size: 18px;
    font-weight: bold;
    color: var(--success-color);
}

.copy-btn {
    background: #FCE303;
    color: black;
    font-weight: bold;
    border: none;
    padding: 15px 20px;
    border-radius: 25px;
    text-transform: uppercase;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.copy-btn:hover {
    background: #e6cc03;
    transform: translateY(-2px);
    color: black;
    text-decoration: none;
}

.copy-btn:active {
    transform: translateY(0);
}

.filename-display,.form-control {
    background: var(--gray-50);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    margin: 10px 0;
    word-break: break-all;
    font-size: 10px;
}

.stock-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    width: max-content;
}

.stock-in-stock {
    background: var(--success-color);
    color: white;
}

.stock-low-stock {
    background: var(--warning-color);
    color: white;
}

.stock-out-of-stock {
    background: var(--danger-color);
    color: white;
}

.stock-loading {
    background: var(--gray-500);
    color: white;
}

.deprecated-badge {
    background: #2a2a2a;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

/* T.H.O.R.N. Flag Indicator */
.thorn-flag-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger-color);
    color: white;
    padding: 6px;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: thornPulse 2s infinite;
}

.thorn-flag-indicator i {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

@keyframes thornPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* T.H.O.R.N. Button Styling */
.btn-thorn {
    background-color: #fbbf24;
    border-color: #fbbf24;
    color: #8c700b;
    font-weight: bold;
    font-size: 0.85rem;
}

.btn-thorn:hover,
.btn-thorn:focus {
    background-color: #f59e0b;
    border-color: #f59e0b;
    color: #8c700b;
}

/* Custom outline danger button styling */
.btn-outline-danger {
    background-color: #fecaca;
    border-color: #dc2626;
    color: #dc2626;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    background-color: #f87171;
    border-color: #dc2626;
    color: #ffffff;
}

/* Login Page Styles */
.login-card {
    background: black;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 40px;
    text-align: center;
}

.login-title {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--gray-700);
    font-size: 18px;
    margin-bottom: 20px;
}

.btn-login {
    background: var(--primary-gradient);
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(131, 23, 197, 0.3);
}

/* Admin Panel Styles */
.card {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.card-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
}

.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.table td {
    vertical-align: middle;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 15px;
    }
    
    .header .d-flex {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .inventory-section,
    .controls,
    .results {
        padding: 20px 15px;
    }
    
    .item-card {
        margin-bottom: 20px;
    }
    
    .login-card {
        padding: 30px 20px;
    }
}

/* Utilities */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }

.btn-primary {
    background: var(--primary-gradient);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(0deg, #6d1397 0%, #8a1bb8 100%);
    border: none;
}
.modal-header {
    background: var(--primary-gradient);
    color: white;
    border-bottom: none;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    padding: 1rem 1.5rem;
}

.modal-title {
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
    margin: 0;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1); /* Makes close icon white */
}

.thorn-flag-btn {
color: rgb(140, 112, 11);
    font-weight:bold;
    
    
}

.thorn-flag-btn:hover {
color: rgb(215, 186, 80);
    font-weight:bold;


}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, .login-title, .item-name, .modal-title {
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.2;
}

h2, h3, .card-header, .inventory-stat-number,  {
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

/* Labels & smaller UI text */
.inventory-stat-label,
.item-sku,
.detail-label,
.detail-value,
.results-count,
.stock-badge,
.deprecated-badge,
.user-name,
.table th,
.table td,
.login-subtitle {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
}

/* Buttons */
.btn, .btn-login, .copy-btn {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.85rem;
    line-height: 1.2;
}
