:root {
    --bg-color: #121212;
    --text-color: #ffffff;
    --primary-color: #bb86fc;
    --secondary-color: #03dac6;
    --error-color: #cf6679;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(0, 0, 0, 0.3);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) rgba(0, 0, 0, 0.2);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    background-image: radial-gradient(circle at center, #252525, #121212 70%);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative; /* For absolute positioning of back button if needed, but flex/grid is better */
}

.back-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    font-weight: 500;
}

.back-home-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    color: #fff;
    transform: translateX(-5px);
}

h1 {
    text-align: center;
    font-weight: 700;
    letter-spacing: -1px;
    font-size: 2.5rem;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #fff 30%, #bb86fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(187, 134, 252, 0.3);
}

h2 {
    text-align: center;
    font-weight: 300;
    letter-spacing: 2px;
}

/* Glassmorphism Cards */
.card, #login-section, .accordion-item {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
    overflow: hidden;
}

#login-section {
    padding: 50px 30px;
    text-align: center;
    max-width: 420px;
    margin: 80px auto;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.login-icon i {
    font-size: 3.5rem;
    color: var(--text-color);
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(187, 134, 252, 0.6);
    animation: float 6s ease-in-out infinite;
}

#login-section h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    margin-top: 0;
    font-weight: 500;
}

#login-section p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 35px;
    line-height: 1.6;
    font-size: 1.05rem;
}

#steam-login-btn {
    display: inline-block;
    transition: transform 0.2s ease, filter 0.2s ease;
}

#steam-login-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.header p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Form Styles */
.form-section {
    padding: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group.half {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #b0b0b0;
    font-size: 0.9rem;
}

select, input[type="text"], input[type="number"] {
    width: 100%;
    padding: 10px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

select:focus, input:focus {
    outline: none;
    border-color: var(--primary-color);
}

select:disabled, input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Custom Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.checkbox-group label {
    margin-bottom: 0;
    color: var(--text-color);
}

/* Buttons */
.action-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    margin-top: 10px;
}

.action-btn:hover {
    background: #a370f7;
    transform: translateY(-2px);
}

.secondary-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.secondary-btn:hover {
    background: rgba(187, 134, 252, 0.1);
}

#logout-btn {
    background: transparent;
    border: 1px solid var(--error-color);
    color: var(--error-color);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

#logout-btn:hover {
    background: rgba(207, 102, 121, 0.1);
}

/* Accordion */
.accordion-header {
    width: 100%;
    padding: 15px 20px;
    background: none;
    border: none;
    color: var(--text-color);
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.accordion-header span {
    display: flex;
    align-items: center;
    gap: 10px;
}

.accordion-header i {
    color: var(--secondary-color);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.2);
}

.icon {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.accordion-header.active .icon {
    transform: rotate(45deg);
}

/* Table */
.list-section {
    padding: 20px;
}

.table-actions {
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-end;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

th {
    color: var(--secondary-color);
    font-weight: 600;
}

tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.delete-btn {
    color: var(--error-color);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s;
}

.delete-btn:hover {
    transform: scale(1.2);
}

/* Utility */
.hidden {
    display: none;
}

.wear-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.full-width {
    width: 100%;
}

.input-with-action input[readonly] {
    margin: 0;
}

.modal-header h3 {
    margin: 0;
    white-space: nowrap;
}

#message, #knife-message, #glove-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
}

.success {
    background: rgba(3, 218, 198, 0.2);
    color: var(--secondary-color);
    border: 1px solid rgba(3, 218, 198, 0.3);
}

.error {
    background: rgba(207, 102, 121, 0.2);
    color: var(--error-color);
    border: 1px solid rgba(207, 102, 121, 0.3);
}

/* Range Slider Styling */
input[type=range] {
    -webkit-appearance: none; 
    background: transparent; 
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
}

input[type=range]:focus {
    outline: none; 
}

/* Slider Track */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Slider Thumb */
input[type=range]::-webkit-slider-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -5px; /* Centers thumb on track */
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Input with Action Button Group */
.input-with-action {
    display: flex;
    gap: 8px;
}

.input-with-action input, 
.input-with-action select {
    flex-grow: 1;
}

.input-with-action button {
    white-space: nowrap;
}

/* Sticker Grid */
.sticker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

/* Modal Styling */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #1e1e1e;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    width: 80%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease-out;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255,255,255,0.02);
}

#browser-search {
    flex-grow: 1;
    max-width: 400px;
}

.browser-grid {
    padding: 20px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    flex-grow: 1;
}

.browser-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.browser-item:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.browser-item img {
    width: 100px;
    height: 75px;
    object-fit: contain;
}

.browser-item-name {
    font-size: 0.85rem;
    color: #ddd;
    word-break: break-word;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Server Banner */
.server-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    margin-bottom: 30px;
    background: linear-gradient(90deg, rgba(187, 134, 252, 0.1) 0%, rgba(3, 218, 198, 0.1) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.server-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.server-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary-color);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.server-name {
    font-size: 1.2rem;
    font-weight: 600;
}

.server-ip {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    font-family: monospace;
}

.server-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.small-btn {
    padding: 6px 10px;
    font-size: 1rem;
}

.server-connect-btn {
    background-color: #171a21; /* Steam color */
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.server-connect-btn:hover {
    background-color: #2a475e;
}
