@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Prevent horizontal scroll on mobile */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    color: #f8fafc;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
}

/* Fluid Typography for Desktop */
@media (min-width: 1024px) {
    body {
        font-size: 17px;
    }
}

@media (min-width: 1280px) {
    body {
        font-size: 18px;
    }
}

@media (min-width: 1536px) {
    body {
        font-size: 19px;
    }
}

/* Headings scale with viewport */
h1 {
    font-size: clamp(2rem, 5vw, 4.5rem);
    line-height: 1.2;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 3.5rem);
    line-height: 1.3;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    line-height: 1.4;
}

h4 {
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    line-height: 1.5;
}

p {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.7;
}

/* Container adjustments - Full width responsive */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container {
        max-width: 640px;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 100%;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 100%;
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1400px;
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

@media (min-width: 1536px) {
    .container {
        max-width: 1600px;
    }
}

/* Content wrappers for better readability */
.content-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .content-wrapper {
        max-width: 90%;
    }
}

@media (min-width: 1280px) {
    .content-wrapper {
        max-width: 85%;
    }
}

/* Article content - readable width */
.article-content {
    max-width: 100%;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .article-content {
        max-width: 900px;
    }
}

@media (min-width: 1280px) {
    .article-content {
        max-width: 1100px;
    }
}

@media (min-width: 1536px) {
    .article-content {
        max-width: 1200px;
    }
}

.gradient-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 25%, #334155 50%, #475569 75%, #64748b 100%);
    position: relative;
}

.gradient-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 20%, rgba(14, 165, 233, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(217, 70, 239, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 60%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.glass-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .glass-card {
        padding: 2rem;
    }
}

@media (min-width: 1024px) {
    .glass-card {
        padding: 2.5rem;
        border-radius: 20px;
    }
}

@media (min-width: 1280px) {
    .glass-card {
        padding: 3rem;
    }
}

.glass-card:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(148, 163, 184, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.premium-button {
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 50%, #8b5cf6 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-size: 1rem;
}

@media (min-width: 1024px) {
    .premium-button {
        padding: 14px 32px;
        font-size: 1.05rem;
        border-radius: 14px;
    }
}

@media (min-width: 1280px) {
    .premium-button {
        padding: 16px 40px;
        font-size: 1.1rem;
    }
}

.premium-button::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;
}

.premium-button:hover::before {
    left: 100%;
}

.premium-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.3);
}

.tab-button {
    background: rgba(51, 65, 85, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    color: #cbd5e1;
    font-weight: 500;
    padding: 12px 24px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.tab-button:hover {
    background: rgba(51, 65, 85, 0.8);
    border-color: rgba(148, 163, 184, 0.4);
    color: #f1f5f9;
    transform: translateY(-1px);
}

.tab-button.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 50%, #8b5cf6 100%);
    border-color: transparent;
    color: white;
    font-weight: 600;
}

.mirror-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

.mirror-card:hover {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(14, 165, 233, 0.5);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.1);
}

.copy-button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    padding: 8px 16px;
    font-size: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.copy-button:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.feature-icon {
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    border-radius: 12px;
    padding: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.stat-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(14, 165, 233, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.3), transparent);
    margin: 80px 0;
}

.floating-element {
    animation: float 6s ease-in-out infinite;
}

.text-gradient {
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.link-text {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    word-wrap: break-word;
    word-break: break-all;
    overflow-wrap: break-word;
    line-height: 1.4;
}

/* Article Styles for Guide Pages */
.article-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #f8fafc;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 1280px) {
    .article-content h2 {
        margin-top: 4rem;
        margin-bottom: 2rem;
    }
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

@media (min-width: 1280px) {
    .article-content h3 {
        margin-top: 2.5rem;
        margin-bottom: 1.25rem;
    }
}

.article-content p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

@media (min-width: 1280px) {
    .article-content p {
        line-height: 1.9;
        margin-bottom: 1.75rem;
    }
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

@media (min-width: 1280px) {
    .article-content ul,
    .article-content ol {
        margin-bottom: 2rem;
        padding-left: 2.5rem;
    }
}

.article-content li {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #cbd5e1;
    margin-bottom: 0.75rem;
}

@media (min-width: 1280px) {
    .article-content li {
        margin-bottom: 1rem;
    }
}

.article-content a {
    color: #38bdf8;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.article-content a:hover {
    color: #7dd3fc;
}

.article-content .info-box {
    background: rgba(14, 165, 233, 0.1);
    border-left: 4px solid #0ea5e9;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

@media (min-width: 1280px) {
    .article-content .info-box {
        padding: 2rem;
        margin: 3rem 0;
        border-radius: 12px;
    }
}

.article-content .warning-box {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid #ef4444;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

@media (min-width: 1280px) {
    .article-content .warning-box {
        padding: 2rem;
        margin: 3rem 0;
        border-radius: 12px;
    }
}

.article-content .success-box {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid #10b981;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

@media (min-width: 1280px) {
    .article-content .success-box {
        padding: 2rem;
        margin: 3rem 0;
        border-radius: 12px;
    }
}

/* Responsive Grid System */
@media (min-width: 1024px) {
    /* Better spacing for large screens */
    .grid {
        gap: 2rem;
    }
}

@media (min-width: 1280px) {
    /* Even more spacing for extra large screens */
    .grid {
        gap: 2.5rem;
    }
}

@media (min-width: 1536px) {
    /* Maximum spacing for 2xl screens */
    .grid {
        gap: 3rem;
    }
}

/* Responsive section padding */
section {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

@media (min-width: 768px) {
    section {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}

@media (min-width: 1024px) {
    section {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

@media (min-width: 1280px) {
    section {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body {
        font-size: 15px; /* Увеличил для лучшей читаемости */
    }

    /* Container на мобильных */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Cards */
    .glass-card {
        margin: 16px 0;
        padding: 1.25rem !important;
        border-radius: 12px;
    }

    /* Buttons */
    .premium-button {
        padding: 14px 24px; /* Увеличенная область тапа */
        font-size: 15px;
        width: 100%;
        min-height: 48px; /* Apple рекомендация */
    }

    .tab-button {
        padding: 12px 18px;
        font-size: 14px;
        min-height: 44px;
    }

    .copy-button {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 44px; /* Touch-friendly */
    }

    /* Typography - улучшенная читаемость */
    h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        margin-top: 2rem !important;
        margin-bottom: 1rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
        line-height: 1.4 !important;
        margin-top: 1.5rem !important;
    }

    p {
        font-size: 1rem !important;
        line-height: 1.7 !important;
        margin-bottom: 1rem !important;
    }

    .article-content h2 {
        font-size: 1.5rem;
        margin-top: 2rem;
    }

    .article-content h3 {
        font-size: 1.25rem;
    }

    .article-content p,
    .article-content li {
        font-size: 1rem;
        line-height: 1.7;
    }

    /* Lists */
    ul, ol {
        padding-left: 1.5rem;
        margin-bottom: 1rem;
    }

    li {
        margin-bottom: 0.5rem;
        line-height: 1.6;
    }

    /* Stat Cards */
    .stat-card {
        padding: 16px;
    }

    /* Feature Icons */
    .feature-icon {
        width: 48px !important;
        height: 48px !important;
        padding: 10px;
    }

    .feature-icon i {
        width: 28px !important;
        height: 28px !important;
    }

    /* Mirror Cards - улучшенный mobile дизайн */
    .mirror-card {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
        padding: 16px !important;
        background: rgba(15, 23, 42, 0.9) !important;
    }

    .mirror-card .copy-button {
        width: 100%;
        justify-content: center;
        display: flex;
        align-items: center;
    }

    .link-text {
        font-size: 13px;
        line-height: 1.6;
        word-break: break-all;
        padding: 8px;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 6px;
    }

    /* Grid adjustments на мобильных */
    .grid {
        gap: 1rem;
    }

    /* Sections padding */
    section {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    main {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }

    /* Info Boxes */
    .article-content .info-box,
    .article-content .warning-box,
    .article-content .success-box {
        padding: 1rem;
        margin: 1.5rem 0;
    }

    /* Section spacing */
    .section-divider {
        margin: 40px 0;
    }

    /* Remove floating animation on mobile for performance */
    .floating-element {
        animation: none;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    /* Even smaller adjustments for very small screens */
    .glass-card {
        padding: 16px !important;
        border-radius: 12px;
    }

    h1 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.75rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    .premium-button,
    .tab-button {
        font-size: 13px;
    }

    /* Stat cards in single column on very small screens */
    .stat-card {
        margin-bottom: 12px;
    }
}

/* Touch-friendly sizing */
@media (hover: none) and (pointer: coarse) {
    /* Increase tap target sizes for touch devices */
    .premium-button,
    .tab-button,
    .copy-button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Larger spacing for touch */
    a, button {
        padding: 12px;
    }
}

/* Enhanced hover effects for desktop only */
@media (hover: hover) and (pointer: fine) {
    /* Smooth transitions for all interactive elements */
    a, button, .glass-card, .mirror-card, .stat-card {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Links get subtle underline on hover */
    a:not(.premium-button):not(.tab-button) {
        position: relative;
    }

    /* Cards get more pronounced lift on hover */
    .glass-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    }

    .stat-card:hover {
        transform: translateY(-6px) scale(1.02);
    }

    /* Buttons get enhanced shadow on hover */
    .premium-button:hover {
        transform: translateY(-3px);
        box-shadow: 0 15px 40px rgba(14, 165, 233, 0.4);
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .floating-element {
        animation: none !important;
    }
}
