/*
=================================================================
STYLESHEET FOR ULYS QUEST USER PROFILE
VERSION: 2.0
DESCRIPTION: Redesigned profile page with a two-column grid
             layout and grouped info cards.
=================================================================
*/

/* --- 1. FOUNDATION & CORE STYLES --- */
:root {
    --primary: #ed1c24;
    --secondary: #ffffff;
    --dark: #b31217;
    --bg-dark: #121212;
    --bg-light: #1a1a1a;
    --text-light: #e0e0e0;
    --border-color: rgba(255, 255, 255, 0.1);
    --danger: #dc3545;
    --danger-dark: #a71d2a;
}

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    color: var(--text-light);
    line-height: 1.7;
}

main {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

h1, h2, h3 {
    font-family: 'Pirata One', cursive;
    color: var(--secondary);
    text-shadow: 0 0 10px rgba(237, 28, 36, 0.5);
}

h1 { font-size: 3rem; margin: 0; }
.page-title { font-size: 2.8rem; text-align: center; margin-bottom: 2rem; }
h3 { font-size: 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.75rem; }

/* --- 2. HEADER, NAVIGATION & FOOTER --- */
.page-header { background-color: var(--primary); color: white; text-align: center; padding: 10px; }
#main-nav { background: rgba(18, 18, 18, 0.5); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-color); padding: 15px; position: sticky; top: 0; z-index: 1000; }
#main-nav ul { list-style-type: none; margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; }
#main-nav ul li { margin: 0 15px; }
#main-nav ul li a { color: var(--secondary); text-decoration: none; font-weight: 500; font-size: 1rem; padding: 8px 16px; border-radius: 8px; transition: all 0.3s ease; }
#main-nav ul li a:hover { background-color: rgba(255, 255, 255, 0.1); color: var(--primary); }
footer { background: rgba(18, 18, 18, 0.3); border-top: 1px solid var(--border-color); text-align: center; color: var(--secondary); margin-top: 60px; padding: 20px; }

/* --- 3. PROFILE LAYOUT & CARDS --- */
.profile-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
}

.profile-sidebar, .profile-details {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-card {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.2), rgba(26, 26, 26, 0.5));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
    padding: 25px 30px;
}

.text-center { text-align: center; }

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    object-fit: cover;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 0 20px rgba(237, 28, 36, 0.4);
}

/* --- 4. PROFILE FIELDS --- */
.profile-field {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}
.info-card .profile-field:last-child { border-bottom: none; }

.profile-field-stacked {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}
.info-card .profile-field-stacked:last-child { border-bottom: none; }
.profile-field-stacked .field-label { margin-bottom: 0.5rem; }

.field-label { display: flex; align-items: center; gap: 10px; font-weight: 500; flex-basis: 180px; flex-shrink: 0; }
.field-label .fas { color: var(--primary); width: 20px; text-align: center; }
.field-value { flex-grow: 1; text-align: left; color: var(--text-light); word-break: break-all; }
.field-actions { display: flex; gap: 0.5rem; }
.token-balance { color: var(--primary); font-weight: bold; font-family: 'Space Mono', monospace; font-size: 1.2rem; }

/* --- 5. FORMS, BUTTONS & INPUTS --- */
input[type="text"], select {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 10px 12px;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    width: 100%;
    max-width: 300px;
    transition: border-color 0.3s, box-shadow 0.3s;
}
input[type="text"]:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 8px rgba(237, 28, 36, 0.5); }

.btn { font-family: 'Space Mono', monospace; background: transparent; color: var(--text-light); padding: 8px 16px; border-radius: 8px; font-weight: 500; font-size: 0.9rem; transition: all 0.3s ease; border: 1px solid var(--border-color); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--border-color); color: var(--secondary); }
.btn-secondary { border-color: var(--primary); color: var(--primary); }
.btn-secondary:hover { background: var(--primary); color: var(--secondary); }
.btn-primary { background: var(--primary); color: var(--secondary); border-color: var(--primary); }
.btn-primary:hover { background: var(--dark); border-color: var(--dark); }
.btn-danger { background: var(--danger); color: var(--secondary); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-dark); border-color: var(--danger-dark); }

#edit-wallet-form { background: rgba(0,0,0,0.2); padding: 1.5rem; border-radius: 8px; margin-top: 1rem; border: 1px solid var(--border-color); }
#edit-wallet-form form { display: flex; flex-direction: column; gap: 1rem; }
#edit-wallet-form label { font-weight: bold; margin-bottom: -0.5rem; }
#edit-wallet-form input { max-width: 100%; }
#edit-wallet-form .form-actions { display: flex; gap: 1rem; justify-content: flex-end; }

/* --- 6. RESPONSIVENESS --- */
.menu-icon { display: none; font-size: 24px; cursor: pointer; color: var(--secondary); background: none; border: none; position: absolute; top: 50%; transform: translateY(-50%); right: 20px; z-index: 1001; }

@media (max-width: 992px) {
    .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    main { padding: 20px 15px; }
    .menu-icon { display: block; }
    #main-nav ul { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; width: 100%; background-color: var(--bg-light); padding: 1rem; box-shadow: 0 4px 8px rgba(0,0,0,0.2); }
    #main-nav ul.active { display: flex; }
    #main-nav ul li { margin: 10px 0; width: 100%; }
    #main-nav ul li a { justify-content: center; }
    .profile-field { flex-direction: column; align-items: stretch; }
    .field-label, .field-value, .field-actions { flex-basis: auto; text-align: left; }
    .field-actions { justify-content: flex-start; }
}