/******************************************************************************/
/*  SAOIF TOOLS HELPER CASCADING STYLE SHEET ASSETS                           */
/*----------------------------------------------------------------------------*/
/*  Copyright (C) 2020 MINEVERSAL                                             */
/*  Licensed material of MINEVERSAL                                           */
/*----------------------------------------------------------------------------*/
/*  Object              : SAOIF-TH-CSSA (CASCADING STYLE SHEET ASSETS)        */
/*  Outline             : SAOIF-TH-CSSA (CASCADING STYLE SHEET ASSETS)        */
/*  File ID             : SAOIF-TH-CSSA-2                                     */
/*----------------------------------------------------------------------------*/
/*  Author              : Joe                                                 */
/*  Revision Author     : -                                                   */
/*  Created Time        : 2025/08/01 10:00 (UTC+07:00)                        */
/*  Modification Time   : 2025/08/01 10:00 (UTC+07:00)                        */
/*  Version             : 1 (Number of Version)                               */
/*  Revision            : 0 (Number of Revision)                              */
/******************************************************************************/

/******************************************************************************/
/*        CSS CUSTOM PROPERTIES                                               */
/******************************************************************************/
:root {
    --color-primary:     #0069d9;
    --color-primary-dk:  #0053ad;
    --color-accent:      #ffc107;
    --color-bg:          #f4f6fb;
    --color-surface:     #ffffff;
    --color-border:      #d0d7e3;
    --color-text:        #1a1f2e;
    --color-text-muted:  #6b7280;
    --color-danger:      #dc3545;
    --color-chip-on-bg:  #0069d9;
    --color-chip-on-fg:  #ffffff;
    --color-chip-off-bg: #eef1f7;
    --color-chip-off-fg: #4b5563;
    --radius-sm:         6px;
    --radius-md:         10px;
    --radius-pill:       999px;
    --shadow-card:       0 2px 8px rgba(0,0,0,.08);
    --space-section:     32px;
}

/******************************************************************************/
/*        BASE / RESET                                                        */
/******************************************************************************/
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Noto Sans', sans-serif;
    /* background: var(--color-bg); */
    color: var(--color-text);
    margin: 0;
    padding: 16px;
    font-size: 15px;
    line-height: 1.6;
}

h1 {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    margin: 0 0 4px;
    word-break: break-word;
}

h2 {
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin: 0 0 12px;
    color: var(--color-text);
}

h3 {
    font-size: 1rem;
    margin: 16px 0 8px;
}

/******************************************************************************/
/*        LAYOUT WRAPPER                                                      */
/******************************************************************************/
.wrapper, .page, .contents, .contents_in {
    max-width: 100%;
}

.contents_in {
    max-width: 960px;
    margin: 0 auto;
}

/******************************************************************************/
/*        TITLE                                                               */
/******************************************************************************/
#title {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
    border-left: 4px solid var(--color-primary);
}

/******************************************************************************/
/*        WEAPON CHIP SELECTOR                                                */
/******************************************************************************/
.weapon-selector-label {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.weapon-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.weapon-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-chip-off-bg);
    color: var(--color-chip-off-fg);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
    line-height: 1;
    white-space: nowrap;
}

.weapon-chip::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.4;
    transition: opacity 0.15s;
}

.weapon-chip.active {
    background: var(--color-chip-on-bg);
    border-color: var(--color-chip-on-bg);
    color: var(--color-chip-on-fg);
}

.weapon-chip.active::before {
    opacity: 1;
}

.weapon-chip:hover {
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.weapon-chip:active {
    transform: translateY(0);
}

.weapon-chips-hint {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-top: 6px;
}

/* Hide the original select (kept for JS compatibility) */
#weapons {
    display: none !important;
}

/******************************************************************************/
/*        SECTION CARDS                                                       */
/******************************************************************************/
.section {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: var(--space-section);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-border);
}

/******************************************************************************/
/*        TABLE WRAPPER (overflow fix)                                        */
/******************************************************************************/
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    border-radius: var(--radius-sm);
}

/******************************************************************************/
/*        TABLES                                                              */
/******************************************************************************/
table {
    border-collapse: collapse;
    width: 100%;
    min-width: 320px;
    font-size: 0.9rem;
}

th, td {
    border: 1px solid var(--color-border);
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap;
}

th {
    background: #eef1f7;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

tr:nth-child(even) td {
    background: #f9fafc;
}

caption {
    text-align: left;
    padding: 0 0 8px 0;
    caption-side: top;
}

caption strong {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--color-primary);
    text-transform: uppercase;
    padding: 2px 0;
    border-bottom: 2px solid var(--color-primary);
    margin-bottom: 4px;
}

/******************************************************************************/
/*        SKILL LEVEL INPUT                                                   */
/******************************************************************************/
input[type="number"] {
    width: 56px;
    padding: 4px 6px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    text-align: center;
    background: #fff;
    color: var(--color-text);
    transition: border-color 0.15s;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(0,105,217,.15);
}

/******************************************************************************/
/*        SKILL CONTAINER (per-weapon tables)                                 */
/******************************************************************************/
#skillContainer {
    margin-top: var(--space-section);
}

#skillContainer h2 {
    background: var(--color-surface);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 16px 20px 12px;
    margin: 0;
    border: 1px solid var(--color-border);
    border-bottom: none;
    box-shadow: var(--shadow-card);
}

#skillContainer .table-wrapper {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: none;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
    padding: 16px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* Each weapon block */
#skillContainer > .weapon-block {
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    background: var(--color-surface);
}

#skillContainer > .weapon-block > .weapon-block-header {
    background: #eef1f7;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-primary);
    border-bottom: 1px solid var(--color-border);
}

#skillContainer > .weapon-block > .table-wrapper {
    padding: 0;
    border-radius: 0;
}

/******************************************************************************/
/*        ACTION BUTTONS                                                      */
/******************************************************************************/
.actions {
    margin-top: var(--space-section);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.actions .btn,
.actions .btn.btn_link {
    flex: 1 1 auto;
    min-width: 140px;
}

.btn a,
.btn_link a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--color-primary);
    color: #fff !important;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    border: none;
    white-space: nowrap;
    text-align: center;
}

.btn a:hover,
.btn_link a:hover {
    background: var(--color-primary-dk);
    transform: translateY(-1px);
}

.btn a:active,
.btn_link a:active {
    transform: translateY(0);
}

/* Upload button — label inside anchor */
.btn a label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

input[type="file"] {
    display: none;
}

/******************************************************************************/
/*        GDRIVE SECTION                                                      */
/******************************************************************************/
.gdrive-section {
    margin-top: 16px;
    width: 100%;
    flex: 1 1 100%;
}

.gdrive-section h2 {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.gdrive-container {
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex-wrap: wrap;
}

.gdrive-input {
    flex: 1 1 200px;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: #fff;
    color: var(--color-text);
    transition: border-color 0.15s;
}

.gdrive-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(0,105,217,.15);
}

.gdrive-button {
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.gdrive-button:hover {
    background: var(--color-primary-dk);
}

#driveShortlink {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    word-break: break-all;
}

#driveShortlink a {
    color: var(--color-primary);
}

/******************************************************************************/
/*        WARNING / STATUS                                                    */
/******************************************************************************/
#warning {
    color: var(--color-danger);
    font-weight: 700;
    margin-top: 10px;
    font-size: 0.9rem;
}

/******************************************************************************/
/*        RESPONSIVE BREAKPOINTS                                              */
/******************************************************************************/
@media (max-width: 600px) {
    body {
        padding: 10px;
        font-size: 14px;
    }

    .section {
        padding: 14px 12px;
    }

    th, td {
        padding: 6px 8px;
        font-size: 0.82rem;
    }

    input[type="number"] {
        width: 48px;
        font-size: 0.82rem;
    }

    .actions {
        flex-direction: column;
    }

    .actions .btn,
    .actions .btn.btn_link {
        min-width: 0;
        width: 100%;
    }

    .gdrive-container {
        flex-direction: column;
    }

    .gdrive-button {
        width: 100%;
    }

    .weapon-chip {
        padding: 6px 12px;
        font-size: 0.82rem;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .actions .btn,
    .actions .btn.btn_link {
        flex: 1 1 calc(50% - 5px);
    }
}

/******************************************************************************/
/*        WEAPON TABLE SECTION (unused but kept)                              */
/******************************************************************************/
#weaponTableSection {
    display: none;
}

/******** END OF FILE *********************************************************/