/* --- Root Variables and General Styles --- */
:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --background-color: #f0f2f5;
    --card-background: rgba(255, 255, 255, 0.75);
    --text-color: #333;
    --text-light: #555;
    --border-radius: 12px;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --font-family: 'Poppins', sans-serif;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    /* Optimize font rendering for Apple devices */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 0 20px;
}

/* --- Navigation Bar --- */
nav {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    /* Ensure Webkit browsers apply backdrop-filter */
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo {
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    /* Apply Webkit prefixes for text gradient and fill */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

nav ul li {
    margin-left: 25px;
}

nav ul a {
    color: var(--text-light);
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background-color 0.3s, color 0.3s;
}

nav ul a:hover, nav ul a.active {
    background-color: var(--primary-color);
    color: #fff;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background-image: linear-gradient(45deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    background-size: 200% auto;
    transition: all 0.4s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 4px 15px 0 rgba(49, 196, 190, 0.35);
    /* Add Webkit prefix for transitions if needed for older Safari versions, though modern Safari supports standard */
    -webkit-transition: all 0.4s cubic-bezier(.4,0,.2,1);
}

.btn:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(49, 196, 190, 0.45);
}

/* --- Product Grid & Cards --- */
.main-content {
    padding-top: 40px;
    animation: fadeIn 0.8s ease-out;
    /* Add Webkit prefix for animation */
    -webkit-animation: fadeIn 0.8s ease-out;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.product-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(5px);
    /* Ensure Webkit browsers apply backdrop-filter */
    -webkit-backdrop-filter: blur(5px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px 0 rgba(31, 38, 135, 0.15);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.product-card-content {
    padding: 20px;
    flex-grow: 1;
}

.product-card-content h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
}

.product-card-content p {
    flex-grow: 1;
    margin: 0 0 15px 0;
    color: var(--text-light);
    font-size: 14px;
}

.product-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px 20px;
}

.product-card .price {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
}

.product-card .btn-buy {
    padding: 8px 20px;
    font-weight: 500;
    font-size: 14px;
}

/* --- Forms & Account --- */
.form-container, .account-info, .admin-section {
    background: var(--card-background);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(5px);
    /* Ensure Webkit browsers apply backdrop-filter */
    -webkit-backdrop-filter: blur(5px);
    max-width: 500px;
    margin: 40px auto;
    animation: fadeIn 0.6s ease-out;
    /* Add Webkit prefix for animation */
    -webkit-animation: fadeIn 0.6s ease-out;
}
.account-info, .admin-section {
    max-width: none;
    margin-bottom: 25px;
}

.form-container h1, .account-info h2, .admin-section h2 {
    text-align: center;
    margin: 0 auto 25px;
    font-weight: 600;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    /* Apply Webkit prefixes for text gradient and fill */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border-bottom: 2px solid rgba(0,0,0,0.05);
    padding-bottom: 10px;
    width: fit-content;
}
.account-info h2, .admin-section h2 {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    width: auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-light);
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
    /* Ensure consistent appearance across Webkit browsers for form elements */
    -webkit-appearance: none; /* Removes default Safari styles for inputs/selects */
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.2);
    /* Add Webkit prefix for box-shadow on focus if needed for older Safari */
    -webkit-box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.2);
}

/* --- Alerts and Specific Sections --- */
.alert { padding: 15px; margin-bottom: 20px; border-radius: 8px; border: 1px solid transparent; }
.alert-danger { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border-color: #c3e6cb; }

.balance { font-size: 28px; font-weight: 700; color: #155724; }

.deposit-methods { display: flex; gap: 15px; margin-top: 15px; }
.deposit-methods button { flex: 1; font-weight: 500; background: #eee; color: #333; border: 1px solid #ddd; padding: 10px; border-radius: 8px; cursor: pointer; transition: all 0.3s; }
.deposit-methods button:hover { background: #ddd; border-color: #ccc; }
#deposit-info { margin-top: 20px; background: #e9ecef; padding: 15px; border-radius: 8px; display: none; border: 1px solid #ddd; }
#deposit-info code { background: #fff; padding: 5px 10px; border-radius: 5px; font-weight: 600; font-size: 16px; }

/* --- Tables --- */
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 15px; text-align: left; border-bottom: 1px solid #e0e0e0; }
th { background: rgba(0,0,0,0.02); font-weight: 600; }
tr:last-child td { border-bottom: none; }
tr:hover { background-color: rgba(0,0,0,0.015); }

/* --- Footer --- */
footer { text-align: center; padding: 30px 0; margin-top: 40px; background: #e9ecef; color: var(--text-light); }
/* --- Add these styles to the end of your style.css file --- */

/* Category Filters on Homepage */
.category-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.category-filters a {
    padding: 8px 20px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--text-light);
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
}

.category-filters a:hover {
    background-color: #fff;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.category-filters a.active {
    background-image: linear-gradient(45deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}


/* Admin Panel User Management */
.user-search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.user-search-form input {
    flex-grow: 1;
}

.user-search-form .btn {
    width: auto;
    padding: 10px 25px;
}

.add-balance-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.add-balance-form input {
    width: 100px;
    padding: 8px;
}

.btn.btn-small {
    padding: 8px 15px;
    font-size: 14px;
    width: auto;
}
/* --- Add to the end of your css/style.css file --- */

/* Deposit Form in Account */
.deposit-form-container {
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-top: 20px;
}

.deposit-methods button {
    width: 100%;
    background: #f0f2f5;
    border-color: #d9d9d9;
    color: #333;
    font-weight: 500;
}

.deposit-methods button:hover {
    background: #e9ecef;
    border-color: #ccc;
}

/* Deposit Instructions */
#deposit-instructions h3 {
    text-align: center;
    color: var(--primary-color);
}
.instruction-box {
    background: #f8f9fa;
    border: 1px dashed #ced4da;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}
.instruction-box p {
    margin: 0 0 10px 0;
    color: var(--text-light);
}
.instruction-box code {
    display: block;
    background: #fff;
    padding: 10px;
    border-radius: 5px;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--primary-color);
    word-wrap: break-word;
    margin-bottom: 15px;
}
#confirm-sent-btn {
    width: 100%;
}