/* ==========================================
   CSS Variables (Telegram Theme)
   ========================================== */
:root {
    /* Telegram Colors */
    --text-color: #fff;
    --accent-btn-color: #1c93e3;
    --body-bg: #000;
    --box-bg: #1e1e1e;
    --box-bg-blured: rgba(34, 34, 34, .84);
    --tme-logo-color: #fff;
    --tme-desc-color: #84888C;
    --tme-table-bg-color: #212429;
    --tme-table-border-color: #33373d;
    --tme-table-head-color: #262a2e;
    --tme-table-accent-color: #30aafd;
    --tme-table-accent-bg-color: #23313e;
    --accent-link-color: #3ca1eb;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
    
    /* Border Radius */
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 1rem;
    --border-radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    
    /* Transition */
    --transition-base: all 0.2s ease-in-out;
}

/* ==========================================
   Base Styles
   ========================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--body-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    min-height: 100vh;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    transition: var(--transition-base);
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
}

/* ==========================================
   Background Pattern
   ========================================== */
.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1a2e 50%, #16213e 100%);
    opacity: 1;
}

.background-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/img/figma-pattern.svg');
    background-repeat: repeat;
    background-size: 375px 812px;
    background-position: center;
    opacity: 0.15;
    filter: invert(1) brightness(1.5);
}

/* ==========================================
   Button Component
   ========================================== */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    transition: var(--transition-base);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.button:focus-visible {
    outline: 2px solid var(--accent-btn-color);
    outline-offset: 2px;
}

.button--primary {
    display: inline-block;
    font-size: 14px;
    line-height: 17px;
    font-weight: bold;
    -webkit-font-smoothing: antialiased;
    text-transform: uppercase;
    color: var(--text-color);
    background: var(--accent-btn-color);
    padding: 9px 16px;
    height: 34px;
    border-radius: 17px;
    text-align: center;
    transition: all 0.15s ease 0.15s;
}

.button--primary:hover {
    opacity: 0.9;
}

.button--primary:active {
    transform: scale(0.98);
}

.button--join {
    display: inline-block;
    font-size: 15px;
    line-height: 20px;
    font-weight: bold;
    -webkit-font-smoothing: antialiased;
    text-transform: uppercase;
    color: var(--text-color);
    background: var(--accent-btn-color);
    padding: 14px 40px;
    width: 100%;
    max-width: 280px;
    border-radius: 28px;
    text-align: center;
    transition: all 0.15s ease 0.15s;
    position: relative;
    overflow: hidden;
}

.button--join::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(270deg, rgba(100, 181, 239, 0) 48.44%, #64b5ef 75.52%, rgba(100, 181, 239, 0) 100%);
    background-repeat: no-repeat;
    animation: bg-move linear 5s infinite;
    pointer-events: none;
}

.button--join:hover {
    opacity: 0.9;
}

.button--join:active {
    transform: scale(0.98);
}

@keyframes bg-move {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ==========================================
   Header
   ========================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--box-bg-blured);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    height: 56px;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--tme-logo-color);
    font-weight: 400;
    font-size: 1.25rem;
    letter-spacing: 0.02em;
}

.header__logo:hover {
    opacity: 0.9;
}

.header__logo-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: block;
}

.header__logo-text {
    display: inline-block;
    font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, Verdana, sans-serif;
    font-weight: 700;
}

@media (max-width: 480px) {
    .header__logo-text {
        display: none;
    }
}

.header__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

@media (max-width: 767px) {
    .header__actions {
        display: none;
    }
}

/* ==========================================
   Main Content
   ========================================== */
.main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(56px + var(--spacing-lg)) var(--spacing-sm) var(--spacing-lg);
    position: relative;
}

/* ==========================================
   Invite Card
   ========================================== */
.invite {
    width: 100%;
    max-width: 360px;
}

.invite__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--box-bg);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg) var(--spacing-md);
    box-shadow: var(--shadow-xl);
    position: relative;
}

.invite__logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--body-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 3px solid var(--tme-table-border-color);
}

.invite__logo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.invite__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
    text-align: center;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.invite__subtitle {
    font-size: 0.875rem;
    color: var(--tme-desc-color);
    margin-bottom: 0.875rem;
    text-align: center;
    line-height: 1.2;
}

.invite__description {
    font-size: 0.875rem;
    color: var(--text-color);
    margin: 0 0 var(--spacing-md) 0;
    text-align: center;
    line-height: 1.35;
    max-width: 100%;
    padding: 0 0.5rem;
}

/* ==========================================
   Responsive Design
   ========================================== */

/* Small Mobile (up to 374px) */
@media (max-width: 374px) {
    .invite__card {
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    .invite__logo {
        width: 100px;
        height: 100px;
    }
    
    .invite__title {
        font-size: 1.125rem;
    }
    
    .button--join {
        font-size: 14px;
        padding: 12px 30px;
    }
}

/* Mobile (375px - 767px) */
@media (min-width: 375px) and (max-width: 767px) {
    .invite__logo {
        width: 130px;
        height: 130px;
    }
    
    .invite__title {
        font-size: 1.375rem;
    }
}

/* Tablet (768px and up) */
@media (min-width: 768px) {
    body {
        font-size: 15px;
    }
    
    .header__container {
        padding: 0 1.5rem;
        max-width: 100%;
    }
    
    .main {
        padding: calc(56px + var(--spacing-xxl)) var(--spacing-lg) var(--spacing-xxl);
    }
    
    .invite__card {
        padding: var(--spacing-xxl) var(--spacing-xl);
    }
    
    .invite__logo {
        width: 160px;
        height: 160px;
        margin-bottom: var(--spacing-lg);
    }
    
    .invite__title {
        font-size: 1.75rem;
    }
    
    .invite__subtitle {
        font-size: 1rem;
    }
    
    .invite__description {
        font-size: 1rem;
        max-width: 380px;
        margin-bottom: var(--spacing-xl);
    }
    
    .button--join {
        font-size: 16px;
        padding: 14px 60px;
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    .header__container {
        padding: 0 0.75rem;
        max-width: 100%;
    }
    
    .invite__logo {
        width: 180px;
        height: 180px;
    }
}

/* Large Desktop (1440px and up) */
@media (min-width: 1440px) {
    .header__container {
        padding: 0 0.75rem;
        max-width: 100%;
    }
}

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

/* Focus styles for keyboard navigation */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-btn-color);
    outline-offset: 2px;
    border-radius: var(--border-radius-sm);
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {
    .header {
        display: none;
    }
    
    .main {
        min-height: auto;
    }
    
    .invite__card {
        box-shadow: none;
        border: 1px solid var(--tme-table-border-color);
    }
}
