/* style.css - Slot System STRICT MODE */

body {
    font-family: Arial, sans-serif;
    background: #f0f0f0;
}

/* ========================= */
/* GLOBAL LINK FIX FOR ELEMENTS */
/* ========================= */

a.element {
    text-decoration: none;
    color: #000;
    display: flex;
}

a.element:visited {
    color: #000;
}

a.element:hover {
    text-decoration: none;
	background: linear-gradient(145deg, #ffcc66, #cc9966);
}

/* SLOT BAR */
#selection-bar {
    display: flex;
    gap: 10px;
    margin: 10px;
}

.slot {
    flex: 1;
    border: 2px solid #ccc;
    background: #ffffff;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    color: #000;
}

.slot img {
    width: 48px;
    display: block;
    margin: 0 auto 5px auto;
}

/* INVENTORY CONTAINER */
#inventory-container {
    display: flex;
    flex-direction: column;
}

/* ========================= */
/* SEARCH BOX – IMPROVED     */
/* ========================= */

#inventory-search {
    margin: 15px auto;
    padding: 10px 16px;
    font-size: 15px;
    width: 260px;
    max-width: 90%;
    border-radius: 25px;
    border: 2px solid #c49a6c;
    background: linear-gradient(145deg, #fffdf7, #f3e4cc);
    color: #3b2a1a;
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,0.1),
        0 2px 6px rgba(0,0,0,0.15);
    outline: none;
    transition: all 0.25s ease;
}

#inventory-search:focus {
    border-color: #d9a441;
    box-shadow:
        0 0 0 3px rgba(217,164,65,0.3),
        inset 0 2px 4px rgba(0,0,0,0.1),
        0 4px 10px rgba(0,0,0,0.2);
    background: linear-gradient(145deg, #fffdf7, #ead3a9);
}

/* INVENTORY */
#inventory {
    border: 1px solid #ccc;
    padding: 10px;
    margin: 10px;
    display: flex;
    flex-wrap: wrap;
    overflow-y: auto;
    max-height: 400px;
    background: #ffffff;
    border-radius: 8px;
    justify-content: center;
}

/* ELEMENT */
.element {
    border: 3px solid #c49a6c;
    padding: 6px;
    margin: 6px;
    cursor: pointer;
    background: linear-gradient(145deg, #f5e2c8, #e6c79e);
    width: 100px;
    text-align: center;
    font-weight: bold;
    text-transform: capitalize;
    word-break: break-word;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 10px;
    color: #000;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.25),
        inset 0 1px 2px rgba(255,255,255,0.4);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.element:hover {
    transform: translateY(-2px);
    box-shadow:
        0 4px 8px rgba(0,0,0,0.3),
        inset 0 1px 2px rgba(255,255,255,0.5);
}

.element img {
    margin-bottom: 5px;
}

/* Locked elements visual */
.locked img {
    filter: grayscale(100%) brightness(0.5);
    opacity: 0.7;
}

.locked span,
.locked div {
    color: #666;
}

.element.selected {
    background: #cce5ff;
    border-color: #3399ff;
}

.element.selected-slot1 {
    background: #cc3399;
    border-color: #660033;
    color: #ffffff;
}

.element.selected-slot2 {
    background: #66cc00;
    border-color: #336600;
    color: #000000;
}

/* ========================= */
/* COMBINE MESSAGE STYLING   */
/* ========================= */

#combine-message {
    margin-top: 15px;
    padding: 10px 18px;
    font-weight: bold;
    font-size: 18px;
    border-radius: 12px;
    display: inline-block;
    opacity: 0;
    transition: opacity 0.5s ease;
	text-transform: capitalize;
}

#combine-message.combine-success {
    background: #e6f9ec;
    color: #1e7e34;
    border: 2px solid #28a745;
    box-shadow: 0 2px 6px rgba(0,128,0,0.2);
    opacity: 1;
}

#combine-message.combine-fail {
    background: #fdeaea;
    color: #a71d2a;
    border: 2px solid #dc3545;
    box-shadow: 0 2px 6px rgba(180,0,0,0.2);
    opacity: 1;
}

/* ========================= */
/* BUTTON STYLING SECTION    */
/* ========================= */

button,
input[type="submit"],
input[type="button"] {
    padding: 8px 18px;
    border-radius: 25px;
    border: none;
    background: linear-gradient(145deg, #d9a441, #b97d20);
    color: black;
    font-weight: bold;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow:
        0 3px 6px rgba(0,0,0,0.25),
        inset 0 1px 2px rgba(255,255,255,0.3);
    transition: all 0.2s ease;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: linear-gradient(145deg, #e6b85a, #c98c2c);
    transform: translateY(-2px);
    box-shadow:
        0 5px 10px rgba(0,0,0,0.3),
        inset 0 1px 2px rgba(255,255,255,0.4);
}

button:active,
input[type="submit"]:active,
input[type="button"]:active {
    transform: translateY(1px);
    box-shadow:
        0 2px 4px rgba(0,0,0,0.25),
        inset 0 2px 4px rgba(0,0,0,0.3);
}

#resetBtn {
    margin: 15px;
}

h1 {
	text-transform: capitalize;
}


/* ================================= */
/* MOBILE OPTIMIZATION (STRICT SAFE) */
/* ================================= */

@media (max-width: 768px) {

    /* Smanjujemo razmake */
    #inventory {
        max-height: 70vh;
        padding: 5px;
        margin: 5px;
    }
	
    /* Manji elementi */
    .element {
        width: 75px;
        padding: 4px;
        margin: 4px;
        font-size: 11px;
        border-width: 2px;
    }

    .element img {
        width: 40px;
        height: 40px;
    }

    /* Slot bar kompaktniji */
    #selection-bar {
        gap: 5px;
        margin: 5px;
		border-radius: 5px;
    }

    .slot {
        padding: 6px;
        font-size: 12px;
    }

    .slot img {
        width: 36px;
    }

    /* Sticky selection bar */
    #selection-bar {
        position: sticky;
        top: 0;
        background: #f0f0f0;
        z-index: 1000;
        padding: 5px;
    }

    /* Bolji tap feedback */
    .element:active {
        transform: scale(0.95);
    }

    /* Manji combine message */
    #combine-message {
        font-size: 15px;
        padding: 8px 12px;
    }

}

/* ================================= */
/* TOPLIST RESPONSIVE FIX            */
/* ================================= */

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table-responsive table {
    min-width: 600px;
}

.table td,
.table th {
    vertical-align: middle;
    white-space: nowrap;
}

@media (max-width: 768px) {

    .table {
        font-size: 13px;
    }

}
