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

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

:root {
    --primary: #00ff88;
    --secondary: #00d4ff;
    --danger: #ff4444;
    --warning: #ffaa00;
    --success: #00ff88;
    --dark: #0a0e27;
    --darker: #050714;
    --light: #ffffff;
    --gray: #8892b0;
    --purple: #9c88ff;
}

body {
    font-family: 'Kanit', 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #050714 100%);
    color: var(--light);
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 80px;
}

/* Cyber Grid Background */
.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 136, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--primary);
    border-radius: 50%;
    animation: float 15s linear infinite;
    opacity: 0.6;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}
/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: linear-gradient(135deg, #00C851 0%, #007E33 100%);
}

.toast-error {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
}

.toast-info {
    background: linear-gradient(135deg, #33b5e5 0%, #0099cc 100%);
}

.toast-warning {
    background: linear-gradient(135deg, #ffbb33 0%, #ff8800 100%);
}
/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    z-index: 1000;
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 4px 30px rgba(0, 255, 136, 0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    text-decoration: none;
}

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

.nav-link {
    color: var(--light);
    text-decoration: none;
    position: relative;
    transition: all 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background: rgba(0, 255, 136, 0.1);
}

/* Profile Container */
.profile-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    position: relative;
    z-index: 100;
}

/* Profile Header */
.profile-header {
    background: rgba(10, 14, 39, 0.95);
    border: 2px solid var(--primary);
    border-radius: 20px;
    padding: 3rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 60px rgba(0, 255, 136, 0.3);
    animation: slideUp 0.6s ease-out;
}

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

.avatar-section {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.avatar-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
}

.avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--primary);
    object-fit: cover;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

.avatar-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 0 0 50% 50%;
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.avatar-wrapper:hover .avatar-overlay {
    opacity: 1;
}

.change-avatar-btn {
    background: var(--primary);
    color: var(--dark);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.change-avatar-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.user-info {
    flex: 1;
}

.username {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-role {
    color: var(--gray);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.user-stats {
    display: flex;
    gap: 3rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    color: var(--gray);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Profile Content */
.profile-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.profile-section {
    background: rgba(10, 14, 39, 0.95);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 15px;
    padding: 2rem;
    backdrop-filter: blur(15px);
    animation: slideUp 0.6s ease-out;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(0, 255, 136, 0.2);
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--primary);
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: var(--light);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 10px;
    color: var(--light);
    font-size: 1rem;
    transition: all 0.3s;
    outline: none;
}

.form-input:focus:not(:disabled) {
    border-color: var(--primary);
    background: rgba(0, 255, 136, 0.15);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-hint {
    color: var(--gray);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-edit,
.btn-danger-outline {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: var(--dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.4);
}

.btn-secondary {
    background: rgba(136, 146, 176, 0.2);
    color: var(--light);
    border: 2px solid var(--gray);
}

.btn-secondary:hover {
    background: rgba(136, 146, 176, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #ff2222;
    box-shadow: 0 10px 30px rgba(255, 68, 68, 0.4);
}

.btn-edit {
    background: rgba(0, 212, 255, 0.2);
    color: var(--secondary);
    border: 2px solid var(--secondary);
}

.btn-edit:hover {
    background: rgba(0, 212, 255, 0.3);
}

.btn-danger-outline {
    background: transparent;
    color: var(--danger);
    border: 2px solid var(--danger);
}

.btn-danger-outline:hover {
    background: rgba(255, 68, 68, 0.1);
}

.btn-full {
    width: 100%;
}

/* Security Section */
.security-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.security-info h3 {
    color: var(--light);
    margin-bottom: 0.5rem;
}

.security-info p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(136, 146, 176, 0.3);
    transition: 0.4s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

/* Danger Zone */
.danger-zone {
    border-color: var(--danger);
}

.danger-zone .section-header h2 {
    color: var(--danger);
}

.danger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: rgba(255, 68, 68, 0.05);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 10px;
}

.danger-item h3 {
    color: var(--danger);
    margin-bottom: 0.5rem;
}

.danger-item p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Warning Box */
.warning-box {
    background: rgba(255, 68, 68, 0.1);
    border: 2px solid var(--danger);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
}

.warning-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.warning-box h3 {
    color: var(--danger);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.warning-box p {
    color: var(--light);
    margin-bottom: 1rem;
}

.warning-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    text-align: left;
}

.warning-list li {
    color: var(--danger);
    padding: 0.5rem 0;
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: rgba(10, 14, 39, 0.98);
    border: 2px solid var(--primary);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 255, 136, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 2px solid rgba(0, 255, 136, 0.2);
}

.modal-header h2 {
    color: var(--primary);
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--gray);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.close-btn:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

/* Password Steps */
.password-step {
    display: none;
}

.password-step.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.step-description {
    color: var(--gray);
    margin-bottom: 2rem;
    text-align: center;
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-input {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.toggle-password:hover {
    transform: scale(1.1);
}

.eye-icon {
    color: var(--gray);
    transition: color 0.3s;
}

.toggle-password:hover .eye-icon {
    color: var(--primary);
}

/* OTP Input */
.otp-input-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.otp-input {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 10px;
    color: var(--light);
    transition: all 0.3s;
}

.otp-input:focus {
    border-color: var(--primary);
    background: rgba(0, 255, 136, 0.15);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    outline: none;
}

.otp-resend {
    text-align: center;
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.otp-resend a {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
}

.otp-resend a:hover {
    text-decoration: underline;
}

/* Password Strength */
.password-strength {
    margin-top: 0.5rem;
}

.strength-indicator {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s;
    border-radius: 2px;
}

.strength-bar.weak {
    width: 33%;
    background: var(--danger);
}

.strength-bar.medium {
    width: 66%;
    background: var(--warning);
}

.strength-bar.strong {
    width: 100%;
    background: var(--success);
}

.password-strength span {
    font-size: 0.85rem;
    color: var(--gray);
}

.password-match {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.password-match.success {
    color: var(--success);
}

.password-match.error {
    color: var(--danger);
}

/* Success Icon */
.success-icon {
    font-size: 5rem;
    text-align: center;
    margin-bottom: 1rem;
}

#stepSuccess h3 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 1rem;
}

#stepSuccess p {
    text-align: center;
    color: var(--gray);
    margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-container {
        padding: 0 1rem;
    }

    .avatar-section {
        flex-direction: column;
        text-align: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .user-stats {
        justify-content: space-around;
        gap: 1rem;
    }

    .security-item,
    .danger-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .otp-input-group {
        gap: 0.5rem;
    }

    .otp-input {
        width: 40px;
        height: 50px;
        font-size: 1.2rem;
    }
}
