/* นำเข้าฟอนต์ Anuphan ที่ดูทันสมัยและกลมมน */
@import url('https://fonts.googleapis.com/css2?family=Anuphan:wght@400;500;600;700&display=swap');

/* สีหลัก (โทนสีเข้ม-สว่าง) */
:root {
    --bg-primary: #1c1c27; /* พื้นหลังหลัก */
    --bg-secondary: #252533; /* พื้นหลังรอง */
    --text-color: #e0e0f0; /* สีตัวอักษรหลัก */
    --accent-color: #5d5dff; /* สีเน้นสดใส */
    --accent-hover: #4a4acb;
    --card-bg: #2d2d42; /* พื้นหลังการ์ด */
    --border-color: #3b3b52; /* สีขอบ */
    --glow-effect: 0 0 10px rgba(93, 93, 255, 0.4);
}

body {
    margin: 0;
    font-family: 'Anuphan', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header และ Navigation */
header {
    background-color: var(--bg-secondary);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

header h1 {
    margin: 0;
    font-size: 28px;
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(93, 93, 255, 0.5);
    font-weight: 700;
}

nav {
    display: flex;
    gap: 15px;
}

.nav-item {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 20px;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.nav-item:hover {
    background-color: var(--accent-hover);
    color: #fff;
    transform: translateY(-3px);
}

.nav-item.active {
    background-color: var(--accent-color);
    color: #fff;
    font-weight: 600;
    box-shadow: var(--glow-effect);
}

/* Container หลัก */
.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 25px;
}

/* สไตล์ Card */
.card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4), var(--glow-effect);
}

/* หัวข้อ */
.title {
    color: var(--accent-color);
    margin-top: 0;
    font-weight: 700;
    font-size: 2em;
    text-align: center;
    text-shadow: 0 0 5px rgba(93, 93, 255, 0.3);
}

/* สไตล์ Input และ Button */
input {
    width: 100%;
    box-sizing: border-box;
    background-color: #3b3b52;
    color: var(--text-color);
    border: none;
    padding: 15px;
    border-radius: 12px;
    margin: 10px 0;
    font-size: 16px;
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

input:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-color);
    background-color: #44445c;
}

button {
    background-color: var(--accent-color);
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    width: 100%;
    text-transform: uppercase;
}

button:hover {
    background-color: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: var(--glow-effect);
}

button:disabled {
    background-color: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* สไตล์ Login/Register Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1c1c27 0%, #0a0a10 100%);
}

.login-container {
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.login-box p {
    margin-top: 25px;
    font-size: 15px;
}

.login-box a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.login-box a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.product-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    padding: 20px;
}

/* สไตล์ของรูปภาพสินค้า */
.product-image {
    width: 100%;
    height: 180px;
    border-radius: 15px;
    margin-bottom: 20px;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    box-shadow: 0 0 10px rgba(93, 93, 255, 0.3);
    transition: transform 0.3s ease;
}

.product-item:hover .product-image {
    transform: scale(1.03);
}

/* สไตล์ของคำอธิบายสินค้า */
.product-info .description {
    font-size: 15px;
    color: #b0b0c0;
    margin: 8px 0 18px;
}

.product-info .price {
    font-weight: bold;
    color: var(--accent-color);
    font-size: 1.5em;
    margin-top: 0;
}

.stock-info {
    font-size: 14px;
    color: #a0a0b0;
    margin-bottom: 12px;
}

/* ปุ่มเติมเงิน */
.recharge-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.recharge-buttons button {
    width: auto;
    font-size: 16px;
    font-weight: 500;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 30px;
    color: #888;
}

/* Admin Page Specific Styles */
.admin-product-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-product-item h4 {
    margin: 0;
    color: var(--text-color);
}

.admin-product-item button.delete-button {
    background-color: #e74c3c;
    margin-top: 10px;
}

.admin-product-item button.delete-button:hover {
    background-color: #c0392b;
}

.empty-store-message {
    text-align: center;
    font-size: 1.2em;
    color: #a0a0b0;
    margin-top: 50px;
    font-weight: 500;
}

/* Styles for Settings Page */
.profile-info-display {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 25px;
    flex-direction: column; /* For mobile view */
    text-align: center;
}

@media (min-width: 600px) {
    .profile-info-display {
        flex-direction: row;
        text-align: left;
    }
}

.profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-color);
    box-shadow: var(--glow-effect);
}

.profile-details {
    flex-grow: 1;
}

.profile-details h3, .profile-details p {
    margin: 0;
}

.profile-details h3 {
    font-size: 1.5em;
    color: var(--text-color);
    margin-bottom: 5px;
}

.profile-details p {
    color: #b0b0c0;
}

/* Password Toggle */
.password-container {
    position: relative;
    width: 100%;
}

.password-container input {
    padding-right: 40px; /* Make space for the icon */
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #888;
}

.toggle-password:hover {
    color: var(--text-color);
}

