/* ======================
   1. VARIABLES
   ====================== */
:root {
    /* Colors */
    --gradient-start: #0047AB;
    --gradient-end: #00FF9D;
    --primary-color: #3EC1F9;
    --secondary-color: #0047AB;
    --button-default: #3EC1F9;
    --black: #000000;
    --dark-grey: #2A2A2A;
    --medium-grey: #8A8A8A;
    --light-grey: #8A8A8A;
    --white: #FFFFFF;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --container-width: 440px;
    --standard-padding: 20px;
    --form-spacing: 24px;
    --border-radius: 8px;
    
    /* Typography */
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-xxl: 2.5rem;
    
    /* Borders */
    --border-radius-sm: 8px;
    --border-radius-md: 8px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-default: 0.3s ease;
}

/* ======================
   2. RESET & BASE STYLES
   ====================== */
*, *:before, *:after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    font-family: var(--font-family);
    color: var(--white);
    line-height: 1.6;
    min-width: auto; /* Remove fixed min-width to allow proper scaling */
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: linear-gradient(160deg, rgba(0, 12, 25, 0.97) 0%, rgba(0, 21, 41, 0.85) 65%);
    display: flex;
    flex-direction: column;
}

body::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 500;
    line-height: 1.3;
    color: var(--white);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

a:hover, a:focus {
    color: var(--primary-color);
}

*:focus {
    outline: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ======================
   3. LAYOUT & CONTAINERS
   ====================== */
/* Container Width Control */
.container,
.form-group-container,
.terms-text-container,
.button-container {
    width: 100%;
    box-sizing: border-box;
}

.container {
    max-width: 1200px;
    padding: 0 20px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    min-width: auto; /* Remove fixed min-width */
    overflow-x: hidden;
}

.black-container {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 32px;
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
}

/* Background */
.background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.background-image {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    opacity: 0.02;
}

/* Branding Section */
.branding-section {
    margin-bottom: 25px;
    padding-top: 10px;
    text-align: center;
}

.centered-logo {
    display: block;
    width: 250px;
    min-width: 250px;
    height: auto;
    margin: 0 auto 15px;
    text-align: center;
}

.hodlhub-branding-logo {
    display: block;
    margin: 10px auto 20px;
    width: 80%;
    min-width: 450px;
    max-width: 600px;
    height: auto;
}

/* Gradient line */
.gradient-line {
    height: 2px;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    width: 100%;
    margin: 1.5rem 0;
    border-radius: 1px;
}

/* ======================
   4. FORM ELEMENTS
   ====================== */
.form-group {
    margin-bottom: 16px;
    width: 100%;
    text-align: center;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--white);
    text-align: left;
}

.input-container {
    position: relative;
    width: 100%;
    margin-bottom: var(--form-spacing);
}

.input-field {
    width: 100%;
    height: 45px;
    padding: 10px 16px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    color: var(--white);
    font-size: var(--font-size-md);
    transition: border-color 0.2s ease;
    text-align: left;
}

.input-field::placeholder {
    color: #8A8A8A;
}

.input-field:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px #3EC1F9;
}

/* Form validation */
.error-message {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.input-container.error .input-field {
    border-color: var(--error-color);
}

/* ======================
   5. BUTTON STYLES
   ====================== */
.btn {
    display: inline-block;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background-color: var(--black);
    color: var(--white);
    border: 1px solid #3EC1F9;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--black);
    color: #3EC1F9;
    border: 1px solid #3EC1F9;
    transform: translateY(-2px);
}

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

.btn-createaccount {
    width: 100%;
    background: #000000;
    color: var(--white);
    font-weight: 600;
    border: 1px solid #3EC1F9;
    margin-top: 4px;
    position: relative;
    overflow: hidden;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 45px;
}

.btn-createaccount:hover {
    background-color: #3EC1F9;
    color: white;
}

.btn-createaccount:active {
    background-color: #2eaae0;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: rgba(62, 193, 249, 0.1);
}

.button-container {
    width: 100%;
}

/* ======================
   6. TEXT & TYPOGRAPHY
   ====================== */
.terms-text-container {
    margin: 24px 0;
}

.terms-text {
    font-size: 14px;
    line-height: 1.4;
    margin-top: 4px;
    margin-bottom: 4px;
    text-align: left;
    color: #8A8A8A;
}

.terms-text a {
    color: #3EC1F9;
    text-decoration: underline;
    transition: color 0.3s ease;
    font-weight: 500;
}

.terms-text a:hover {
    color: #2eaae0;
}

/* Smaller terms text */
.terms-text.small {
    font-size: 10px;
    color: #8A8A8A;
    margin: 0;
    line-height: 1.4;
}

/* ======================
   7. PAGE SPECIFIC STYLES
   ====================== */
/* Sign-in section */
.signin-section {
    background-image: 
        radial-gradient(circle at 70% 30%, rgba(0, 71, 171, 0.25) 0%, rgba(0, 0, 0, 0) 60%),
        radial-gradient(circle at 30% 70%, rgba(0, 255, 157, 0.1) 0%, rgba(0, 0, 0, 0) 55%),
        radial-gradient(circle at 50% 50%, rgba(0, 71, 171, 0.15) 0%, rgba(0, 0, 0, 0) 65%);
    background-color: black;
    min-height: 100vh;
    padding: 30px 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 1;
}

.signin-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    opacity: 0.08;
    pointer-events: none;
}

/* Hero section for home page */
.hero-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem 0;
    text-align: center;
    position: relative;
    background-image: 
        radial-gradient(circle at 70% 30%, rgba(0, 71, 171, 0.25) 0%, rgba(0, 0, 0, 0) 60%),
        radial-gradient(circle at 30% 70%, rgba(0, 255, 157, 0.1) 0%, rgba(0, 0, 0, 0) 55%),
        radial-gradient(circle at 50% 50%, rgba(0, 71, 171, 0.15) 0%, rgba(0, 0, 0, 0) 65%);
    background-color: black;

}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    min-width: auto; /* Remove fixed min-width */
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
}

/* Whale logo styling */
.whale-logo {
    width: 320px;
    height: auto;
    margin-bottom: -1rem;
    filter: none;
    transition: none;
    animation: whaleFloat 4s ease-in-out infinite;
    max-width: 100%; /* Ensure it doesn't overflow container */
}

/* HodlHub logo styling */
.hodlhub-logo {
    display: block;
    margin: 15px auto;
    width: 80%;
    max-width: 600px; /* Reduced from 800px for big screens */
    height: auto;
}

/* Tagline styling */
.tagline {
    font-size: 1.8rem;
    line-height: 1.4;
    max-width: 800px;
    margin: 0 auto 60px;
    color: var(--white);
    font-weight: 600;
    text-align: center;
    word-wrap: break-word;
    white-space: normal;
    overflow-wrap: break-word;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
}

.tagline br {
    display: block; /* Ensures the line break is always respected */
}

.tagline span {
    display: inline-block; /* Keeps each line as a unit */
}

/* Action buttons container */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    width: 100%;
}

.action-buttons .btn {
    margin: 0.5rem;
    min-width: 200px;
}

/* Confirmation page styling */
.confirmation-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
        background-image: 
        radial-gradient(circle at 70% 30%, rgba(0, 71, 171, 0.25) 0%, rgba(0, 0, 0, 0) 60%),
        radial-gradient(circle at 30% 70%, rgba(0, 255, 157, 0.1) 0%, rgba(0, 0, 0, 0) 55%),
        radial-gradient(circle at 50% 50%, rgba(0, 71, 171, 0.15) 0%, rgba(0, 0, 0, 0) 65%);
    background-color: black;
    position: relative;
    padding: 20px 0;
    min-height: 100vh;
}

.confirmation-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.confirmation-title {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: white;
    text-align: center;
}

.confirmation-text {
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: #e5e7eb;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.user-counter {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-radius: 1rem;
    margin: 2rem auto;
    display: inline-block;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.user-counter p {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    margin: 0;
}

#user-count {
    color: var(--gradient-start);
    font-weight: 700;
}

.confirmation-message {
    margin-bottom: 2rem;
}

.confirmation-section .action-buttons {
    margin-top: 2rem;
}

.confirmation-section .btn-primary {
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    color: white;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.confirmation-section .btn-primary:hover {
    background: linear-gradient(to right, #059669, #2563eb);
    transform: scale(1.05);
}

/* Footer styling */
footer {
    width: 100%;
    background-color: #000000;
    padding: 0;
    margin-top: auto;
    height: 70px;
    display: flex;
    align-items: center;
    display: none; /* Hide by default */
}

/* Only show footer on index page */
body:has(.hero-section) footer {
    display: flex;
}

.footer-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-column {
    text-align: center;
    margin: 10px 0;
}

.footer-column p {
    margin: 0;
    font-size: 14px;
    color: #9ca3af;
}

.footer-column a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: #3EC1F9;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: #9ca3af;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-2px);
}

/* ======================
   8. ANIMATIONS
   ====================== */
@keyframes whaleFloat {
    0% {
        transform: translateY(0); /* Start at original position */
    }
    50% {
        transform: translateY(-10px); /* Move up by 10px */
    }
    100% {
        transform: translateY(0); /* Return to original position */
    }
}

/* ======================
   9. RESPONSIVE BREAKPOINTS
   ====================== */
/* Desktop (1200px and above) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .whale-logo {
        width: 380px; /* Increased size for big screens only */
    }
    
    .hodlhub-logo {
        max-width: 550px; /* Smaller on big screens */
    }
    
    .confirmation-section .centered-logo {
        width: 380px;
    }
    
    .confirmation-section .hodlhub-branding-logo {
        max-width: 550px;
    }
}

/* Tablet (768px to 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
    .container {
        max-width: 900px;
        margin: 0 auto;
    }
    
    .hodlhub-logo {
        width: 100%;
        max-width: 500px;
        margin-bottom: 20px;
    }
    
    .whale-logo {
        max-width: 600px;
    }
    
    .tagline {
        font-size: 1.5rem;
        max-width: 450px;
    }
    
    .confirmation-title {
        font-size: 2.25rem;
    }
    
    .confirmation-text {
        font-size: 1.125rem;
    }
}

/* Mobile (below 767px) */
@media (max-width: 767px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .branding-section {
        margin-bottom: 15px;
    }
    
    .centered-logo {
        width: 200px;
        min-width: 180px;
    }
    
    .hodlhub-logo {
        width: 70%;
        margin: 10px auto;
    }
    
    .signin-section {
        padding: 10px 0 70px;
    }
    
    /* Mobile hero section */
    .hero-section {
        min-height: 100vh;
        padding: 2rem 0;
    }
    
    .hero-content {
        min-width: 400px;
    }
    
    .logo-container {
        margin-bottom: 1.5rem;
    }
    
    .whale-logo {
        width: 240px;
        max-width: 90%; /* Ensure it scales with screen size */
    }
    
    .tagline {
        font-size: 1.25rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
        max-width: 100%;
        padding: 0 10px;
    }
    
    .tagline span {
        display: inline-block;
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 0 1rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .terms-text {
        padding: 0 1rem;
        margin-top: 1.5rem;
        color: #8A8A8A;
    }
    
    .footer-container {
        flex-direction: column;
    }
    
    .footer-column {
        width: 100%;
    }
    
    .confirmation-title {
        font-size: 1.75rem;
    }
    
    .confirmation-text {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .user-counter {
        padding: 0.75rem 1.5rem;
        margin: 1.5rem auto;
    }
    
    .user-counter p {
        font-size: 1.25rem;
    }
    
    .confirmation-section .action-buttons {
        margin-top: 1.5rem;
    }
    
    .confirmation-section .btn-primary {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .confirmation-section .centered-logo {
        width: 240px;
        max-width: 90%;
    }
    
    .confirmation-section .hodlhub-branding-logo {
        width: 70%;
        margin: 10px auto;
    }
    
    .black-container {
        padding: 24px;
        border-radius: 8px;
    }
    
    .input-field {
        height: 40px;
        padding: 8px 12px;
    }
    
    .btn-createaccount {
        height: 40px;
    }
    
    .terms-text {
        font-size: 12px;
        color: #8A8A8A;
    }
    
    .hodlhub-branding-logo {
        min-width: 500px;
        width: 100%;
    }
}

/* Small Mobile (below 480px) */
@media (max-width: 480px) {
    .black-container {
        padding: 20px;
        border-radius: 8px;
    }
    
    .input-field {
        height: 38px;
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .btn-createaccount {
        height: 38px;
        font-size: 14px;
    }
    
    .terms-text {
        font-size: 11px;
        color: #8A8A8A;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .input-container {
        margin-bottom: 10px;
    }
    
    .whale-logo {
        width: 270px;
        max-width: 85%;
    }
    
    .hodlhub-logo {
        width: 65%;
        margin: 8px auto;
        min-width: 300px;
    }
    
    .tagline {
        font-size: 0.75rem;
        line-height: 1.4;
        margin-bottom: 2rem;
        padding: 0 15px;
    }
    
    .tagline span {
        display: inline-block;
        width: 100%;
    }
    
    .confirmation-title {
        font-size: 1.5rem;
    }
    
    .confirmation-text {
        font-size: 0.875rem;
    }
    
    .user-counter {
        width: 90%;
    }
    
    .signup-container {
        padding: 15px;
        margin: 20px auto;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .half-width {
        width: 100%;
    }
    
    .centered-logo {
        width: 150px;
    }
    
    .hodlhub-branding-logo {
        min-width: 500px;
        width: 100%;
    }
    
    .confirmation-section .centered-logo {
        width: 270px;
        max-width: 85%;
    }
    
    .confirmation-section .hodlhub-branding-logo {
        width: 65%;
        margin: 8px auto;
        min-width: 300px;
    }
    
    .logo-container {
        margin-bottom: 1rem;
    }
    
    .action-buttons .btn {
        margin: 0.3rem;
        width: calc(80% - 50px);
        min-width: 140px;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .whale-logo {
        width: 250px;
        max-width: 80%;
    }
    
    .hodlhub-logo {
        width: 60%;
        margin: 6px auto;
        min-width: 250px;
    }
    
    .tagline {
        font-size: 0.75rem;
        line-height: 1.4;
        margin-bottom: 2rem;
        padding: 0 10px;
    }
    
    .tagline span {
        display: inline-block;
        width: 100%;
    }
    
    .logo-container {
        margin-bottom: 0.8rem;
    }
    
    .centered-logo {
        width: 280px;
        min-width: 260px;
    }
    
    .confirmation-section .centered-logo {
        width: 250px;
        max-width: 80%;
    }
    
    .confirmation-section .hodlhub-branding-logo {
        width: 60%;
        margin: 6px auto;
        min-width: 250px;
    }
    
    .action-buttons .btn {
        margin: 0.25rem;
        width: calc(90% - 50px);
        min-width: 120px;
    }
}

/* PWA styles */
@media (display-mode: standalone) {
    .container {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    body {
        /* Prevent overscroll effects in PWA mode */
        overscroll-behavior: none;
        /* Ensure full height in PWA mode */
        height: 100vh;
        height: -webkit-fill-available;
    }
}

/* ======================
   10. UTILITY CLASSES
   ====================== */
.hidden {
    display: none !important;
}

.screen-reader-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ======================
   11. BROWSER COMPATIBILITY
   ====================== */
/* Fix for autofill styling in various browsers */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(0, 0, 0, 0.5) inset !important;
    -webkit-text-fill-color: var(--white) !important;
    transition: background-color 5000s ease-in-out 0s;
}

input:-internal-autofill-selected {
    background-color: rgba(0, 0, 0, 0.5) !important;
    color: var(--white) !important;
}

/* Specific styling for the whale logo on the confirmation page */
.confirmation-section .centered-logo {
    width: 320px;
    height: auto;
    margin-bottom: -1rem;
    filter: none;
    transition: none;
    animation: whaleFloat 4s ease-in-out infinite;
    max-width: 100%;
}

.confirmation-section .hodlhub-branding-logo {
    display: block;
    margin: 15px auto;
    width: 80%;
    max-width: 600px;
    height: auto;
}

/* Gradient line */
@media (max-width: 500px) {
    body, .container, .hero-content, .tagline, .hero-section {
        min-width: auto; /* Allow content to scale properly */
        width: 100%;
    }
}