/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #007aff;
    --secondary-color: #5856d6;
    --accent-color: #ff3b30;
    --success-color: #34c759;
    --background: #ffffff;
    --surface: #f2f2f7;
    --text-primary: #000000;
    --text-secondary: #8e8e93;
    --border-color: #c6c6c8;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-alt: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    color: white;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}

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

.logo {
    font-size: 80px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 20px;
    font-weight: 400;
    margin-bottom: 40px;
    opacity: 0.9;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px;
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.cta-button i {
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(5px);
    }
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    z-index: 1;
}

.wave svg {
    width: 100%;
    height: 100%;
}

/* Features Section */
.features {
    padding: 100px 0;
    background: var(--background);
}

.section-title {
    text-align: center;
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 60px;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background: var(--surface);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    background: white;
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
}

.feature-card:nth-child(even) .feature-icon {
    background: var(--gradient-alt);
}

.feature-card h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Stats & Metrics Section */
.stats-section {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--background) 0%, var(--surface) 100%);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-header i {
    font-size: 32px;
    color: var(--primary-color);
}

.stat-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Speed Chart */
.speed-chart {
    padding: 20px 0;
}

.chart-bars {
    display: flex;
    gap: 40px;
    justify-content: space-around;
    margin-bottom: 30px;
}

.bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bar {
    width: 100%;
    max-width: 120px;
    height: 200px;
    background: var(--surface);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 15px;
}

.bar::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: var(--gradient);
    border-radius: 12px;
    transition: height 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bar.bar-before::before {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.bar.animated::before {
    height: var(--bar-height, 45%);
}

.bar-label,
.bar-value {
    position: relative;
    z-index: 2;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* Improve contrast: value is on gradient -> keep white; label sits higher -> add subtle shadow and adaptive color */
.bar-label {
    color: #111;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

.bar.bar-before .bar-label,
.bar.bar-after .bar-label {
    /* Increase readability over varying bar fills */
    mix-blend-mode: normal;
}

.bar-value {
    font-size: 16px;
    margin-top: 5px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* White label when it overlaps the filled gradient area */
.bar-label.on-fill {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.chart-improvement {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 25px;
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
    color: white;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(52, 199, 89, 0.3);
}

.chart-improvement i {
    font-size: 20px;
    animation: bounceUp 1s ease-in-out infinite;
}

@keyframes bounceUp {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Privacy Meter */
.privacy-meter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.meter-circle {
    position: relative;
    width: 200px;
    height: 200px;
}

.meter-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.meter-bg {
    fill: none;
    stroke: var(--surface);
    stroke-width: 12;
}

.meter-progress {
    fill: none;
    stroke: url(#gradient-privacy);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 534;
    stroke-dashoffset: 534;
    transition: stroke-dashoffset 2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.meter-progress.animated {
    stroke-dashoffset: 10.68;
}

.meter-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.meter-value {
    font-size: 48px;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.meter-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.privacy-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.privacy-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-primary);
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInLeft 0.5s ease forwards;
}

.privacy-item:nth-child(1) {
    animation-delay: 0.3s;
}

.privacy-item:nth-child(2) {
    animation-delay: 0.5s;
}

.privacy-item:nth-child(3) {
    animation-delay: 0.7s;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.privacy-item i {
    color: var(--success-color);
    font-size: 18px;
}

/* IP Protection */
.ip-protection {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.ip-comparison {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.ip-before,
.ip-after {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-radius: 16px;
    transition: all 0.3s ease;
    min-width: 0; /* allow flex children to shrink */
}

.ip-before {
    background: rgba(255, 59, 48, 0.1);
}

.ip-after {
    background: rgba(52, 199, 89, 0.1);
}

.ip-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(255, 59, 48, 0.2);
    color: var(--accent-color);
    transition: all 0.5s ease;
}

.ip-icon.protected {
    background: rgba(52, 199, 89, 0.2);
    color: var(--success-color);
    animation: pulse-shield 2s ease-in-out infinite;
}

@keyframes pulse-shield {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(52, 199, 89, 0);
    }
}

.ip-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.ip-address {
    font-size: 16px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    padding: 8px 16px;
    background: white;
    border-radius: 8px;
    min-width: 0;
    max-width: 100%;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ip-address.encrypted {
    letter-spacing: 2px;
    color: var(--success-color);
}

.ip-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.ip-location i {
    font-size: 14px;
}

.ip-arrow {
    font-size: 24px;
    color: var(--primary-color);
    animation: slide-arrow 1.5s ease-in-out infinite;
}

@keyframes slide-arrow {
    0%,
    100% {
        transform: translateX(0);
        opacity: 1;
    }
    50% {
        transform: translateX(10px);
        opacity: 0.5;
    }
}

.protection-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 30px;
    background: var(--gradient);
    color: white;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.protection-badge i {
    font-size: 20px;
}

/* How it Works Section */
.how-it-works {
    padding: 100px 0;
    background: var(--surface);
}

.steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 60px 0;
    flex-wrap: wrap;
    gap: 20px;
}

.step {
    flex: 1;
    min-width: 250px;
    text-align: center;
    padding: 30px 20px;
    background: white;
    border-radius: 20px;
    position: relative;
    box-shadow: var(--shadow);
}

.step-number {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.step-icon {
    font-size: 50px;
    color: var(--primary-color);
    margin: 20px 0;
}

.step h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.step p {
    color: var(--text-secondary);
    font-size: 15px;
}

.step-arrow {
    font-size: 30px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.cta-section {
    text-align: center;
    margin-top: 60px;
}

.telegram-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 20px 50px;
    background: #0088cc;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 600;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.telegram-button:hover {
    background: #0077b3;
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.telegram-button i {
    font-size: 28px;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 60px 0 30px;
}

.footer-content {
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
}

.footer-logo i {
    font-size: 32px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-size: 16px;
    transition: opacity 0.3s ease;
}

.footer-link:hover {
    opacity: 0.7;
}

.footer-legal {
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.legal-info {
    margin-top: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

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

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--surface);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--border-color);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

.modal-body iframe {
    width: 100%;
    min-height: 600px;
    border: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .logo {
        font-size: 60px;
    }

    .section-title {
        font-size: 32px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .stat-card {
        padding: 25px;
    }

    .chart-bars {
        gap: 30px;
    }

    .bar {
        max-width: 100px;
        height: 180px;
    }

    .chart-improvement {
        font-size: 16px;
        padding: 12px 20px;
    }

    .meter-circle {
        width: 180px;
        height: 180px;
    }

    .meter-value {
        font-size: 42px;
    }

    .ip-comparison {
        flex-direction: column;
        gap: 15px;
    }

    .ip-arrow {
        animation: none; /* prevent animation overriding transform */
        transform: rotate(90deg);
        align-self: center;
        margin: 0; /* avoid unexpected spacing that can shift it up */
    }

    /* Hide eye icons on phones to save space */
    .ip-icon {
        display: none;
    }

    .steps {
        flex-direction: column;
    }

    .step-arrow {
        transform: rotate(90deg);
        margin: 10px 0;
    }

    .telegram-button {
        padding: 16px 40px;
        font-size: 18px;
    }

    .footer-links {
        flex-direction: column;
        gap: 15px;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-body iframe {
        min-height: 400px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .cta-button {
        padding: 14px 28px;
        font-size: 16px;
    }

    .feature-card {
        padding: 30px 20px;
    }

    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-header h3 {
        font-size: 18px;
    }

    .bar {
        max-width: 80px;
        height: 150px;
        padding: 10px;
    }

    .bar-value {
        font-size: 14px;
    }

    .meter-circle {
        width: 160px;
        height: 160px;
    }

    .meter-value {
        font-size: 36px;
    }

    .privacy-item {
        font-size: 13px;
        padding: 10px 14px;
    }

    .ip-address {
        font-size: 14px;
        min-width: 120px;
    }

    .protection-badge {
        font-size: 14px;
        padding: 12px 24px;
    }
}

/* Desktop layout: stack ip-before above ip-after to fit long IP values */
@media (min-width: 1024px) {
    .ip-comparison {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .ip-arrow {
        animation: none; /* prevent animation overriding transform */
        transform: rotate(90deg);
    }

    /* Show full IP on desktop: allow wrapping instead of truncation */
    .ip-address {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

/* Smooth Scrolling Enhancement */
@media (prefers-reduced-motion: no-preference) {
    * {
        scroll-behavior: smooth;
    }
}
