.page-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    height: 100vh;
    padding: 20vh 5vw 0;
    gap: 5rem;
}
.left-sidebar {
    position: absolute;
    left: 5vw;
    top: 30vh;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 290px;
}

.left-sidebar .action-btn {
    width: 100%;
    box-sizing: border-box;
}

/* --- Homepage Visual Fixes --- */

/* 1. Global Content Centering */
.main-content {
    text-align: center;
}

/* 2. Main Button Refinement */
.main-action-button {
    padding: 20px 40px;
    font-size: 3em;
    font-weight: 600;
    color: var(--text-main);
    background-color: transparent;
    border: 2px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    text-shadow: 0 0 8px var(--accent-purple);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.main-action-button .coming-soon {
    font-size: 0.6em;
    font-weight: 200;
    color: var(--text-muted);
}

.main-action-button:hover {
    background-color: rgba(124, 58, 237, 0.1); /* --accent-purple with low alpha */
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px var(--accent-purple);
    text-decoration: none;
}
.center-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}
.main-title {
    color: var(--accent-purple);
    font-size: 2.5rem;
    font-weight: 300;
    text-shadow: 0 0 15px rgba(139, 92, 246, 0.6);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 10%;
    margin: 0;
}
.center-art-area {
    flex-grow: 1;
    height: 70vh;
    max-width: 900px;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
}
/* Dropdown Menu */
.dropdown {
    position: absolute;
    top: 1rem;
    right: 1rem;
}
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    left: auto;
    background-color: var(--bg-card);
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 1;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 8px 0;
    overflow: hidden;
}
.dropdown-content a, .dropdown-content .user-info, .dropdown-content .logout-btn {
    color: var(--text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 1rem;
}
.dropdown-content a:hover, .dropdown-content .logout-btn:hover {
    background-color: rgba(139, 92, 246, 0.15);
}
.user-info {
    font-weight: bold;
    border-bottom: 1px solid var(--border);
}
.user-info span {
    font-weight: normal;
    opacity: 0.7;
    text-transform: capitalize;
}
.dropdown:hover .dropdown-content {
    display: block;
}
.account-btn {
    background: #111827;
    border: 1px solid var(--border);
    border-radius: 0;
    color: var(--text-main);
    font-weight: normal;
    transition: background-color 0.2s, border-color 0.2s;
}
.account-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent-purple);
    filter: none;
}
/* New styles for homepage buttons */
.action-btn {
    display: block;
    background: #111827;
    color: var(--text-main);
    padding: 10px 20px;
    font-size: 1.1rem;
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 0;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    text-align: center;
    width: 290px; /* Safely accounts for the previous 250px + 40px padding */
    box-sizing: border-box;
}
.action-btn:hover {
    background: #111827;
    border-color: rgba(139, 92, 246, 0.8);
    box-shadow: 0px 0px 20px rgba(139, 92, 246, 0.7);
    text-decoration: none;
}
.action-btn.disabled {
    background: #111827;
    border-color: rgba(139, 92, 246, 0.2);
    color: var(--text-muted);
    cursor: not-allowed;
}
.action-btn.disabled:hover {
    background: #111827;
    border-color: rgba(139, 92, 246, 0.2);
    box-shadow: none;
    color: var(--text-muted);
}

/* --- Styles from manage.html & my-tickets.html --- */

/* Layout Container */
.page-container { max-width: 1200px; margin: 0 auto; }

/* manage.html: Tabs */
.tabs { border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.tab-link {
    background: none; border: none; color: var(--text-muted); padding: 15px 20px;
    cursor: pointer; font-size: 1.1rem; display: none; /* Hidden by default */
}
.tab-link.active { color: var(--accent-blue); border-bottom: 2px solid var(--accent-blue); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* manage.html: Roles Tab */
.permissions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 1rem; }
.permission-item { display: flex; align-items: center; gap: 8px; }
.role-card { background: var(--bg-card); padding: 1rem; border-radius: 8px; margin-bottom: 1rem; }

/* manage.html: Ticket Stats */
.ticket-stats-container {
    display: flex; gap: 2rem; margin-bottom: 2rem; padding: 1rem;
    background-color: var(--bg-card); border-radius: 8px;
}
.leaderboard, .my-stats { flex: 1; }
.leaderboard h4, .my-stats h4 { margin-top: 0; }
.leaderboard ol { padding-left: 20px; margin: 0; }

/* manage.html: Ticket Modal */
.modal-overlay {
    position: fixed; inset: 0; background-color: rgba(0,0,0,0.7);
    display: none; justify-content: center; align-items: center; z-index: 9999;
}
#ticket-modal .modal-container { width: 90vw; max-width: 1400px; height: 90vh; display: flex; flex-direction: column; }
.modal-header {
    padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { margin: 0; }
.modal-close-btn { background: none; border: none; color: var(--text-main); font-size: 1.5rem; cursor: pointer; }
.modal-body { display: flex; flex: 1; overflow: hidden; }
.modal-left { flex: 3; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.modal-right { flex: 1; padding: 1.5rem; overflow-y: auto; }
.info-section { margin-bottom: 1.5rem; }
.info-section p { margin: 0.25rem 0; }

/* my-tickets.html: Detail View */
.detail-header { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.detail-body { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; height: 75vh; }
.detail-left-panel { display: flex; flex-direction: column; background: var(--bg-card); border-radius: 8px; overflow: hidden; }
.detail-right-panel { display: flex; flex-direction: column; gap: 1rem; }

/* Common styles for ticket views */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.bubble-wrapper {
    display: flex;
    width: 100%;
}
.bubble-left { justify-content: flex-start; }
.bubble-right { justify-content: flex-end; }
.bubble {
    background-color: var(--bg-card);
    border-radius: 15px;
    padding: 10px 15px;
    max-width: 75%;
    border: 1px solid var(--border);
}
.bubble-header { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 5px; }
.bubble-content p { margin: 0; }
.editor-container { padding: 1rem; border-top: 1px solid var(--border); }
#send-reply-btn { margin-top: 1rem; }
/* Scoped Quill editor styles to resolve height conflict */
#ticket-modal #quill-editor { height: 150px; background: var(--bg-main); }
#ticket-detail-view #quill-editor { height: 120px; background: var(--bg-main); }

/* --- Styles from devlog.html --- */
.devlog-container { max-width: 800px; margin: 0 auto; }
.post {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent-blue);
}
.post-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.post-title { font-size: 1.5rem; margin: 0; }
.post-meta { font-size: 0.9rem; color: var(--text-muted); }
.post-content { line-height: 1.6; }
.post-actions button { margin-left: 0.5rem; }
#post-modal .modal-container { max-width: 700px; }
#post-modal .modal-container h2 { margin-top: 0; }
#post-modal #quill-editor { min-height: 200px; }

/* --- Styles from team.html --- */
.team-page-container { max-width: 1200px; margin: 0 auto; }
#team-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 2rem;
}
.team-card {
    background-color: var(--bg-card);
    display: flex;
    flex-direction: row;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    gap: 15px;
    width: 100%;
    max-width: 450px;
}
.team-card img {
    width: 100px; height: 100px; object-fit: cover;
    border-radius: 50%; border: 2px solid var(--accent-blue);
}
.team-info h3 { margin: 0 0 5px 0; }
.team-info .role { color: var(--text-muted); font-style: italic; margin-bottom: 10px; }
.team-actions { margin-top: 10px; }
#member-modal .modal-container { max-width: 500px; }
#member-modal .modal-container h2 { margin-top: 0; }

/* --- Styles from aboutme.html --- */
#about-content {
    max-width: 800px;
    margin: 0 auto;
}
.edit-controls {
    text-align: right;
    margin-bottom: 1rem;
    max-width: 848px; /* 800px + 2rem padding */
    margin: 0 auto 1rem;
}
#bgm-player:hover {
    opacity: 1.0;
}

/* --- Styles from login.html & register.html --- */
body.center-page {
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
.login-container, .register-container {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

/* 1. Form Layout (Stacking) */
.login-container form, 
.register-container form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    width: 100%;
}

/* 2. Standardized Input and Button Width globally inside forms */
form input[type="text"],
form input[type="email"],
form input[type="password"],
form button[type="submit"] {
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

/* 3. Styling Update (Neon Theme) */
form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="password"]:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
    outline: none;
}

form button[type="submit"] {
    background: var(--accent-purple);
}

form button[type="submit"]:hover,
form button[type="submit"]:focus {
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

.message, .error-message {
    margin-top: 1rem;
    min-height: 1.2em;
}

/* --- Styles from profile.html --- */
.profile-container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background-color: transparent;
    border: none;
    padding: 0;
}
.profile-section form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* --- Styles from ticket.html --- */
.ticket-page .container {
    max-width: 700px;
    margin: 0 auto;
}
.ticket-page form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.ticket-page textarea {
    min-height: 150px;
    resize: vertical;
}

/* --- Ticket System Buttons --- */

/* 1. Global base class (and extending it directly to edit/delete to guarantee styling) */
.btn-new, .btn-edit, .btn-delete {
    border-radius: 0;
    background: #111827; /* Overrides the default linear-gradient */
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: var(--text-main);
    padding: 10px 20px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-new:hover, .btn-new:focus,
.btn-edit:hover, .btn-edit:focus,
.btn-delete:hover, .btn-delete:focus {
    box-shadow: 0px 0px 15px rgba(139, 92, 246, 0.6);
    border-color: rgba(139, 92, 246, 0.8);
    outline: none;
}

/* 2. Create Ticket Button (Larger, centered, with icon) */
.btn-create-ticket {
    font-size: 1.1rem;
    padding: 12px 24px;
    margin: 0 auto; /* Centers the button if inside a block container */
    color: #ffffff;
}

/* 3. Edit and Delete Buttons (Smaller, lighter text, good spacing) */
.btn-edit, .btn-delete {
    padding: 8px 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-left: 10px; /* Provides spacing when placed next to each other */
}

.btn-edit:hover, .btn-delete:hover {
    color: var(--text-main);
}