* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-image: url('imgs/loginBGimg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    color: #fff;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
.header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 24px;
    background: #1a1d23;
    height: 40px;
    overflow: visible;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
    height: 100%;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo img {
    height: 28px;
    display: block;
}

.nav {
    display: flex;
    gap: 32px;
    height: 100%;
}

.nav a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    padding: 0 4px;
    transition: border-bottom 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    height: 100%;
    border-bottom: 3px solid transparent;
}

.nav a:hover {
    border-bottom: 3px solid #fff;
}

.search-bar {
    display: flex;
    align-items: center;
    background: #232527;
    border: 1px solid #3a3d41;
    border-radius: 6px;
    padding: 4px 10px;
    gap: 8px;
    height: 28px;
    width: 300px;
    flex-shrink: 1;
    min-width: 120px;
}

.search-icon {
    width: 14px;
    height: 14px;
    fill: #bdbebe;
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    outline: none;
    min-width: 0;
}

.search-bar input::placeholder {
    color: #bdbebe;
}

.header-right {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}

.signup-btn {
    background: #0074e0;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.2s;
}

.signup-btn:hover {
    background: #0061c2;
}

.signup-btn:hover {
    background: #0061c2;
}

.login-btn-header {
    background: #0074e0;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.login-btn-header:hover {
    background: #0061c2;
}

/* Home page specific styles */
.home-page .header {
    background: #fff;
}

.home-page .logo img {
    filter: grayscale(100%) brightness(0.6);
}

.home-page .nav a {
    color: #000;
}

.home-page .search-icon {
    fill: #666;
}

.home-page .search-bar {
    background: #f2f2f2;
    border-color: #c3c3c3;
}

.home-page .search-bar input {
    color: #000;
}

.home-page .search-bar input::placeholder {
    color: #666;
}

.home-page body {
    background: #fff;
}

.home-content {
    background: #fff;
    min-height: 60vh;
    position: relative;
}

.home-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.04) 30%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}

.home-page .footer {
    background: #fff;
    border-top: none;
}

.home-page .footer-links {
    border-bottom-color: #d0d0d0;
}

.home-page .footer-links a {
    color: #000;
}

.home-page .footer-copyright {
    color: rgba(0, 0, 0, 0.6);
}

/* Profile Container */
.profile-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    width: 100%;
}

.avatar-img {
    width: auto;
    height: 280px;
}

.btn-3d {
    /* top-right corner of the gray banner */
    position: absolute;
    top: 12px;
    right: 16px;
    background: #e8e8e8;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #000;
    z-index: 2;
}

.btn-3d:hover {
    background: #d8d8d8;
}

.avatar-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 20px;
}

.profile-actions-bottom {
    display: flex;
    gap: 8px;
    /* moved to inside profile-info-row, no longer absolutely positioned */
}

.btn-add-friend {
    background: #4d6bff;
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 300px;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    text-align: center;
}

.btn-add-friend:hover {
    background: #3d5be6;
}

.btn-more {
    background: #e8e8e8;
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-more:hover {
    background: #d8d8d8;
}

.profile-info-section {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    width: 100%;
}

/* left side: circle + text */
.profile-identity {
    display: flex;
    gap: 20px;
    align-items: center;
}

.profile-avatar-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    background: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-avatar-circle img {
    width: 80px;
    height: auto;
    transform: scale(1.4) translateY(20px);
}

.profile-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 120px;
    padding-top: 12px;
    justify-content: flex-end; /* push everything towards the bottom */
}

.profile-name {
    font-size: 28px;
    font-weight: 700;
    color: #000;
    margin: 0 0 4px 0;
}

.profile-username {
    font-size: 16px;
    color: #666;
    margin: 0 0 16px 0;
}

.profile-stats {
    display: none;
}

.profile-stats-desktop {
    display: flex !important;
    gap: 12px;
    margin-top: 16px;
    padding-left: 16px;
}

.stat-item {
    background: #e8e8e8;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 14px;
    color: #000;
    font-weight: 500;
}

.profile-actions-bottom {
    display: flex;
    gap: 8px;
}

/* Desktop: show stats outside, hide the one inside profile-info-section */
@media (min-width: 769px) {
    .profile-info-section .profile-stats {
        display: none !important;
    }
}

.stat-item {
    background: #e8e8e8;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 14px;
    color: #000;
    font-weight: 500;
}

.profile-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    width: 100%;
    margin-top: 16px;
}

.tab-btn {
    flex: 1;
    text-align: center;
    background: transparent;
    border: none;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn.active {
    color: #000;
    border-bottom-color: #000;
}

.tab-btn:hover {
    color: #000;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0 20px 60px 20px;
}

/* Login page specific padding */
.main-content.login-page {
    padding-top: 120px;
}

/* Login Box */
.login-box {
    background: #23252a;
    border-radius: 0;
    padding: 24px 24px 32px 24px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.login-box h1 {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group input {
    width: 100%;
    padding: 10px 16px;
    border: 0.5px solid #4a4d52;
    border-radius: 4px;
    font-size: 16px;
    color: #fff;
    background: #2b2e33;
    transition: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: #00a2ff;
    background: #2b2e33;
}

.input-group input::placeholder {
    color: #9a9a9a;
}

.login-btn {
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 0.5px solid rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    margin-top: -8px;
    transition: all 0.2s;
}

.login-btn:hover {
    color: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 1);
}

.forgot-link {
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    text-align: center;
    margin-top: 16px;
    margin-bottom: 16px;
    display: block;
    padding-bottom: 32px;
    border-bottom: 1px solid #4a4d52;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Divider */
.divider {
    display: none;
}

/* Alternative Login Buttons */
.one-time-code-btn,
.quick-signin-btn {
    width: 100%;
    padding: 8px 16px;
    background: #2b2e33;
    color: #fff;
    border: 0.5px solid #4a4d52;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    text-align: center;
}

.one-time-code-btn:hover,
.quick-signin-btn:hover {
    border-color: #00a2ff;
}

.one-time-code-btn .icon,
.quick-signin-btn .icon {
    display: none;
}

/* Signup Section */
.signup-section {
    margin-top: 20px;
    padding-top: 0;
    border-top: none;
    text-align: center;
}

.signup-section p {
    color: #fff;
    font-size: 13px;
}

.signup-section a {
    color: #fff;
    text-decoration: underline;
    font-weight: 400;
}

.signup-section a:hover {
    text-decoration: none;
}

/* Email Verification Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #1a1d23;
    border-radius: 8px;
    padding: 0;
    width: 90%;
    max-width: 500px;
    position: relative;
    overflow: hidden;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    color: #c0c0c0;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-close-btn:hover {
    opacity: 0.7;
}

.modal-title {
    color: #c0c0c0;
    font-size: 22px;
    font-weight: 400;
    text-align: center;
    margin: 0;
    padding: 20px 60px;
    background: #1a1d23;
    border-bottom: 1px solid #2a2c31;
}

.modal-description {
    color: #b0b0b0;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.5;
    margin: 24px 20px 8px 20px;
}

.modal-email-input {
    width: calc(100% - 40px);
    margin: 0 20px;
    padding: 12px 18px;
    background: #23252a;
    border: 1px solid #3a3d41;
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
}

.modal-email-input:focus {
    outline: none;
    border-color: #fff;
}

.modal-email-input::placeholder {
    color: #6a6d72;
}

.modal-send-btn {
    width: calc(100% - 40px);
    margin: 40px 20px 32px 20px;
    padding: 12px;
    background: transparent;
    border: 1px solid #6a6d72;
    border-radius: 8px;
    color: #c0c0c0;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-send-btn:hover {
    border-color: #c0c0c0;
    color: #fff;
}

.modal-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Footer */
.footer {
    background: #15171a;
    padding: 40px 40px 30px 40px;
    margin-top: auto;
    border-top: 1px solid #2a2a2a;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-bottom: 0;
    padding-bottom: 40px;
    border-bottom: 1px solid #2a2a2a;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 0.8;
}

.footer-copyright {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    padding-top: 15px;
}

/* Desktop-specific styles */
@media (min-width: 769px) {
    .nav {
        order: 2;
    }

    .search-bar {
        order: 3;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile Header */
    .header {
        height: auto;
        padding: 0;
        flex-wrap: wrap;
    }

    .header-left {
        width: 100%;
        justify-content: flex-start;
        gap: 16px;
        padding: 12px 16px 0 16px;
        flex: 1;
        flex-wrap: wrap;
        position: relative;
    }

    .logo {
        flex-shrink: 0;
        order: 1;
    }

    .logo img {
        height: 40px;
    }

    .header-left .search-bar {
        display: none;
    }

    .header-right {
        order: 2;
        margin-left: auto;
        padding: 12px 16px 0 0;
        display: flex;
        align-items: center;
        gap: 12px;
        position: absolute;
        right: 0;
        top: 0;
        flex-direction: row-reverse;
    }

    .header-right::before {
        content: "";
        width: 28px;
        height: 28px;
        background-image: url('data:image/svg+xml,<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path fill="%23666" d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>');
        background-size: contain;
        background-repeat: no-repeat;
        flex-shrink: 0;
    }

    .signup-btn,
    .login-btn-header {
        padding: 8px 20px;
        font-size: 16px;
        background: #4d6bff;
        border-radius: 8px;
        font-weight: 600;
    }

    .signup-btn:hover,
    .login-btn-header:hover {
        background: #3d5be6;
    }

    /* Mobile Navigation */
    .nav {
        width: 100%;
        justify-content: space-around;
        gap: 0;
        height: auto;
        padding: 16px 16px 12px 16px;
        order: 3;
        margin-top: 0;
    }

    .nav a {
        font-size: 16px;
        font-weight: 600;
        padding: 0;
        border-bottom: none;
        color: #666;
    }

    .nav a:hover {
        border-bottom: none;
        opacity: 0.8;
    }

    /* Home page mobile adjustments */
    .home-page .header-right::before {
        background-image: url('data:image/svg+xml,<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path fill="%23666" d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>');
    }

    /* Mobile Profile Section */
    .profile-container {
        padding: 0 16px;
        margin-top: -20px;
        display: flex;
        flex-direction: column;
    }

    .avatar-wrapper {
        margin-top: 0;
        margin-bottom: 0;
    }

    .avatar-img {
        height: 320px;
    }

    .btn-3d {
        top: 20px;
        right: 20px;
        padding: 10px 20px;
        font-size: 16px;
        font-weight: 700;
    }

    .profile-info-section {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        margin-top: 12px;
        width: 100%;
    }

    .profile-identity {
        display: flex;
        flex-direction: row;
        align-items: center;
        text-align: left;
        width: 100%;
        gap: 16px;
    }

    .profile-avatar-circle {
        width: 100px;
        height: 100px;
        flex-shrink: 0;
        background: #e8e8e8;
    }

    .profile-avatar-circle img {
        width: 70px;
        transform: scale(1.5) translateY(18px);
    }

    .profile-details {
        align-items: flex-start;
        height: auto;
        padding-top: 0;
        justify-content: center;
        flex: 1;
    }

    .profile-name {
        font-size: 28px;
        margin-bottom: 4px;
        text-align: left;
    }

    .profile-username {
        font-size: 16px;
        margin-bottom: 0;
        text-align: left;
    }

    .profile-stats {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
        margin-top: 16px;
        padding-left: 0;
        order: 2;
        display: flex !important;
    }
    
    .profile-stats-desktop {
        display: none !important;
    }

    .stat-item {
        padding: 8px 16px;
        font-size: 14px;
        font-weight: 600;
    }

    .profile-actions-bottom {
        width: 100%;
        flex-direction: row;
        gap: 12px;
        margin-top: 16px;
        order: 3;
    }

    .btn-add-friend {
        width: 100%;
        flex: 1;
        padding: 12px 0;
        font-size: 16px;
        font-weight: 600;
    }

    .btn-more {
        width: auto;
        flex-shrink: 0;
        padding: 12px 16px;
        font-size: 18px;
    }

    .profile-tabs {
        margin-top: 24px;
    }

    .tab-btn {
        font-size: 18px;
        padding: 16px 24px;
    }

    /* Mobile Login Page */
    .main-content {
        padding: 80px 16px 100px 16px !important;
        min-height: auto;
    }

    .login-box {
        max-width: 100%;
        padding: 32px 20px;
    }

    .login-box h1 {
        font-size: 28px;
    }

    /* Mobile Footer */
    .footer {
        padding: 30px 20px;
    }

    .footer-links {
        gap: 16px;
        font-size: 13px;
        padding-bottom: 30px;
    }

    .footer-links a {
        font-size: 13px;
    }

    .footer-copyright {
        font-size: 9px;
    }
}