@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;700&display=swap');

:root {
    /* Deep Purple & Gold Theme - สำนักเซียน */
    --primary-color: #7C3AED;
    --primary-dark: #6B21A8;
    --primary-light: #8B5CF6;
    --secondary-color: #1E1B4B;
    --accent-color: #F59E0B;
    --accent-dark: #D97706;
    --accent-light: #FBBF24;
    --background-color: #0A0A0F;
    --background-gradient: linear-gradient(135deg, #0A0A0F 0%, #1A0B2E 100%);
    --surface-color: rgba(30, 27, 75, 0.8);
    --surface-light: rgba(30, 27, 75, 0.95);
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --border-color: rgba(124, 58, 237, 0.2);
    --border-gold: rgba(245, 158, 11, 0.3);

    /* Semantic Colors */
    --success-color: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --error-color: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.15);
    --warning-color: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --info-color: #7C3AED;
    --info-bg: rgba(124, 58, 237, 0.15);

    /* Spacing System */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Border & Radius */
    --border-radius: 12px;
    --border-radius-sm: 6px;
    --border-radius-lg: 16px;
    --border-width: 1px;

    /* Shadows */
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);

    /* Glassmorphism */
    --glass-bg: rgba(30, 27, 75, 0.85);
    --glass-border: rgba(124, 58, 237, 0.2);
    --glass-gold-border: rgba(245, 158, 11, 0.3);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    --transition-bounce: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Prompt', sans-serif;
    background: var(--background-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

h2 {
    font-size: 1.8rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s;
}

a:hover {
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

a:not(.btn):not(.logo):not(.social-btn) {
    position: relative;
}

a:not(.btn):not(.logo):not(.social-btn)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

a:not(.btn):not(.logo):not(.social-btn):hover::after {
    width: 100%;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2%;
}

/* Glassmorphism Header */
header {
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.95) 0%, rgba(26, 11, 46, 0.95) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 2px solid var(--border-gold);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 20px rgba(124, 58, 237, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.nav-links a:hover {
    color: var(--accent-color);
    transform: translateY(-1px);
}

main {
    flex: 1;
    padding: 3rem 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4), 0 0 20px rgba(245, 158, 11, 0.2);
    position: relative;
    overflow: hidden;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left var(--transition-slow);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.5), 0 0 30px rgba(245, 158, 11, 0.3);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--border-gold);
    color: var(--accent-color);
    transition: all var(--transition-base);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-outline:hover {
    border-color: var(--accent-light);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%);
    color: var(--accent-light);
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.btn-outline:active {
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
}

/* Forms */
.form-card {
    background: var(--surface-light);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-color);
    max-width: 450px;
    margin: 0 auto;
    border: 2px solid var(--border-gold);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.form-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(124, 58, 237, 0.2);
    transform: translateY(-4px);
    border-color: var(--accent-color);
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.form-card:hover::before {
    opacity: 1;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

input,
textarea {
    width: 100%;
    padding: 0.875rem 1.125rem;
    background-color: rgba(10, 10, 15, 0.6);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-base);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(10, 10, 15, 0.8);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2), 0 0 20px rgba(124, 58, 237, 0.1);
    transform: translateY(-1px);
}

input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: var(--error-color);
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
    border-color: var(--success-color);
}

input:disabled,
textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--secondary-color);
}

/* Password Enhancements (Formal) */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-wrapper input {
    padding-right: 2.75rem;
    /* Space for the icon */
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.2s, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    z-index: 5;
    border-radius: 4px;
    /* Subtle rounded corner when focused */
}

.toggle-password:hover {
    color: var(--accent-color);
    background-color: rgba(245, 158, 11, 0.1);
    /* Highlight circle background */
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.85);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
    /* Let clicks pass to the button */
}

/* Icons are hidden/shown based on 'data-visible' attribute on parent or just handled by JS */
.toggle-password .icon-eye-off {
    display: none;
}

.toggle-password.visible .icon-eye {
    display: none;
}

.toggle-password.visible .icon-eye-off {
    display: block;
}

.strength-meter {
    height: 5px;
    background-color: rgba(124, 58, 237, 0.2);
    border-radius: 3px;
    margin-top: 0.5rem;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: width 0.3s, background-color 0.3s;
}

.strength-weak {
    background: linear-gradient(90deg, #ef4444, #dc2626);
    width: 33%;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.strength-medium {
    background: linear-gradient(90deg, var(--accent-color), #d97706);
    width: 66%;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.strength-strong {
    background: linear-gradient(90deg, #10b981, #059669);
    width: 100%;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.pass-requirements {
    list-style: none;
    padding: 0;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.pass-requirements li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.pass-requirements li.valid {
    color: #10b981;
}

.pass-requirements li.invalid {
    color: #ef4444;
}

.pass-requirements li::before {
    content: '○';
}

.pass-requirements li.valid::before {
    content: '●';
}

/* Footer */
footer {
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.8) 0%, rgba(26, 11, 46, 0.9) 100%);
    border-top: 2px solid var(--border-gold);
    padding: 3rem 0;
    margin-top: auto;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(30, 27, 75, 0.6);
    color: var(--accent-color);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid var(--border-gold);
    -webkit-tap-highlight-color: transparent;
    /* Remove mobile blue flicker */
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@media (hover: hover) {
    .social-btn:hover {
        transform: translateY(-5px) scale(1.1);
        box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4), 0 0 20px rgba(124, 58, 237, 0.3);
        border-color: var(--accent-light);
        background: rgba(30, 27, 75, 0.9);
    }

    .instagram-btn:hover {
        background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
        color: white;
        border-color: transparent;
    }
}

/* Better mobile feedback using :active instead of :hover */
.social-btn:active {
    transform: scale(0.9);
    background-color: var(--border-color);
}

/* Touch Optimizations */
@media (hover: none) and (pointer: coarse) {

    .btn,
    .btn-action,
    a {
        -webkit-tap-highlight-color: rgba(245, 158, 11, 0.3);
        touch-action: manipulation;
    }

    .btn:active,
    .btn-action:active {
        transform: scale(0.95);
    }

    .form-card:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }

    .member-card:hover {
        transform: none;
    }
}

.social-btn svg {
    width: 26px;
    /* Slightly larger for 'fuller' look */
    height: 26px;
    display: block;
    pointer-events: none;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mt-5 {
    margin-top: 3rem;
}

.mt-10 {
    margin-top: 1rem !important;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* --- MINI MUSIC PLAYER --- */
.music-control {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    background: var(--surface-light);
    border: 2px solid var(--border-gold);
    border-radius: var(--border-radius-lg);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 300px;
}

.music-control.simplified {
    min-width: 200px;
    padding: 0.5rem 1rem;
}

.music-control:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
}

.music-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.music-btn:hover {
    transform: scale(1.1);
    background: var(--primary-light);
}

.music-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.music-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.music-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-light);
    line-height: 1.2;
}

.music-status-text {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Icon Toggling Logic */
.music-btn .play-icon {
    display: block;
}

.music-btn .mute-icon {
    display: none;
}

.music-btn.playing .play-icon {
    display: none;
}

.music-btn.playing .mute-icon {
    display: block;
}

.music-btn.playing {
    animation: pulse-gold-small 2s infinite;
}

@keyframes pulse-gold-small {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

@media (max-width: 768px) {
    .music-control {
        bottom: 1rem;
        right: 1rem;
        min-width: 180px;
        padding: 0.4rem 0.8rem;
    }
}

.hero {
    text-align: center;
    padding: 4rem 1rem;
    position: relative;
    background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.1) 0%, transparent 70%);
}

.hero h1 {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(124, 58, 237, 0.3);
}

.hero p {
    font-size: 1.125rem;
    max-width: 600px;
    margin: 1rem auto 2rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Toast Notifications - Prominent Style */
#toast-container {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.toast {
    min-width: 320px;
    padding: 1.25rem 2rem;
    border-radius: 12px;
    background: var(--surface-color);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 1.1rem;
    font-weight: 500;
    color: white;
    /* Default text color for solid toasts */
    text-align: center;
}

/* Solid Colors for Impact */
.toast.success {
    background-color: #059669;
    /* Emerald 600 */
    border: 2px solid #047857;
}

.toast.error {
    background-color: #dc2626;
    /* Red 600 */
    border: 2px solid #b91c1c;
}

.toast.info {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: 2px solid var(--primary-light);
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Page Entry Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

header {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

main {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s both;
}

footer {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both;
}

.form-card {
    animation: scaleIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.member-card {
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.member-card:nth-child(1) {
    animation-delay: 0.1s;
}

.member-card:nth-child(2) {
    animation-delay: 0.2s;
}

.member-card:nth-child(3) {
    animation-delay: 0.3s;
}

.member-card:nth-child(4) {
    animation-delay: 0.4s;
}

.member-card:nth-child(5) {
    animation-delay: 0.5s;
}

.member-card:nth-child(6) {
    animation-delay: 0.6s;
}

.member-card:nth-child(7) {
    animation-delay: 0.7s;
}

.member-card:nth-child(8) {
    animation-delay: 0.8s;
}

/* --- MOBILE RESPONSIVENESS --- */

/* Mobile Menu Button - Hidden by default */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--accent-color);
    padding: 0.5rem;
    transition: color 0.2s;
}

.mobile-menu-btn:hover {
    color: var(--accent-light);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
    color: var(--accent-light);
}

@media (max-width: 768px) {

    /* Layout */
    .container {
        padding: 0 1rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .hero {
        padding: 2.5rem 1rem;
    }

    .hero h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    .hero p {
        font-size: 1rem;
        padding: 0 0.5rem;
    }

    /* Navigation */
    .mobile-menu-btn {
        display: block;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--glass-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
        flex-direction: column;
        padding: 1.5rem;
        gap: 0.75rem;
        align-items: stretch;
        border-top: 1px solid var(--glass-border);
        z-index: 1000;
    }

    /* Show menu when active */
    .nav-links.active {
        display: flex;
        animation: slideDown 0.3s ease-out;
    }

    .nav-links a {
        padding: 1rem;
        text-align: center;
        border-radius: var(--border-radius);
        -webkit-tap-highlight-color: rgba(245, 158, 11, 0.3);
        touch-action: manipulation;
        font-size: 1rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links a:active {
        background-color: var(--background-color);
        transform: scale(0.98);
    }

    /* Buttons in Hero */
    .hero .mt-4 {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .hero .mt-4 a,
    .hero .mt-4 button {
        margin-left: 0 !important;
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 52px;
        -webkit-tap-highlight-color: rgba(245, 158, 11, 0.3);
    }

    /* Table Responsiveness */
    .form-card {
        padding: 1.75rem;
        border-radius: var(--border-radius);
        width: 100%;
        margin: 0 auto;
        max-width: none;
    }

    input,
    textarea {
        padding: 1rem 1.125rem;
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-top: 1rem;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
    }

    .admin-table {
        min-width: 600px;
    }

    .admin-table th,
    .admin-table td {
        padding: var(--spacing-md);
        font-size: 0.85rem;
    }

    /* Admin Search & Filter */
    .admin-header {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-search-filter {
        flex-direction: column;
    }

    .search-box,
    .filter-select {
        width: 100%;
    }

    /* Action Buttons */
    .action-buttons {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .btn-action {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1rem;
        min-height: 48px;
        font-size: 0.95rem;
    }

    /* Login/Register Forms */
    .form-card {
        width: 100%;
    }

    /* Member Cards */
    .members-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    /* Enhanced Cards */
    .enhanced-card {
        padding: var(--spacing-lg);
    }

    /* Better touch targets for mobile */
    .btn {
        min-height: 48px;
        padding: 0.875rem 1.25rem;
    }

    /* Improved form spacing on mobile */
    .form-group {
        margin-bottom: 1.75rem;
    }

    label {
        font-size: 0.95rem;
        margin-bottom: 0.625rem;
    }
}

/* ============================================
   ENHANCED COMPONENTS & FEATURES
   ============================================ */

/* Loading Skeletons */
.skeleton {
    background: linear-gradient(90deg, rgba(30, 27, 75, 0.5) 25%, rgba(124, 58, 237, 0.2) 50%, rgba(30, 27, 75, 0.5) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: var(--spacing-sm);
}

.skeleton-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
}

.skeleton-card {
    padding: var(--spacing-xl);
    background: var(--surface-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

/* Admin Dashboard Enhancements */
#admin-page .form-card {
    max-width: 100% !important;
    width: 100% !important;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.admin-search-filter {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) 2.5rem;
    background-color: rgba(2, 6, 23, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-base);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(10, 10, 15, 0.8);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2), 0 0 20px rgba(124, 58, 237, 0.1);
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    opacity: 0.6;
    pointer-events: none;
}

.filter-select {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: rgba(2, 6, 23, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.filter-select:hover {
    border-color: var(--accent-color);
    background-color: rgba(10, 10, 15, 0.8);
}

/* Enhanced Table Styles */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.admin-table thead {
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.95) 0%, rgba(26, 11, 46, 0.95) 100%);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--border-gold);
}

.admin-table th {
    padding: var(--spacing-lg);
    text-align: left;
    font-weight: 600;
    color: var(--accent-color);
    border-bottom: 2px solid var(--border-gold);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.admin-table tbody tr {
    border-bottom: 1px solid rgba(124, 58, 237, 0.1);
    transition: all var(--transition-base);
}

.admin-table tbody tr:hover {
    background-color: rgba(124, 58, 237, 0.1);
    transform: translateX(2px);
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.2);
}

.admin-table td {
    padding: var(--spacing-lg);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.admin-table td:first-child {
    color: var(--text-primary);
    font-weight: 500;
}

/* Enhanced Status Badges */
.status-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition-base);
}

.status-badge.pending {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.status-badge.approved {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.status-badge.rejected {
    background: linear-gradient(135deg, var(--error-color), #dc2626);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Enhanced Action Buttons */
.action-buttons {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.btn-action {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.btn-approve {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-approve:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.btn-reject {
    background: linear-gradient(135deg, var(--error-color), #dc2626);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-reject:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.5);
}

.btn-action:active {
    transform: translateY(0);
}

/* Rank Selector Enhancement */
.rank-selector {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--border-color);
    background: rgba(10, 10, 15, 0.6);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
    font-weight: 500;
}

.rank-selector:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.rank-selector:hover {
    border-color: var(--accent-color);
    background-color: rgba(10, 10, 15, 0.8);
}

/* Enhanced Form Styles */
.form-group {
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: color var(--transition-base);
}

.form-group input:focus+label,
.form-group textarea:focus+label {
    color: var(--accent-color);
}

.form-help-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
    display: block;
}

.form-error-text {
    font-size: 0.8rem;
    color: var(--error-color);
    margin-top: var(--spacing-xs);
    display: block;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    color: var(--text-secondary);
    background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.05) 0%, transparent 70%);
    border-radius: var(--border-radius-lg);
    border: 1px dashed var(--border-gold);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.6;
    filter: drop-shadow(0 0 10px rgba(124, 58, 237, 0.3));
}

.empty-state-title {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.empty-state-message {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    line-height: 1.7;
}

/* Enhanced Card Styles */
.enhanced-card {
    background: var(--surface-color);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.enhanced-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.enhanced-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(124, 58, 237, 0.2);
    border-color: var(--accent-color);
}

.enhanced-card:hover::before {
    opacity: 1;
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: var(--text-primary);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
    font-size: 0.9rem;
    border: 2px solid var(--border-gold);
    line-height: 1.6;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.info-box strong {
    color: var(--accent-color);
    display: block;
    margin-bottom: var(--spacing-xs);
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Focus Visible */
*:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(124, 58, 237, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Pulse Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Enhanced Toast Messages */
.toast {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.success {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.toast.error {
    background: linear-gradient(135deg, var(--error-color), #dc2626);
}

.toast.info {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

/* Better Confirmation Dialog Styles */
/* Note: Browser confirm() cannot be styled, but we can enhance the experience */
/* For future: Consider implementing custom modal dialogs */

/* Enhanced Error States */
.error-state {
    padding: var(--spacing-2xl);
    text-align: center;
    color: var(--error-color);
}

.error-state-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.8;
}

.error-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.error-state-message {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Success States */
.success-state {
    padding: var(--spacing-2xl);
    text-align: center;
    color: var(--success-color);
}

.success-state-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-lg);
    animation: scaleIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.success-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.success-state-message {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}