/* ===== vault header ===== */
.vault-header {
    text-align: center;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.vault-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #F5E7D3, #C0A080);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.vault-header h1 i {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: #e4b363;
}

.sub {
    color: #9ab3c7;
    margin-top: 0.6rem;
    font-weight: 500;
    border-bottom: 1px dashed #3e5568;
    display: inline-block;
    padding-bottom: 6px;
}

/* ===== light theme - header ===== */
body.light-theme .vault-header h1 {
    background: linear-gradient(135deg, #2c3e50, #1a2a3a);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

body.light-theme .vault-header h1 i {
    color: #c0392b;
}

body.light-theme .sub {
    color: #2c3e50;
    border-bottom-color: #b0b8c0;
}

/* ===== search panel ===== */
.search-panel {
    background: rgba(20, 30, 38, 0.75);
    backdrop-filter: blur(14px);
    border-radius: 48px;
    padding: 0.6rem 0.8rem 0.6rem 1.8rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    box-shadow: 0 12px 28px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
    border: 1px solid rgba(255,215,170,0.2);
    transition: all 0.3s ease;
}

.search-wrapper {
    flex: 4;
    min-width: 250px;
}

.search-wrapper input {
    width: 100%;
    background: #0f1a1f;
    border: 1px solid #3e5a6b;
    border-radius: 60px;
    padding: 0.9rem 1.5rem;
    font-size: 1.05rem;
    color: #f0f3f8;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
}

.search-wrapper input:focus {
    border-color: #e4b363;
    box-shadow: 0 0 0 3px rgba(228, 179, 99, 0.3);
}

.search-wrapper input::placeholder {
    color: #7e95ab;
    font-weight: 400;
}

/* ===== light theme - search ===== */
body.light-theme .search-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-theme .search-wrapper input {
    background: #f5f7fa;
    border: 1px solid #d0d5dd;
    color: #1a1a2e;
}

body.light-theme .search-wrapper input:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.2);
}

body.light-theme .search-wrapper input::placeholder {
    color: #8a94a0;
}

/* ===== buttons ===== */
.search-action-btn {
    background: #e4b363;
    color: #1c2a32;
    box-shadow: 0 4px 12px rgba(228, 179, 99, 0.3);
}

.search-action-btn:hover {
    background: #f5cd8c;
}

.reset-action-btn {
    background: #2a3b44;
    color: #eef4ff;
    border: 1px solid #4f6e82;
}

.reset-action-btn:hover {
    background: #3e5664;
}

body.light-theme .search-action-btn {
    background: #c0392b;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.3);
}

body.light-theme .search-action-btn:hover {
    background: #e74c3c;
}

body.light-theme .reset-action-btn {
    background: #e8eaed;
    color: #1a1a2e;
    border: 1px solid #d0d5dd;
}

body.light-theme .reset-action-btn:hover {
    background: #d5d8dd;
}

/* ===== results header ===== */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    margin: 1rem 0.5rem 1.2rem 0.5rem;
}

.item-counter {
    font-size: 0.9rem;
    background: #1e2f38;
    padding: 0.3rem 1rem;
    border-radius: 40px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.hint-text {
    font-size: 0.8rem;
    color: #8ba0b0;
    transition: all 0.3s ease;
}

body.light-theme .item-counter {
    background: #e8eaed;
    color: #1a1a2e;
}

body.light-theme .hint-text {
    color: #5a6a7a;
}

/* ===== items grid ===== */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.6rem;
    margin-top: 0.5rem;
}

.item-card {
    background: rgba(25, 38, 46, 0.85);
    backdrop-filter: blur(4px);
    border-radius: 28px;
    border: 1px solid rgba(228, 179, 99, 0.25);
    transition: all 0.25s ease;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.item-card:hover {
    transform: translateY(-5px);
    border-color: rgba(228, 179, 99, 0.6);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.3);
}

.card-inner {
    padding: 1.4rem 1.2rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-name {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.item-name span:first-child {
    background: linear-gradient(120deg, #fff, #d9c8ae);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.item-badge {
    font-size: 1.3rem;
}

.item-detail {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    flex-wrap: wrap;
    margin-top: 5px;
}

.item-type {
    background: #1e2f3a;
    padding: 0.25rem 0.9rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: all 0.3s ease;
}

.item-desc {
    font-size: 0.85rem;
    color: #b9cfdf;
    line-height: 1.4;
    margin-top: 6px;
    border-top: 1px dashed #3a5468;
    padding-top: 10px;
    transition: all 0.3s ease;
}

/* ===== light theme - items ===== */
body.light-theme .item-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

body.light-theme .item-card:hover {
    border-color: rgba(192, 57, 43, 0.4);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.1);
}

body.light-theme .item-name span:first-child {
    background: linear-gradient(120deg, #1a1a2e, #2c3e50);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

body.light-theme .item-type {
    background: #e8eaed;
    color: #1a1a2e;
}

body.light-theme .item-desc {
    color: #3a4a5a;
    border-top-color: #d0d5dd;
}

body.light-theme .loading-placeholder,
body.light-theme .no-results {
    background: rgba(255, 255, 255, 0.8);
    color: #3a4a5a;
}

/* ===== lowstock footer link ===== */
.lowstock-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 60px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    
    background: rgba(220, 53, 69, 0.12);
    border: 1px solid rgba(220, 53, 69, 0.25);
    color: #f87171;
}

.lowstock-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 53, 69, 0.08), transparent);
    transition: left 0.5s ease;
}

.lowstock-link:hover::before {
    left: 100%;
}

.lowstock-link:hover {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.lowstock-link:active {
    transform: translateY(0px);
}

.lowstock-link i:first-child {
    font-size: 1.1rem;
    animation: pulse-warning 2s infinite;
}

.lowstock-link i:last-child {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.lowstock-link:hover i:last-child {
    transform: translateX(4px);
}

/* light theme - lowstock footer link */
body.light-theme .lowstock-link {
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

body.light-theme .lowstock-link:hover {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.35);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.15);
}

/* ===== animations ===== */
@keyframes pulse-warning {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* ===== responsive index ===== */
@media (max-width: 680px) {
    .search-panel {
        border-radius: 28px;
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-action-btn, 
    .reset-action-btn {
        justify-content: center;
    }
    
    .vault-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .vault-header h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .lowstock-link {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .lowstock-link span {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .lowstock-link {
        padding: 10px 14px;
        font-size: 0.85rem;
        gap: 8px;
    }
    
    .lowstock-link span {
        font-size: 0.85rem;
    }
}