/* ===================================
   Discord Invite Website - Stylesheet
   Based on reference implementation
   =================================== */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap");

/* === Reset & Base Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline-width: 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: #1a1d29;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Main Container === */
main.main {
    background-color: #1a1d29;
    width: 100vw;
    height: 100vh;
    color: white;
    position: relative;
    perspective: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    overflow: hidden;
}

/* === Animated Background === */
main.main .background {
    position: absolute;
    right: 50%;
    width: 100%;
    transform: scale(1) rotate(20deg);
    display: flex;
    opacity: 0.5;
}

/* Inner containers for angled rows */
main.main .background .inner {
    display: flex;
    flex-direction: column;
}

/* Card animations for each position in inner container */
main.main .background .inner > div:nth-child(1) {
    animation: loop_1 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(2) {
    animation: loop_2 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(3) {
    animation: loop_3 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(4) {
    animation: loop_4 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(5) {
    animation: loop_5 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(6) {
    animation: loop_6 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(7) {
    animation: loop_7 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(8) {
    animation: loop_8 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(9) {
    animation: loop_9 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(10) {
    animation: loop_10 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(11) {
    animation: loop_11 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(12) {
    animation: loop_12 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(13) {
    animation: loop_13 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(14) {
    animation: loop_14 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(15) {
    animation: loop_15 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(16) {
    animation: loop_16 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(17) {
    animation: loop_17 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(18) {
    animation: loop_18 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(19) {
    animation: loop_19 var(--duration) infinite normal linear;
}

main.main .background .inner > div:nth-child(20) {
    animation: loop_20 var(--duration) infinite normal linear;
}

/* Loop animations for vertical scrolling */
@keyframes loop_1 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_2 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_3 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_4 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_5 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_6 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_7 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_8 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_9 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_10 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_11 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_12 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_13 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_14 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_15 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_16 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_17 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_18 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_19 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

@keyframes loop_20 {
    0% { display: block; transform: translateY(200px); }
    40% { display: none; transform: translateY(-1100px); }
    100% { display: block; transform: translateY(200px); }
}

/* === Member Cards === */
.card {
    width: 500px;
    height: 140px;
    background-color: white;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    display: flex !important;
    align-items: center;
    z-index: 1;
    margin: 32px 16px;
}

.card:after {
    content: "";
    width: 100%;
    height: 50%;
    bottom: 0;
    left: 0;
    background-color: #404eed;
    z-index: 1;
    display: block;
    position: absolute;
}

.card * {
    z-index: 10;
    position: relative;
}

.card .card--icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 20px;
    position: relative;
}

.card .card--icon img {
    object-fit: cover;
    object-position: center center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.card .card--icon span {
    display: block;
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #00c900;
    z-index: 10;
    border: solid 5px #404eed;
}

.card .card--content {
    height: 100%;
}

.card .card--content .name {
    height: 50%;
    display: flex;
    align-items: flex-end;
}

.card .card--content .name span {
    color: #2c2f33;
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.card .card--content .playing {
    height: 50%;
}

.card .card--content .playing span {
    display: inline-block;
    width: 100%;
}

.card .card--content .playing span.title {
    margin-top: 10px;
    font-size: 12px;
    color: #fbcf73;
}

.card .card--content .playing span.game {
    margin-top: 5px;
    font-size: 16px;
    color: white;
}

/* === Overlay Content === */
.overlay {
    position: relative;
    z-index: 10;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

/* === Invite Container === */
.invite-container {
    display: flex;
    overflow: hidden;
    position: relative;
    border-radius: 20px;
    box-shadow: 0px 10px 50px 10px #111111;
    animation: fadeInUp 0.8s ease;
}

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

/* === Logo Section === */
.logo-container {
    padding: 45px 30px;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.logo-container:before {
    content: "";
    background-size: cover !important;
    position: absolute;
    top: -50px;
    left: -50px;
    width: 150%;
    height: 150%;
    filter: blur(10px);
    box-shadow: inset 0 0 0 3000px rgba(255, 255, 255, 0.9);
}

.logo-container img {
    width: 150px;
    margin-bottom: -5px;
    display: block;
    position: relative;
    border-radius: 50%;
}

.logo-container .server-title {
    padding: 25px 0 10px 0;
    color: #202225;
    z-index: 1;
    position: relative;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    letter-spacing: 0.05em;
}

.server-name-line1,
.server-name-line2 {
    display: block;
}

/* === Invite Card === */
.invite-card {
    padding: 45px 30px;
    box-sizing: border-box;
    width: 400px;
    position: relative;
}

.invite-card:before {
    content: "";
    background-size: cover !important;
    box-shadow: inset 0 0 0 3000px rgba(40, 43, 48, 1);
    filter: blur(10px);
    position: absolute;
    width: 150%;
    height: 150%;
    top: -50px;
    left: -50px;
}

.invite-card > * {
    position: relative;
    z-index: 1;
}

.invite-heading {
    margin: 0 0 15px 0;
    font-family: "Montserrat";
    font-weight: 600;
    font-size: 1.1rem;
    color: #fff;
    text-align: center;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* === Server Info === */
.server-info {
    text-align: center;
    margin-bottom: 3rem;
}

.server-details {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.server-name {
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff;
}

.invited-by {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.founder-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

/* === Members Online === */
.members-online {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(67, 181, 129, 0.2);
    border-radius: 12px;
    margin-top: 0.5rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    background-color: #43B581;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

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

.online-text {
    font-size: 0.95rem;
    color: #fff;
}

.online-text strong {
    font-weight: 700;
    color: #43B581;
}

/* === Accept Button === */
.invite-link {
    display: block;
    text-decoration: none;
    position: absolute;
    bottom: 45px;
    left: 30px;
    right: 30px;
}

.accept-btn {
    width: 100%;
    box-sizing: border-box;
    background: #7289da;
    border: none;
    color: #fff;
    padding: 15px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s ease;
    font-weight: 600;
    font-size: 1.1rem;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.accept-btn:hover {
    background: #6b7fc5;
}

.accept-btn:active {
    transform: scale(0.98);
}

.discord-icon {
    width: 24px;
    height: 24px;
}

/* === Error Message === */
.error-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(240, 71, 71, 0.2);
    border: 1px solid #F04747;
    border-radius: 8px;
    margin-top: 1rem;
    color: #F04747;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

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

.error-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* === Responsive Design === */
@media screen and (min-width: 0px) and (max-width: 675px) {
    .logo-container {
        display: none;
    }

    main.main .background {
        transform: scale(0.75) rotate(20deg);
    }
    
    .invite-container {
        max-width: 400px;
    }
    
    .card {
        width: 400px;
        height: 120px;
    }
    
    .card .card--icon {
        width: 80px;
        height: 80px;
        margin: 15px;
    }
    
    .card .card--content .name span {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .overlay {
        padding: 1rem;
    }
    
    .invite-card {
        width: 100%;
        padding: 30px 20px;
    }
    
    .invite-link {
        left: 20px;
        right: 20px;
        bottom: 30px;
    }
    
    .card {
        width: 300px;
        height: 100px;
        margin: 20px 10px;
    }
    
    .card .card--icon {
        width: 60px;
        height: 60px;
        margin: 10px;
    }
    
    .card .card--icon span {
        width: 20px;
        height: 20px;
        border-width: 3px;
    }
    
    .card .card--content .name span {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .card .card--content .playing span.title {
        font-size: 10px;
        margin-top: 5px;
    }
    
    .card .card--content .playing span.game {
        font-size: 12px;
        margin-top: 3px;
    }
}

/* === Accessibility === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

a:focus,
button:focus {
    outline: 2px solid #7289da;
    outline-offset: 2px;
}

/* === Print Styles === */
@media print {
    .background {
        display: none;
    }
    
    .invite-card {
        box-shadow: none;
        border: 1px solid #000;
    }
}
