/* Base styles */
html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #141428;
    color: #e9e9e9;
    margin: 0;
    padding: 0;
    height: 100%;
}

/* Blazor error UI styles */
#blazor-error-ui {
    background: #1a0d25;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #ff9800;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* Game-themed colors and styles */
:root {
    --primary-color: #7038a8;
    --secondary-color: #3c1361;
    --accent-color: #ffd700;
    --success-color: #43a047;
    --danger-color: #f4511e;
    --warning-color: #fb8c00;
    --dark-overlay: rgba(20, 20, 40, 0.9);
    --item-border: #583a8e;
}

a, .btn-link {
    color: #9966cc;
    text-decoration: none;
    transition: color 0.2s ease;
}

    a:hover, .btn-link:hover {
        color: #bb99dd;
        text-decoration: underline;
    }

/* Table styling */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #e9e9e9;
    border-collapse: separate;
    border-spacing: 0;
}

    .table th,
    .table td {
        padding: 0.75rem;
        vertical-align: middle;
        border-top: 1px solid #2d1f4c;
    }

    .table thead th {
        background-color: #1f143a;
        border-bottom: 2px solid #3d296c;
        color: #ffd700;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .table tbody tr:hover {
        background-color: rgba(90, 64, 128, 0.3);
    }

    .table tbody tr:nth-of-type(odd) {
        background-color: rgba(30, 25, 50, 0.3);
    }

/* Button styling */
.btn {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    background: linear-gradient(to bottom, #6633cc, #4b2591);
    border: 1px solid #583a8e;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

    .btn-primary:hover {
        background: linear-gradient(to bottom, #7038a8, #53289e);
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.2);
    }

.btn-success {
    background: linear-gradient(to bottom, #388e3c, #2e7d32);
    border: 1px solid #43a047;
    color: #fff;
}

    .btn-success:hover {
        background: linear-gradient(to bottom, #43a047, #388e3c);
    }

/* Form control styles */
.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #e9e9e9;
    background-color: #232342;
    background-clip: padding-box;
    border: 1px solid #3d296c;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

    .form-control:focus {
        color: #e9e9e9;
        background-color: #2c2c52;
        border-color: #7038a8;
        outline: 0;
        box-shadow: 0 0 0 0.2rem rgba(112, 56, 168, 0.25);
    }

/* Game-themed profit/loss colors */
.text-success {
    color: #4CAF50 !important;
}

.text-danger {
    color: #FF5252 !important;
}

/* Global utility classes */
.fw-bold {
    font-weight: bold;
}

.text-center {
    text-align: center;
}

.text-end {
    text-align: right;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

/* Card styles - updated for dark theme consistency */
.card {
    background-color: #1e1e3f;
    border: 1px solid #3d296c;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
    color: #e9e9e9;
}

.card-body {
    padding: 1.5rem;
    background-color: #1e1e3f;
}

.card-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(90deg, #1a1a35, #2d1f4c);
    border-bottom: 1px solid #3d296c;
    color: #e9e9e9;
    font-weight: 600;
}

/* Form labels in dark theme */
.form-label {
    color: #e9e9e9;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Form text (help text under inputs) */
.form-text {
    color: #bb99dd;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Example text styling */
.example-text {
    color: #bb99dd;
    font-size: 0.875rem;
    font-style: italic;
}

/* Action button styles */
.action-button {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background-color: rgba(100, 100, 150, 0.1);
    border: 1px solid rgba(100, 100, 150, 0.3);
    color: #bb99dd;
    margin: 0 2px;
    transition: all 0.2s ease;
}

    .action-button:hover {
        background-color: rgba(100, 100, 150, 0.3);
        transform: translateY(-2px);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    .action-button.view:hover {
        color: #4fc3f7;
        border-color: #4fc3f7;
    }

    .action-button.edit:hover {
        color: #ffd700;
        border-color: #ffd700;
    }

    .action-button.delete:hover {
        color: #ff5252;
        border-color: #ff5252;
    }

/* Add proper icon styling */
.bi {
    font-size: 1rem;
}

/* Autocomplete styles */
.autocomplete-container {
    position: relative;
    margin-bottom: 1rem;
}

.autocomplete-suggestions {
    position: absolute;
    z-index: 1000;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background-color: #232342;
    border: 1px solid #3d296c;
    border-radius: 0.25rem;
    margin-top: 2px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.suggestion-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #e9e9e9;
}

    .suggestion-item:hover, .suggestion-item.selected {
        background-color: #2c2c52;
        font-weight: 500;
    }

.autocomplete-container.is-loading .form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 50 50'%3E%3Cpath fill='%23ced4da' d='M25,5A20.14,20.14,0,0,1,45,22.88a2.51,2.51,0,0,0,2.49,2.26h0A2.52,2.52,0,0,0,50,22.33a25.14,25.14,0,0,0-50,0,2.52,2.52,0,0,0,2.5,2.81h0A2.51,2.51,0,0,0,5,22.88,20.14,20.14,0,0,1,25,5Z'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='0.6s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
}

.item-image-container {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto;
}

.spinner-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.1);
}

/* Add some transition effects for a smoother UI */
.form-control {
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.invalid-feedback {
    transition: opacity 0.3s ease-in-out;
}

.table > tbody > tr {
    height: 50px;
}

    .table > tbody > tr > td {
        vertical-align: middle;
    }

.profit-positive {
    color: #198754;
}

.profit-negative {
    color: #dc3545;
}

.action-button {
    background: none;
    border: none;
    padding: 4px 8px;
    margin: 0 2px;
    border-radius: 4px;
    cursor: pointer;
}

    .action-button.view:hover {
        color: #0d6efd;
    }

    .action-button.edit:hover {
        color: #ffc107;
    }

    .action-button.delete:hover {
        color: #dc3545;
    }

/* Modal styling for dark theme */
.modal-content {
    background-color: #1e1e3f;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid #3d296c;
    color: #e9e9e9;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(90deg, #1a1a35, #2d1f4c);
    border-bottom: 1px solid #3d296c;
}

    .modal-header .modal-title {
        font-weight: 600;
        color: #e9e9e9;
    }

.modal-body {
    padding: 1.5rem;
    background-color: #1e1e3f;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background: linear-gradient(90deg, #1a1a35, #2d1f4c);
    border-top: 1px solid #3d296c;
}

/* Form control improvements for dark theme */
.modal .form-control {
    padding: 0.6rem 0.8rem;
    border-radius: 4px;
    background-color: #232342;
    color: #e9e9e9;
    border: 1px solid #3d296c;
    transition: all 0.2s ease;
}

    .modal .form-control:focus {
        border-color: #7038a8;
        box-shadow: 0 0 0 0.25rem rgba(112, 56, 168, 0.25);
        background-color: #2c2c52;
    }

.modal .form-label {
    color: #e9e9e9;
    font-weight: 500;
}

/* Switch styling for dark theme */
.form-switch .form-check-input {
    background-color: #232342;
    border-color: #3d296c;
}

    .form-switch .form-check-input:checked {
        background-color: #7038a8;
        border-color: #583a8e;
    }

/* Close button styling */
.modal .btn-close {
    color: #e9e9e9;
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Button styling */
.modal .btn-primary {
    background: linear-gradient(to bottom, #6633cc, #4b2591);
    border: 1px solid #583a8e;
    color: #fff;
}

    .modal .btn-primary:hover {
        background: linear-gradient(to bottom, #7038a8, #53289e);
        border-color: #7038a8;
    }

.modal .btn-secondary {
    background: linear-gradient(to bottom, #3c3c5c, #2d2d4d);
    border: 1px solid #3d3d5d;
    color: #e9e9e9;
}

    .modal .btn-secondary:hover {
        background: linear-gradient(to bottom, #4c4c6c, #3d3d5d);
        border-color: #4c4c6c;
    }

/* Section headers */
.section-header {
    background: linear-gradient(90deg, #1a1a35, #2d1f4c);
    border-bottom: 1px solid #3d296c;
    color: #e9e9e9;
    font-weight: 600;
    padding: 1rem 1.5rem;
}

/* Different color schemes for different section types */
.price-summary .card-header {
    background: linear-gradient(90deg, #2c3e50, #6f42c1);
    color: white;
}

.analysis .card-header {
    background: linear-gradient(90deg, #583a8e, #43a047);
    color: white;
}

.sell-prices .card-header {
    background: linear-gradient(90deg, #6f42c1, #3498db);
    color: white;
}

.buy-prices .card-header {
    background: linear-gradient(90deg, #641e16, #ffd700);
    color: white;
}

/* Page title styling */
h1.display-4, h1.text-primary {
    color: #5b38a8 !important;
    font-weight: 700;
    border-bottom: 3px #6f42c1;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.text-muted {
    color: white !important;
}

.breadcrumb-item.active {
    color: white !important;
}

/* Modal backdrop */
.modal-backdrop.show {
    opacity: 0.5;
}

    /* Add backdrop blur effect */
    .modal-backdrop.show + .modal.show .modal-dialog {
        transform: translateY(0);
        transition: transform 0.3s ease-out;
    }


/* List group styling for dark theme */
.list-group-item {
    background-color: #232342;
    border-color: #3d296c;
    color: #e9e9e9;
}

    .list-group-item .badge {
        font-weight: 600;
    }

/* Override bootstrap's default list-group styles */
.card .list-group-item {
    background-color: #232342;
    border-color: #3d296c;
}

/* Table styling in cards */
.card .table {
    margin-bottom: 0;
}

    .card .table th {
        background-color: #1f143a;
        color: #ffd700;
        border-color: #3d296c;
    }

    .card .table td {
        border-color: #2d1f4c;
    }

/* Badge styling for consistency */
.badge.bg-primary {
    background: linear-gradient(to right, #6633cc, #4b2591) !important;
}

.badge.bg-secondary {
    background: linear-gradient(to right, #3c3c5c, #2d2d4d) !important;
}

.badge.bg-light {
    background-color: #3d296c !important;
    color: #e9e9e9 !important;
}

/* Fix text-muted in cards */
.card .text-muted {
    color: #bb99dd !important;
}

/* Table hover states in cards */
.card .table tbody tr:hover {
    background-color: rgba(90, 64, 128, 0.3);
}
/* Table rows with white backgrounds */
.table tbody tr {
    background-color: #1e1e3f;
}

    .table tbody tr:nth-of-type(even) {
        background-color: #232342;
    }

/* Fix for tables in cards */
.card .table tbody tr td {
    background-color: #1e1e3f;
    color: #e9e9e9;
}

.card .table tbody tr:nth-of-type(even) td {
    background-color: #232342;
}

/* Fix for tables on home page */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #1e1e3f;
    color: #e9e9e9;
}

.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: #232342;
    color: #e9e9e9;
}

/* Fix for hover state */
.table-hover tbody tr:hover td {
    background-color: rgba(90, 64, 128, 0.3) !important;
}

/* Add more contrast to table data elements */
.table td {
    color: #e9e9e9;
}

/* Ensure the badge text color is correct */
.badge {
    color: #e9e9e9 !important;
}

/* Fix price display in tables */
.fw-bold {
    color: #e9e9e9;
}