/* Common Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-left: 5px;
    padding-right: 5px;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255, 140, 0, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 140, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Common Container Styles */
.login-container,
.main-container {
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(128, 128, 128, 0.3);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    border: 1px solid rgba(128, 128, 128, 0.3);
    position: relative;
}

.main-container {
    max-width: 500px;
}

.login-container::before,
.main-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #808080, transparent);
}

/* Logo Styles */
.logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 16px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 16px;
    z-index: -1;
    filter: blur(8px);
    opacity: 0.3;
}

/* Typography */
.title {
    font-size: clamp(20px, 5vw, 32px);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    line-height: 1.2;
    word-wrap: break-word;
    hyphens: auto;
}

.subtitle {
    font-size: 16px;
    color: #b0b0b0;
    margin-bottom: 20px;
    font-weight: 400;
}

/* Login Page Specific Styles */
.login-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border: 1px solid #00E5FF;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    background: rgba(40, 40, 40, 0.8);
    color: #ffffff;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.2), transparent);
    transition: left 0.5s;
}

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

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: #00E5FF;
    background: rgba(50, 50, 50, 0.9);
}

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

/* Platform-specific login button styles */
#steamLogin {
    background: linear-gradient(135deg, #1b2838, #2a475e);
    border-color: rgba(27, 40, 56, 0.5);
}

#steamLogin:hover {
    background: linear-gradient(135deg, #2a475e, #1b2838);
    border-color: #2a475e;
}

#googleLogin {
    background: linear-gradient(135deg, #4285f4, #34a853);
    border-color: rgba(66, 133, 244, 0.5);
}

#googleLogin:hover {
    background: linear-gradient(135deg, #34a853, #4285f4);
    border-color: #4285f4;
}

#appleLogin {
    background: linear-gradient(135deg, #000000, #333333);
    border-color: rgba(0, 0, 0, 0.5);
}

#appleLogin:hover {
    background: linear-gradient(135deg, #333333, #000000);
    border-color: #333333;
}

#psnLogin {
    background: linear-gradient(135deg, #003791, #0070d1);
    border-color: rgba(0, 55, 145, 0.5);
}

#psnLogin:hover {
    background: linear-gradient(135deg, #0070d1, #003791);
    border-color: #0070d1;
}

#moonrayLogin {
    background: linear-gradient(135deg, #000000, #333333);
    border-color: rgba(0, 0, 0, 0.5);
}

#moonrayLogin:hover {
    background: linear-gradient(135deg, #333333, #000000);
    border-color: #333333;
}

.btn-icon {
    font-size: 20px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Account Linking Page Specific Styles */
.current-account {
    background: rgba(40, 40, 40, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 20px;
    padding-top: 12px;
    padding-bottom: 12px;
    margin-bottom: 18px;
    text-align: left;
}

.current-account-title {
    font-size: 14px;
    color: #3b82f6;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.current-account-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.current-account-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.current-account-details h3 {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.current-account-details p {
    color: #b0b0b0;
    font-size: 14px;
}

.link-section {
    margin-bottom: 32px;
}

.link-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 20px;
    text-align: left;
}

.platform-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.platform-card {
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid rgba(128, 128, 128, 0.5);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.platform-card.linked {
    cursor: default;
}

.platform-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.2), transparent);
    transition: left 0.5s;
}

.platform-card:hover::before {
    left: 100%;
}

.platform-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: #00E5FF;
}

.platform-card.linked {
    background: rgba(59, 130, 246, 0.1);
    border-color: #00E5FF;
}

.platform-card.linked:hover {
    background: rgba(59, 130, 246, 0.15);
}

/* Current platform card - yellow border */
.platform-card.current-platform {
    border-color: #FFD700;
}

/* Current account status label - yellow color */
.platform-card.current-platform .platform-status.linked {
    color: #FFD700;
}

.platform-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.platform-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.platform-name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.platform-status {
    font-size: 12px;
    color: #b0b0b0;
    text-transform: uppercase;
}

.platform-status.linked {
    color: #3bf69f;
    font-weight: 600;
}

.link-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    padding: 16px 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.link-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

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

.link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

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

.link-btn:disabled {
    background: rgba(60, 60, 60, 0.8);
    color: #888;
    cursor: not-allowed;
    transform: none;
}

.unlink-btn {
    background: rgba(220, 38, 38, 0.8);
    border: 1px solid rgba(220, 38, 38, 0.5);
    color: white;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.unlink-btn:hover {
    background: rgba(220, 38, 38, 1);
    transform: translateY(-1px);
}

.delete-account-btn {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 8px;
    color: #dc2626;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.delete-account-btn:hover {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.5);
    color: #ffffff;
    transform: translateY(-1px);
}

.delete-account-btn i {
    font-size: 14px;
}

/* Common Elements */
.divider {
    display: flex;
    align-items: center;
    margin: 32px 0;
    color: #666;
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.divider span {
    padding: 0 20px;
}

.footer {
    margin-top: 32px;
    font-size: 14px;
    color: #888;
}

.footer a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

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

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

/* Link Page Styles */
.header-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 12px;
}

.platform-icon-large {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #1b2838, #2a475e);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    position: relative;
    flex-shrink: 0;
    margin-top: -8px;
}

.header-text {
    flex: 1;
    text-align: left;
}

    .header-text .title {
        font-size: clamp(14px, 4vw, 20px);
        line-height: 1.1;
    }

.platform-icon-large::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: inherit;
    border-radius: 16px;
    z-index: -1;
    filter: blur(8px);
    opacity: 0.3;
}

.link-info {
    background: rgba(40, 40, 40, 0.6);
    border: 1px solid rgba(128, 128, 128, 0.3);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    text-align: left;
}

.intro-line {
    color: #ffffff;
    font-size: 16px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.username {
    color: #3b82f6;
    font-weight: 600;
}

.main-description {
    color: #b0b0b0;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.warning-block {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.warning-text {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.5;
}

.warning-icon {
    color: #ffc107;
    font-size: 16px;
    margin-right: 8px;
    vertical-align: middle;
}

.redirect-note {
    color: #b0b0b0;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.button-group {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.btn-secondary {
    background: rgba(60, 60, 60, 0.8);
    border: 1px solid rgba(128, 128, 128, 0.5);
    color: #b0b0b0;
}

.btn-secondary:hover {
    background: rgba(80, 80, 80, 0.9);
    border-color: #808080;
    color: #ffffff;
}

/* Error Page Styles */
.error-icon-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.error-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
    position: relative;
}

.error-icon::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border-radius: 50%;
    z-index: -1;
    filter: blur(8px);
    opacity: 0.3;
}

.error-message {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
}

.error-description {
    color: #ffffff;
    font-size: 16px;
    margin: 0;
    line-height: 1.5;
}

.error-actions {
    background: rgba(40, 40, 40, 0.6);
    border: 1px solid rgba(128, 128, 128, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 32px;
    text-align: left;
}

.error-actions-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.error-solutions {
    color: #b0b0b0;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    padding-left: 20px;
}

.error-solutions li {
    margin-bottom: 8px;
}

.error-solutions li:last-child {
    margin-bottom: 0;
}

/* Checkbox Styles for Unlink Page */
.checkbox-group {
    margin-top: 20px;
}

.checkbox-item {
    margin-bottom: 16px;
}

.checkbox-item:last-child {
    margin-bottom: 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.checkbox-label:hover {
    color: #b0b0b0;
}

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

.checkbox-mark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(128, 128, 128, 0.5);
    border-radius: 4px;
    background: rgba(40, 40, 40, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 1px;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-mark {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border-color: rgba(220, 38, 38, 0.5);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-mark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-text {
    flex: 1;
}

/* Responsive Design */
@media (max-width: 480px) {
    .login-container,
    .main-container {
        padding: 32px 24px;
        margin: 10px;
    }
    
    .title {
        font-size: clamp(20px, 6vw, 32px);
    }
    
    .logo {
        width: 64px;
        height: 64px;
        font-size: 24px;
    }

    .platform-card {
        padding: 12px 16px;
    }
    
    .platform-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .error-icon {
        width: 64px;
        height: 64px;
        font-size: 24px;
    }

    .header-row {
        flex-direction: row;
        text-align: left;
        gap: 12px;
        align-items: start;
    }

    .header-text {
        text-align: left;
    }

    .platform-icon-large {
        width: 60px;
        height: 60px;
        font-size: 22px;
        margin-top: 0;
        flex-shrink: 0;
    }

    .button-group {
        gap: 8px;
    }
}
