* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.light-theme {
    --bg-color: #FFFFFF;
    --text-color: #BABABA;
    --icon-filter: invert(100%);
    --accent-color: #0A0A0A;
    --sb-track: #BABABA;
    --sb-thumb: #989898;
}

body.dark-theme {
    --bg-color: #000000;
    --text-color: #2C2C2C;
    --icon-filter: none;
    --accent-color: #0A0A0A;
    --sb-track: #2C2C2C;
    --sb-thumb: #989898;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    overflow-y: auto;
    user-select: none;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 20px;
}

::-webkit-scrollbar-track {
    background: var(--sb-track);
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb {
    background: var(--sb-thumb);
    transition: background 0.3s ease;
    border: 2px solid var(--sb-track);
}

::-webkit-scrollbar-thumb:hover {
    opacity: 0.8; 
}

#topNavBar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    padding: 20px;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    display: flex;
    flex-direction: row;
    font-size: 24px;
    background: var(--text-color); 
    color: var(--bg-color);
}

#lightThemeSelect {
    position: relative;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

#sunSvg, #moonSvg {
    width: 24px;
    height: 24px;
    cursor: pointer;
    padding-bottom: 4px;
    opacity: 0.5;
    transition: all 0.2s ease;
    filter: var(--icon-filter);
    border-bottom: 2px solid transparent;
}

#sunSvg.active, #moonSvg.active {
    opacity: 1;
    border-bottom-color: var(--accent-color);
}

#lightThemeText {
    width: 120px;
    text-align: right;
    flex-shrink: 0;
}

/* Log-in & Register section */
#authContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    padding: 5px 5px;
    margin-top: 100px;
}

.auth-card {
    background: var(--text-color);
    color: var(--bg-color);
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    transform: translateZ(0);
}

.auth-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    color: var(--bg-color);
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    box-sizing: border-box;
}

.auth-tab.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.25);
    border-bottom-color: var(--accent-color);
}

.auth-forms-container {
    width: 100%;
    height: 380px; 
    overflow: hidden;
    position: relative;
}

.auth-slider {
    display: flex;
    width: 200%;
    height: 100%;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.auth-form {
    width: 50%;
    height: 100%;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
    overflow: hidden;
    justify-content: space-between; 
}

.auth-form > div:not(.auth-error) {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#auth-form h3 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--bg-color);
    text-align: center;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.auth-field input {
    width: 100%;
    height: 48px;
    padding: 5px;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 16px !important;
}

.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover, 
.auth-field input:-webkit-autofill:focus,
.feedback-form input:-webkit-autofill {
    -webkit-text-fill-color: var(--text-color) !important;
    box-shadow: 0 0 0px 1000px var(--bg-color) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.auth-button-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px; 
}

.auth-submit-btn {
    position: relative !important;
    left: 0 !important;
    transform: none !important;
    width: 100%;
    height: 48px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-color);
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    z-index: 3;
    transition: all 0.2s ease;
}

.auth-submit-btn:hover {
    opacity: 0.9;
    transform: scale(1.02) !important;
}

.auth-error #loginError {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #FF5252;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    margin-top: 15px;
    min-height: 20px;
}

.auth-error #registerError {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #FF5252;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    margin-top: 15px;
    min-height: 20px;
}

/* Apps Container section */
#appsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, 450px);
    gap: 25px;
    width: 100vw;
    max-width: 100%;
    padding: 20px;
    margin-top: 50px; 
    margin-left: 0;
    margin-right: 0;
}

.app-card {
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    width: 450px;
    height: 250px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    display: block;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--text-color);
    opacity: 0.85;
    z-index: 1;
    transition: opacity 0.3s ease, background 0.3s ease;
}

.app-card > * {
    position: relative;
    z-index: 2;
}

.app-card-info {
    display: flex;
    flex-direction: column;
    padding-right: 80px;
}

.app-card h3 {
    font-size: 22px;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--bg-color);
}

.app-card p {
    font-size: 14px;
    color: var(--bg-color);
    opacity: 0.8;
    line-height: 1.5;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.app-card:hover::before {
    opacity: 0.75;
}

.app-btn {
    position: absolute;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: var(--bg-color);
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    z-index: 3;
}

.app-btn:hover {
    transform: scale(1.05);
}

.app-tag {
    position: absolute;
    top: 24px;
    right: 24px;
    padding: 6px 12px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 20px;
    color: #FFFFFF;
    opacity: 0.95;
    z-index: 3;
}

.tag-game {
    background-color: #2E7D32;
}

.tag-app {
    background-color: #1565C0;
}

/* Feedback */
#feedbackPromptText {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 34px;
}

#feedbackSection {
    width: 100vw;
    max-width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.feedback-form {
    background: var(--text-color);
    color: var(--bg-color);
    padding: 30px;
    border-radius: 16px;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.feedback-form div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-form select, 
.feedback-form textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 16px;
}

.feedback-form .app-btn {
    align-self: center;
    width: auto;
    padding: 12px 24px;
    border: none;
}

.rating-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rating-container input[type="range"] {
    width: 100%;
    accent-color: #1565C0;
}

.comment-card {
    background: var(--text-color);
    color: var(--bg-color);
    padding: 24px;
    border-radius: 16px;
    max-width: 800px;
    position: relative;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    opacity: 0.7;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.comment-user {
    font-weight: 700;
}

.comment-rating {
    font-weight: 700;
    color: #2E7D32;
}

.comment-actions {
    display: flex;
    gap: 45px;
    margin-top: 15px;
    font-size: 14px;
}

.action-btn {
    transform: scale(1.5);
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.action-btn:hover {
    opacity: 1;
}

.owner-reply {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-left: 4px solid #1565C0;
    border-radius: 4px;
}

.owner-title {
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.developer-reply-box {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 500px;
}

.developer-reply-box input {
    flex-grow: 1;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: var(--bg-color);
    color: var(--text-color);
}

/* Toast notification after feedback submission */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: -400px;
    background: #2E7D32;
    color: #FFFFFF;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 9999;
    transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notification.show {
    right: 24px;
}

.toast-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
}

.toast-close-btn:hover {
    color: #FFFFFF;
}