/* Login Page - Native App Style */
body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0f0f23, #1a1a2e);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
}

/* Full Page Loader */
.full-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0f0f23, #1a1a2e);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.full-page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-animation {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(74, 222, 128, 0.2);
    border-top: 4px solid #4ade80;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.main-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    width: 100%;
}

.main-content.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Login Container - Native App Layout */
.login-container {
    width: 100%;
    background: transparent;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
}

/* Header */
.login-header {
    text-align: center;
    margin-top: 80px;
    margin-bottom: 40px;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.logo-img {
    width: auto;
    height: 60px;
    max-width: 200px;
    object-fit: contain;
    border-radius: 0;
}

.app-title {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-text {
    color: #94a3b8;
    font-size: 18px;
    margin: 0;
    font-weight: 400;
}

/* Form */
.login-form {
    flex: 1;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
}

.input-group {
    margin: 0;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 18px;
    color: #6b7280;
    z-index: 2;
}

.input-wrapper input {
    width: 100%;
    padding: 18px 20px 18px 55px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: #fff;
    font-size: 17px;
    font-weight: 400;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #4ade80;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}

.input-wrapper input::placeholder {
    color: #6b7280;
}

.toggle-password {
    position: absolute;
    right: 18px;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #4ade80;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    margin: 10px 0;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.remember-me input:checked + .checkmark {
    background: #4ade80;
    border-color: #4ade80;
}

.remember-me input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-password {
    color: #4ade80;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #22c55e;
}

/* Login Button */
.login-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    border: none;
    border-radius: 16px;
    color: #000;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(74, 222, 128, 0.3);
}

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

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    animation: spin 1s linear infinite;
}

/* Footer */
.login-footer {
    text-align: center;
    padding: 20px;
    margin-bottom: 40px;
}

.signup-text {
    color: #94a3b8;
    font-size: 16px;
    margin-bottom: 40px;
}

.signup-link {
    color: #4ade80;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.signup-link:hover {
    color: #22c55e;
}

/* Social Login */
.social-login {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
}

.social-text {
    color: #6b7280;
    font-size: 16px;
    margin-bottom: 24px;
}

.social-buttons {
    display: flex;
    gap: 16px;
}

.social-btn {
    flex: 1;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.social-btn.google:hover {
    border-color: rgba(66, 133, 244, 0.3);
}

.social-btn.github:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transform: translateX(350px) scale(0.8);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-weight: 500;
    font-size: 14px;
    max-width: 280px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification.success {
    background: rgba(34, 197, 94, 0.9);
    border-color: rgba(74, 222, 128, 0.3);
}

.notification.error {
    background: rgba(239, 68, 68, 0.9);
    border-color: rgba(248, 113, 113, 0.3);
}

.notification.show {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.notification.hide {
    transform: translateX(350px) scale(0.8);
    opacity: 0;
}

.notification-icon {
    flex-shrink: 0;
    animation: iconPop 0.4s ease-out;
}

.notification span {
    line-height: 1.4;
}

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes iconPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* WebView Specific Styles */
body.webview {
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

body.webview .login-header {
    margin-top: 40px;
}

body.webview .input-wrapper input {
    -webkit-appearance: none;
    appearance: none;
}

body.webview .login-btn {
    -webkit-appearance: none;
    appearance: none;
}

/* Username Status and Suggestions */
.username-status {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
}

.username-status.available {
    color: #22c55e;
}

.username-status.taken {
    color: #ef4444;
}

.username-suggestions {
    margin-top: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    animation: slideDown 0.3s ease;
}

.suggestions-text {
    color: #ef4444;
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 500;
}

.suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.suggestion-item {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ade80;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    background: rgba(74, 222, 128, 0.2);
    transform: translateY(-1px);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@media (max-width: 480px) {
    .login-header {
        margin-top: 60px;
    }
    
    .app-title {
        font-size: 28px;
    }
    
    .welcome-text {
        font-size: 16px;
    }
    
    .social-buttons {
        flex-direction: column;
    }
    
    .form-options {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}

/* Username Status and Suggestions */
.username-status {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
}

.username-status.available {
    color: #22c55e;
}

.username-status.taken {
    color: #ef4444;
}

.username-suggestions {
    margin-top: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    animation: slideDown 0.3s ease;
}

.suggestions-text {
    color: #ef4444;
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 500;
}

.suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.suggestion-item {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ade80;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    background: rgba(74, 222, 128, 0.2);
    transform: translateY(-1px);
}

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

/* User Not Found Popup */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.popup-overlay.show {
    display: flex !important;
}

/* User Not Found Popup */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(0.5px);
}

.popup-overlay.show {
    display: flex !important;
}

.popup-overlay.show ~ * {
    pointer-events: none;
}

body.popup-open {
    overflow: hidden;
    pointer-events: none;
}

body.popup-open .popup-overlay {
    pointer-events: all;
}

.popup-content {
    background: rgba(28, 28, 30, 0.98);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 20px;
    max-width: 270px;
    width: 80%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.popup-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 59, 48, 0.15);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #ff3b30;
}

.popup-title {
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: -0.4px;
}

.popup-message {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
    line-height: 1.3;
    font-weight: 400;
}

.popup-buttons {
    display: flex;
    gap: 8px;
    flex-direction: row;
}

.popup-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: -0.2px;
}

.popup-btn.primary {
    background: #007aff;
    color: #ffffff;
}

.popup-btn.primary:active {
    transform: scale(0.96);
    background: #0056cc;
}

.popup-btn.secondary {
    background: rgba(120, 120, 128, 0.2);
    color: #007aff;
    border: 0.5px solid rgba(120, 120, 128, 0.3);
}

.popup-btn.secondary:active {
    transform: scale(0.96);
    background: rgba(120, 120, 128, 0.3);
}

/* Input Error State */
.input-wrapper input.error {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%, 75% { transform: translateX(-2px); }
    50% { transform: translateX(2px); }
}
