@import url('https://fonts.googleapis.com/css2?family=Sofia+Sans:wght@400;600;700&display=swap');

/* ========== THEME VARIABLES ========== */
.view-dark {
    --wiki-body-background-image: url("https://windblown.wiki.gg/images/Site-background-3.jpg?51ba32");
    --wiki-body-background-color: #343B4C;
    --wiki-content-background-color: #0B0B28;
    --wiki-content-background-color--rgb: 11, 11, 40;
    --wiki-content-background-color--secondary: #1A0B28;
    --wiki-content-background-opacity: 0.9;
    --wiki-content-border-color: #9432a1;
    --wiki-content-text-color: #D5F4F5;
    --wiki-content-text-mix-color: #7e8791;
    --wiki-content-heading-color: #3bd2d4;
    --wiki-content-link-color: #F2009D;
    --wiki-content-link-color--rgb: 242, 0, 157;
    --wiki-accent-color: #cc33ba;
    --wiki-accent-color--hover: #f544e6;
    --wiki-accent-label-color: #fff;
    --color--rare-affix: #ffd218;
    --color--common-affix: #ffd9aa;
    --color--common-affix-alpha: rgba(255, 217, 170, 0.15);
    --color--rare-affix-alpha: rgba(255, 210, 24, 0.15);
    --table-border-image: url("https://windblown.wiki.gg/images/Table-border-purple.png?ec6e11&format=original");
    --wiki-heading-font-family: 'Sofia Sans', sans-serif;
}

.view-light {
    --wiki-body-background-image: url("https://windblown.wiki.gg/images/Site-background-2.jpg?7f1fa8");
    --wiki-body-background-color: #b9c0cf;
    --wiki-content-background-color: #ffffff;
    --wiki-content-background-color--rgb: 255, 255, 255;
    --wiki-content-background-color--secondary: #f7ebfa;
    --wiki-content-background-opacity: 0.95;
    --wiki-content-border-color: #11aad9;
    --wiki-content-text-color: #111111;
    --wiki-content-text-mix-color: #7e8791;
    --wiki-content-heading-color: #d94ec2;
    --wiki-content-link-color: #00bdc7;
    --wiki-content-link-color--rgb: 0, 189, 199;
    --wiki-accent-color: #33adcc;
    --wiki-accent-color--hover: #44d2f5;
    --wiki-accent-label-color: #fff;
    --color--common-affix: #c4a77d;
    --color--rare-affix: #e69500;
    --color--common-affix-alpha: rgba(196, 167, 125, 0.15);
    --color--rare-affix-alpha: rgba(230, 149, 0, 0.15);
    --table-border-image: url("https://windblown.wiki.gg/images/Table-border-blue.png?b53582&format=original");
    --wiki-heading-font-family: 'Sofia Sans', sans-serif;
}

/* ========== BASE ========== */
body {
    font-family: 'Sofia Sans', sans-serif;
    max-width: 800px;
    margin: 25px auto;
    padding: 10px;
    background-image: var(--wiki-body-background-image);
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: var(--wiki-body-background-color);
    color: var(--wiki-content-text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ========== LAYOUT ========== */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background-color: rgba(var(--wiki-content-background-color--rgb), 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.logo-container {
    text-align: center;
}

.calculator {
    background-color: rgba(var(--wiki-content-background-color--rgb), var(--wiki-content-background-opacity));
    border: 1px solid var(--wiki-content-border-color);
    border-image-source: var(--table-border-image);
    border-image-slice: 30;
    border-image-repeat: repeat;
    border-image-width: 9px;
    padding: 20px;
    box-shadow: 0 0 16px rgb(0 0 0/75%) inset, 0 0 15px rgba(0, 0, 0, 0.5);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    margin-top: 20px;
    margin-bottom: 60px;
}

.sticky-result {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(var(--wiki-content-background-color--rgb), var(--wiki-content-background-opacity));
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-top: 2px solid var(--wiki-accent-color);
    color: var(--wiki-content-text-color);
    padding: 15px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.75);
    z-index: 1000;
    text-align: center;
/*    transition: background-color 0.3s ease, border-color 0.3s ease;*/
}

.result-content {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.result-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--wiki-content-text-mix-color);
}

.result-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--wiki-content-link-color);
    text-shadow: 0 0 5px rgba(var(--wiki-content-link-color--rgb), 0.5);
}

.result-rerolls {
    font-size: 16px;
    color: var(--wiki-content-text-mix-color);
}

.copyright-notice {
    font-size: 10px;
    color: var(--wiki-content-text-mix-color);
    opacity: 0.8;
    margin-top: 8px;
    line-height: 1.3;
}

.copyright-notice a {
    color: var(--wiki-content-link-color);
    text-decoration: none;
}

.copyright-notice a:hover {
    text-decoration: underline;
    opacity: 1;
}

/* ========== LANGUAGE TOGGLE ========== */
.lang-toggle {
    position: relative;
    z-index: 2001;
}

.lang-btn {
    background-color: var(--wiki-accent-color);
    color: var(--wiki-accent-label-color);
    border: 2px solid var(--wiki-content-border-color);
    padding: 4px 8px;
    cursor: pointer;
    font-family: 'Sofia Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background-color: var(--wiki-accent-color--hover);
    transform: translateY(-1px);
}

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

.lang-btn[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background-color: var(--wiki-content-background-color);
    border: 2px solid var(--wiki-content-border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 2002;
    min-width: 120px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lang-option {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    color: var(--wiki-content-text-color);
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.lang-option:hover,
.lang-option:focus {
    background-color: rgba(var(--wiki-content-link-color--rgb), 0.15);
    outline: none;
}

.lang-option[aria-selected="true"] {
    background-color: rgba(var(--wiki-content-link-color--rgb), 0.25);
    border-left: 2px solid var(--wiki-content-link-color);
}

/* ========== THEME TOGGLE ========== */
.theme-toggle {
    position: static;
    z-index: 2001;
}

.theme-btn {
    background-color: var(--wiki-accent-color);
    color: var(--wiki-accent-label-color);
    border: 2px solid var(--wiki-content-border-color);
    padding: 4px 8px;
    cursor: pointer;
    font-family: 'Sofia Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.theme-btn:hover {
    background-color: var(--wiki-accent-color--hover);
    transform: translateY(-1px);
}

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

.theme-label {
    color: var(--wiki-content-text-color);
}

/* ========== INVERT FILTERS ========== */
.invert-on-light {
    filter: none;
}

.view-light .invert-on-light {
    filter: hue-rotate(190deg) invert();
}

.invert-on-dark {
    filter: none;
}

.view-dark .invert-on-dark {
    filter: hue-rotate(190deg) invert();
}

/* ========== FORM ELEMENTS ========== */
/*small {
    color: var(--wiki-content-text-mix-color);
    display: block;
}*/
sup, small {
  display: inline;
  line-height: 1;
  margin: 0;
  padding: 0;
}

.form-row {
    display: flex;
    flex-direction: row;
    gap: 5px;
}

.form-group {
    margin-bottom: 0;
}

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

.level-input {
    width: 100%;
    padding: 8px 12px;
    background-color: var(--wiki-content-background-color--secondary);
    border: 2px solid var(--wiki-content-border-color);
    color: var(--wiki-content-text-color);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    font-family: 'Sofia Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    height: 75px;
    box-sizing: border-box;
}

.level-input:focus {
    border-color: var(--wiki-content-link-color);
    outline: none;
}

.level-input::placeholder {
    color: var(--wiki-content-text-mix-color);
}

hr {
    border: none;
    border-top: 2px solid var(--wiki-content-border-color);
    margin: 20px 0;
}

/* ========== GEAR SELECTOR ========== */
.custom-gear-selector {
    position: relative;
    width: 100%;
}

.gear-select-button {
    width: 100%;
    padding: 8px 12px;
    background-color: var(--wiki-content-background-color--secondary);
    border: 2px solid var(--wiki-content-border-color);
    color: var(--wiki-content-text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Sofia Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    transition: all 0.2s ease;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    height: 75px;
}

.gear-select-button:hover {
    border-color: var(--wiki-content-link-color);
    background-color: var(--wiki-content-background-color);
}

.gear-select-button:focus {
    outline: none;
    border-color: var(--wiki-content-link-color);
}

.gear-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gear-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gear-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    color: var(--wiki-content-text-mix-color);
    font-size: 12px;
    transition: transform 0.2s ease;
}

.gear-select-button[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

.gear-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    background-color: var(--wiki-content-background-color);
    border: 2px solid var(--wiki-content-border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.gear-option {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    color: var(--wiki-content-text-color);
}

.gear-option:hover,
.gear-option:focus {
    background-color: rgba(var(--wiki-content-link-color--rgb), 0.15);
    outline: none;
}

.gear-option.selected {
    background-color: rgba(var(--wiki-content-link-color--rgb), 0.25);
    border-left: 2px solid var(--wiki-content-link-color);
}

.gear-option .option-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.gear-option .option-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gear-option .option-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== UPGRADE BOXES ========== */
.upgrade-selection {
    display: flex;
    flex-direction: row;
    column-gap: 5px;
    margin-bottom: 5px;
    width: 100%;
    height: 75px;
}

.upgrade-box {
    flex: 1;
    padding: 12px 8px;
    background-color: var(--wiki-content-background-color);
    border: 2px solid var(--wiki-content-border-color);
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    color: var(--wiki-content-text-color);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.upgrade-box:hover {
    background-color: var(--wiki-content-background-color--secondary);
    border-color: var(--wiki-content-link-color);
}

.upgrade-box.selected {
    background-color: rgba(var(--wiki-content-link-color--rgb), 0.2);
    border-color: var(--wiki-content-link-color);
    border-bottom-color: var(--wiki-accent-color);
    box-shadow: 0 2px 6px rgba(var(--wiki-content-link-color--rgb), 0.25);
}

.upgrade-box img {
    height: 32px;
    margin-bottom: 6px;
    display: none;
}

.upgrade-box.has-icon img {
    display: block;
}

.upgrade-box-name {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    word-break: keep-all;
}

/* ========== GEAR TYPE BOXES ========== */
.gear-type-selection {
    display: flex;
    flex-direction: row;
    column-gap: 5px;
    margin-bottom: 5px;
    width: 100%;
    height: 75px;
}

.gear-type-box {
    flex: 1;
    padding: 12px 8px;
    background-color: var(--wiki-content-background-color);
    border: 2px solid var(--wiki-content-border-color);
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    color: var(--wiki-content-text-color);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.gear-type-box:hover {
    background-color: var(--wiki-content-background-color--secondary);
    border-color: var(--wiki-content-link-color);
}

.gear-type-box.selected {
    background-color: rgba(var(--wiki-content-link-color--rgb), 0.2);
    border-color: var(--wiki-content-link-color);
    border-bottom-color: var(--wiki-accent-color);
    box-shadow: 0 2px 6px rgba(var(--wiki-content-link-color--rgb), 0.25);
}

.gear-type-box img {
    height: 32px;
    margin-bottom: 6px;
    display: block;
}

.gear-type-box-name {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    font-family: var(--wiki-heading-font-family);
}

/* ========== AFFIX LIST ========== */
#affixSelection {
    transition: background-color 0.3s ease;
}

.rarity-group {
    border: 1px solid var(--wiki-content-border-color);
    margin: 0 0 10px 0;
    transition: border-color 0.3s ease;
}

.rarity-group.common-uncommon {
    border-left: 4px solid var(--color--common-affix);
    background-color: var(--color--common-affix-alpha);
}

.rarity-group.rare {
    border-left: 4px solid var(--color--rare-affix);
    background-color: var(--color--rare-affix-alpha);
}

.rarity-group legend {
    padding: 0 5px;
    font-weight: 600;
    font-size: 13px;
    color: var(--wiki-content-heading-color);
    font-family: var(--wiki-heading-font-family);
}

.affix-label {
    display: block;
    margin: 8px 0;
    padding: 2px 0 2px 12px;
    cursor: pointer;
    transition: background-color 0.1s;
    color: var(--wiki-content-text-color);
    min-height: 24px;
    line-height: 1.4;
    position: relative;
}

.affix-label:hover {
    background-color: rgba(var(--wiki-content-link-color--rgb), 0.15);
}

.affix-label.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background-color: transparent;
}

/* ========== CUSTOM CHECKBOXES ========== */
input[type="checkbox"].affix-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-right: 8px;
    vertical-align: middle;
    transition: all 0.15s ease;
    flex-shrink: 0;
    position: relative;
    background-color: transparent;
}

input[type="checkbox"].affix-checkbox:disabled {
    background-color: transparent;
    cursor: not-allowed;
}

/* Commons - Diamond */
.view-dark input[type="checkbox"].affix-checkbox[data-rarity="Common"],
.view-dark input[type="checkbox"].affix-checkbox[data-rarity="Uncommon"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23ffd9aa' stroke-width='2' d='M12 2L22 12L12 22L2 12Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.view-dark input[type="checkbox"].affix-checkbox[data-rarity="Common"]:checked,
.view-dark input[type="checkbox"].affix-checkbox[data-rarity="Uncommon"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffd9aa' stroke='%23ffd9aa' d='M12 2L22 12L12 22L2 12Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.view-light input[type="checkbox"].affix-checkbox[data-rarity="Common"],
.view-light input[type="checkbox"].affix-checkbox[data-rarity="Uncommon"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23c4a77d' stroke-width='2' d='M12 2L22 12L12 22L2 12Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.view-light input[type="checkbox"].affix-checkbox[data-rarity="Common"]:checked,
.view-light input[type="checkbox"].affix-checkbox[data-rarity="Uncommon"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23c4a77d' stroke='%23c4a77d' d='M12 2L22 12L12 22L2 12Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* Rare - Star */
.view-dark input[type="checkbox"].affix-checkbox[data-rarity="Rare"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23ffd218' stroke-width='2' d='M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.view-dark input[type="checkbox"].affix-checkbox[data-rarity="Rare"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffd218' stroke='%23ffd218' d='M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.view-light input[type="checkbox"].affix-checkbox[data-rarity="Rare"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23e69500' stroke-width='2' d='M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.view-light input[type="checkbox"].affix-checkbox[data-rarity="Rare"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23e69500' stroke='%23e69500' d='M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}
