:root {
    /* Theme Colors */
    --bg-color: #282a36;
    --panel-bg: #44475a;
    --text-color: #f8f8f2;
    --accent-color: #bd93f9;
    /* Purple */
    --secondary-text: #8be9fd;
    /* Comment */
    --border-color: #6272a4;
    --highlight: #ff79c6;
    /* Pink */
    --cyan: #8be9fd;
    --green: #50fa7b;
    --orange: #ffb86c;
    --purple: #bd93f9;
    --red: #ff5555;
    --yellow: #f1fa8c;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 20% 50%, rgba(189, 147, 249, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 121, 198, 0.03) 0%, transparent 50%),
        repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(98, 114, 164, 0.03) 2px,
            rgba(98, 114, 164, 0.03) 4px);
    background-attachment: fixed;
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 900px;
    background-color: var(--panel-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 30px;
    border: 1px solid var(--border-color);
}

h1 {
    font-family: 'Rajdhani', sans-serif;
    text-align: center;
    margin-bottom: 30px;
    color: var(--accent-color);
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-size: 2.5rem;
    text-shadow: 0 0 20px rgba(189, 147, 249, 0.5),
        0 0 40px rgba(189, 147, 249, 0.2);
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}

.btn {
    background-color: var(--accent-color);
    color: var(--bg-color);
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Dropdown Styling */
.control-panel {
    margin-bottom: 30px;
    text-align: center;
}

label {
    font-size: 1.1rem;
    margin-right: 15px;
    color: var(--secondary-text);
}

select {
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

/* Layout Styling */
.top-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .top-section {
        grid-template-columns: 1fr 1fr;
    }
}

.bottom-section {
    width: 100%;
    margin-bottom: 20px;
}

.info-group {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.info-group:last-child {
    border-bottom: none;
}

.label {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.value {
    font-size: 1.1rem;
    line-height: 1.5;
}

ul {
    margin: 0;
    padding-left: 20px;
}

li {
    margin-bottom: 5px;
}

.gear-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.95rem;
    table-layout: fixed;
    /* Added for predictable column widths */
}

.gear-table th,
.gear-table td {
    text-align: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    /* Ensure vertical alignment */
}

.gear-table td:first-child {
    /* Targets the Slot column */
    white-space: nowrap;
    width: 24%;
    /* Fixed width for Slot */
}

/* Specific Column Widths - Evenly Distributed */
.gear-table th:nth-child(2),
.gear-table td:nth-child(2) {
    /* Hide Column */
    width: 20%;
}

.gear-table th:nth-child(3),
.gear-table td:nth-child(3) {
    /* Item Column */
    width: 28%;
}

.gear-table th:nth-child(4),
.gear-table td:nth-child(4) {
    /* Mod Column */
    width: 28%;
}

/* Ensure inputs and selects fit perfectly */
.gear-table select,
.gear-table input {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    min-width: 0;
    /* Override global min-width to fit in table */
}

/* Request Form Styling */
.request-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.request-form textarea {
    width: 100%;
    height: 300px;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: #333;
    color: var(--text-color);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.request-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(189, 147, 249, 0.2);
}

.submit-btn {
    align-self: flex-start;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.gear-table th {
    color: var(--secondary-text);
    font-weight: 600;
}

.gear-table tr:last-child td {
    border-bottom: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none;
}

/* Loading State */
.loading-message {
    text-align: center;
    color: var(--secondary-text);
    font-style: italic;
    margin-top: 20px;
}

/* Add Build Form Styling */
.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.form-group label {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: var(--secondary-text);
}

.input-field {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    width: 100%;
    box-sizing: border-box;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Ensure selects match inputs */
select {
    width: 100%;
    box-sizing: border-box;
}

/* Gear Table Inputs */
.gear-table input {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-color);
    padding: 5px;
    width: 100%;
}

.gear-table input:focus {
    border-color: var(--accent-color);
    background-color: #333;
    border-radius: 4px;
}

.gear-table input::placeholder {
    color: #555;
    font-style: italic;
}

/* Admin Login Link styles removed as it is now a button in the control panel */

/* Modal Styling */
.modal {
    display: flex;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--panel-bg);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

.close {
    color: var(--secondary-text);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: var(--red);
    text-decoration: none;
}

.modal h2 {
    margin-top: 0;
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 20px;
}

.error-message {
    color: var(--red);
    font-size: 0.9rem;
    margin-top: 10px;
    text-align: center;
    min-height: 1.2em;
}

/* Module Card System */
.module-card {
    background: linear-gradient(135deg, rgba(68, 71, 90, 0.6) 0%, rgba(40, 42, 54, 0.8) 100%);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(189, 147, 249, 0.1);
    transition: all 0.3s ease;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    padding: 1px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--highlight) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0.3;
    pointer-events: none;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(189, 147, 249, 0.15),
        inset 0 1px 0 rgba(189, 147, 249, 0.2);
}

/* Module Headers */
.module-header {
    font-family: 'Rajdhani', 'Segoe UI', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(189, 147, 249, 0.4);
}

/* Label Icons */
.label-icon {
    width: 18px;
    height: 18px;
    color: var(--highlight);
    filter: drop-shadow(0 0 4px rgba(255, 121, 198, 0.6));
}

/* Data Chip Styling for Cradle & Abilities */
.grid-container .form-group,
.list-container .form-group {
    background: rgba(40, 42, 54, 0.5);
    border: 1px solid rgba(98, 114, 164, 0.4);
    border-radius: 6px;
    padding: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.grid-container .form-group::after,
.list-container .form-group::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(189, 147, 249, 0.1), transparent);
    transition: left 0.5s ease;
}

.grid-container .form-group:hover,
.list-container .form-group:hover {
    border-color: var(--accent-color);
    background: rgba(68, 71, 90, 0.6);
    box-shadow:
        0 0 15px rgba(189, 147, 249, 0.2),
        inset 0 0 10px rgba(189, 147, 249, 0.05);
}

.grid-container .form-group:hover::after,
.list-container .form-group:hover::after {
    left: 100%;
}

.grid-container .form-group label,
.list-container .form-group label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--secondary-text);
    margin-bottom: 6px;
}

/* Enhanced Dropdown Styling */
.dropdown-enhanced,
select.input-field,
select {
    font-family: 'Inter', sans-serif;
    padding: 12px 16px;
    font-size: 0.95rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    appearance: none;
    /* Remove default browser styling */
    -webkit-appearance: none;
    /* For Safari */
}

.dropdown-enhanced:hover,
select.input-field:hover,
select:hover {
    border-color: var(--accent-color);
}

.dropdown-enhanced:focus,
select.input-field:focus,
select:focus {
    border-color: var(--highlight);
    box-shadow:
        0 0 20px rgba(255, 121, 198, 0.4),
        0 0 0 3px rgba(255, 121, 198, 0.1);
}

/* Enhanced Gear Table */
.gear-table {
    background: rgba(40, 42, 54, 0.4);
    border-radius: 8px;
    overflow: hidden;
}

.gear-table thead {
    background: linear-gradient(135deg, rgba(98, 114, 164, 0.3) 0%, rgba(68, 71, 90, 0.5) 100%);
}

.gear-table th {
    font-family: 'Rajdhani', sans-serif;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.9rem;
    padding: 16px;
    border-bottom: 2px solid var(--border-color);
}

.gear-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(98, 114, 164, 0.2);
}

.gear-table tbody tr:hover {
    background: rgba(189, 147, 249, 0.08);
    box-shadow: inset 0 0 20px rgba(189, 147, 249, 0.1);
}

.gear-table td {
    padding: 14px;
}

.gear-table td:first-child {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

/* Equipment Slot Styling */
.gear-table select {
    background: var(--bg-color);
    border-color: rgba(98, 114, 164, 0.5);
    font-size: 0.9rem;
    padding: 10px 12px;
}

.gear-table select:hover {
    background: rgba(68, 71, 90, 0.8);
}

/* Enhanced Primary Button */
.update-btn-primary {
    font-family: 'Rajdhani', sans-serif;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--highlight) 100%);
    color: #ffffff;
    padding: 16px 40px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 15px rgba(189, 147, 249, 0.4),
        0 0 30px rgba(189, 147, 249, 0.2),
        inset 0 -2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.update-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.update-btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.6),
        0 0 50px rgba(255, 121, 198, 0.4),
        inset 0 -2px 10px rgba(0, 0, 0, 0.3);
    filter: brightness(1.15);
}

.update-btn-primary:active {
    transform: translateY(-1px) scale(1);
    box-shadow:
        0 4px 15px rgba(189, 147, 249, 0.5),
        0 0 30px rgba(189, 147, 249, 0.3);
}

.btn-icon {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8));
}

/* Enhanced Input Fields */
.input-field {
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px 16px;
    color: var(--text-color);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.input-field:hover {
    border-color: var(--accent-color);
    background: var(--bg-color);
    /* Use solid color */
}

.input-field:focus {
    outline: none;
    border-color: var(--highlight);
    background: var(--bg-color);
    /* Use solid color */
    box-shadow:
        0 0 20px rgba(255, 121, 198, 0.3),
        0 0 0 3px rgba(255, 121, 198, 0.1);
}

/* Build Header Module Special Styling */
.build-header-module {
    background: linear-gradient(135deg, rgba(189, 147, 249, 0.1) 0%, rgba(68, 71, 90, 0.6) 100%);
    border-color: var(--accent-color);
}

.build-header-module .label {
    font-size: 1.1rem;
}

.build-header-module .input-field {
    font-size: 1.2rem;
    font-weight: 500;
    padding: 14px 18px;
    background: rgba(40, 42, 54, 0.8);
}

/* Specific Module Colors */
.cradle-module::before {
    background: linear-gradient(135deg, var(--cyan) 0%, var(--accent-color) 100%);
}

.abilities-module::before {
    background: linear-gradient(135deg, var(--yellow) 0%, var(--orange) 100%);
}

.calibration-module::before {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--highlight) 100%);
}

.gear-module::before {
    background: linear-gradient(135deg, var(--green) 0%, var(--cyan) 100%);
}



/* Animation for Page Load */
@keyframes moduleSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.module-card {
    animation: moduleSlideIn 0.5s ease-out forwards;
}

.build-header-module {
    animation-delay: 0.1s;
}

.cradle-module {
    animation-delay: 0.2s;
}

.abilities-module {
    animation-delay: 0.3s;
}

.calibration-module {
    animation-delay: 0.35s;
}

.gear-module {
    animation-delay: 0.4s;
}

/* Control Panel Enhancement */
.control-panel {
    text-align: center;
}

.control-panel label {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--secondary-text);
    text-transform: uppercase;
}

/* Top Section Layout */
.top-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.left-col,
.right-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .top-section {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2rem;
        letter-spacing: 2px;
    }

    .module-header {
        font-size: 0.9rem;
    }
}

.gear-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 8px;
    filter: drop-shadow(0 0 3px rgba(189, 147, 249, 0.5));
    /* Adds a subtle glow */
}

.left-col .module-card {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin-bottom: 0;
}

.left-col .module-card .info-group {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.left-col .module-card .grid-container {
    flex-grow: 1;
}

/* Mobile Optimization for Gear Table */
@media (max-width: 768px) {

    .gear-table,
    .gear-table tbody,
    .gear-table tr,
    .gear-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .gear-table thead {
        display: none;
        /* Hide standard headers */
    }

    .gear-table tr {
        margin-bottom: 20px;
        background: rgba(40, 42, 54, 0.4);
        border: 1px solid var(--border-color);
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .gear-table td {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        text-align: left;
        padding: 12px 15px;
        border-bottom: 1px solid rgba(98, 114, 164, 0.2);
        min-height: 40px;
        gap: 15px;
        /* Ensure gap between label and value */
    }

    .gear-table td:last-child {
        border-bottom: none;
    }

    /* Slot Header (First Column) */
    .gear-table td:first-child {
        background: linear-gradient(90deg, rgba(68, 71, 90, 0.8) 0%, rgba(40, 42, 54, 0.8) 100%);
        color: var(--accent-color);
        font-weight: 700;
        letter-spacing: 1px;
        border-bottom: 1px solid var(--border-color);
    }

    /* Add Labels via ::before */
    .gear-table td:nth-of-type(2)::before {
        content: "Hide";
        font-weight: 600;
        color: var(--secondary-text);
        text-transform: uppercase;
        font-size: 0.85rem;
        min-width: 45px;
        /* Fixed width for alignment */
    }

    .gear-table td:nth-of-type(3)::before {
        content: "Item";
        font-weight: 600;
        color: var(--secondary-text);
        text-transform: uppercase;
        font-size: 0.85rem;
        min-width: 45px;
    }

    .gear-table td:nth-of-type(4)::before {
        content: "Mod";
        font-weight: 600;
        color: var(--secondary-text);
        text-transform: uppercase;
        font-size: 0.85rem;
        min-width: 45px;
    }

    /* Hide empty cells (like Hide column for weapons) */
    .gear-table td:empty {
        display: none;
    }

    /* Fix for Select inputs in Add Build page */
    .gear-table select,
    .gear-table input {
        width: 60%;
        /* Give inputs some space but let label show */
        max-width: 200px;
    }
}