/* DarkMatter Website - Main Stylesheet */
/* Clean, minimal, and professional design */

:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #0f3460;
    --highlight-color: #e94560;
    --text-color: #f1f1f1;
    --text-secondary: #b0b0b0;
    --border-color: #2a2a3e;
    --max-width: 1200px;
    --spacing-unit: 1rem;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--primary-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Skip to main content link - accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--highlight-color);
    color: var(--text-color);
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    border-radius: 0 0 4px 0;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--text-color);
    outline-offset: 2px;
}

/* Header Styles */
header {
    background-color: var(--secondary-color);
    border-bottom: 2px solid var(--border-color);
    padding: calc(var(--spacing-unit) * 1.5) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    will-change: transform;
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 0.75);
}

.logo {
    width: 50px;
    height: 50px;
}

.site-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
}

/* Navigation Styles */
nav ul {
    list-style: none;
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover,
nav a.active {
    color: var(--highlight-color);
}

/* Hamburger Menu */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.hamburger-menu:focus {
    outline: 2px solid var(--highlight-color);
    outline-offset: 4px;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

/* Main Content Styles */
main {
    max-width: var(--max-width);
    margin: calc(var(--spacing-unit) * 3) auto;
    padding: 0 var(--spacing-unit);
}

/* Typography */
h1 {
    font-size: 2.5rem;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    color: var(--text-color);
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
    margin-top: calc(var(--spacing-unit) * 2.5);
    margin-bottom: var(--spacing-unit);
    color: var(--text-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: calc(var(--spacing-unit) * 0.5);
}

h3 {
    font-size: 1.5rem;
    margin-top: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 0.75);
    color: var(--text-color);
}

h4 {
    font-size: 1.25rem;
    margin-top: calc(var(--spacing-unit) * 1.5);
    margin-bottom: calc(var(--spacing-unit) * 0.5);
    color: var(--text-color);
}

p {
    margin-bottom: calc(var(--spacing-unit) * 1.25);
    color: var(--text-secondary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

strong {
    color: var(--text-color);
    font-weight: 600;
}

/* Links */
a {
    color: var(--highlight-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Lists */
ul, ol {
    margin-left: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 1.25);
}

li {
    margin-bottom: calc(var(--spacing-unit) * 0.5);
    color: var(--text-secondary);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.content-image {
    margin: calc(var(--spacing-unit) * 2) 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: calc(var(--spacing-unit) * 3) 0;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    border-radius: 8px;
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.hero h1 {
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-color);
    max-width: 800px;
    margin: 0 auto calc(var(--spacing-unit) * 2);
}

/* Call-to-Action Button */
.cta-button {
    display: inline-block;
    background-color: var(--highlight-color);
    color: var(--text-color);
    padding: calc(var(--spacing-unit) * 0.75) calc(var(--spacing-unit) * 2);
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.cta-button:hover {
    background-color: #d63850;
    transform: translateY(-2px);
    text-decoration: none;
}

/* Content Sections */
.content-section {
    margin-bottom: calc(var(--spacing-unit) * 3);
}

/* Info Boxes */
.info-box {
    background-color: var(--secondary-color);
    border-left: 4px solid var(--highlight-color);
    padding: calc(var(--spacing-unit) * 1.5);
    margin: calc(var(--spacing-unit) * 2) 0;
    border-radius: 4px;
}

.info-box p:last-child {
    margin-bottom: 0;
}

/* Warning Box */
.warning-box {
    background-color: rgba(233, 69, 96, 0.1);
    border-left: 4px solid var(--highlight-color);
    padding: calc(var(--spacing-unit) * 1.5);
    margin: calc(var(--spacing-unit) * 2) 0;
    border-radius: 4px;
}

.warning-box strong {
    color: var(--highlight-color);
}

/* Footer Styles */
footer {
    background-color: var(--secondary-color);
    border-top: 2px solid var(--border-color);
    padding: calc(var(--spacing-unit) * 2) 0;
    margin-top: calc(var(--spacing-unit) * 4);
    text-align: center;
}

footer p {
    color: var(--text-secondary);
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}

/* Responsive Design */
/* Tablets and small laptops */
@media (max-width: 1024px) {
    :root {
        --max-width: 100%;
    }

    main {
        padding: 0 calc(var(--spacing-unit) * 1.5);
    }
}

/* Tablets and larger phones */
@media (max-width: 768px) {
    :root {
        --spacing-unit: 0.875rem;
    }

    body {
        font-size: 15px;
    }

    .header-container {
        flex-direction: row;
        gap: var(--spacing-unit);
        padding: 0 calc(var(--spacing-unit) * 1.5);
        flex-wrap: nowrap;
    }

    /* Show hamburger menu */
    .hamburger-menu {
        display: flex;
        order: 3;
    }

    /* Mobile navigation */
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background-color: var(--secondary-color);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
        transition: right 0.3s ease;
        z-index: 999;
        overflow-y: auto;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        padding: 80px 0 20px;
        width: 100%;
    }

    nav ul.active {
        right: 0;
    }

    nav.active {
        right: 0;
    }

    /* When menu is active */
    nav ul.active {
        display: flex;
    }

    nav li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    nav a {
        display: block;
        padding: calc(var(--spacing-unit) * 1.25) calc(var(--spacing-unit) * 2);
        width: 100%;
        text-align: left;
        font-size: 1.1rem;
        transition: all 0.3s ease;
    }

    nav a:hover {
        background-color: var(--accent-color);
        padding-left: calc(var(--spacing-unit) * 2.5);
    }

    h1 {
        font-size: 1.875rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .hero {
        padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 1.5);
    }

    .hero p {
        font-size: 1rem;
        padding: 0 calc(var(--spacing-unit) * 0.5);
    }

    .access-portal {
        padding: 1.5rem;
        border-radius: 15px;
    }

    .portal-title {
        font-size: 1.2rem;
    }

    .onion-link {
        font-size: 14px;
    }

    .reviews-section {
        padding: 1.5rem;
        border-radius: 15px;
    }
}

/* Mobile menu overlay */
@media (max-width: 768px) {
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0);
        z-index: 998;
        pointer-events: none;
        transition: background-color 0.3s ease;
    }

    body.menu-open::before {
        background-color: rgba(0, 0, 0, 0.7);
        pointer-events: all;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    :root {
        --spacing-unit: 0.75rem;
    }

    body {
        font-size: 14px;
    }

    header {
        padding: var(--spacing-unit) 0;
    }

    .header-container {
        padding: 0 var(--spacing-unit);
    }

    /* Narrower mobile menu */
    nav {
        width: 260px;
    }

    .logo {
        width: 40px;
        height: 40px;
    }

    .site-title {
        font-size: 1.25rem;
    }

    nav ul {
        gap: calc(var(--spacing-unit) * 0.75);
        font-size: 0.9rem;
    }

    main {
        margin: calc(var(--spacing-unit) * 2) auto;
        padding: 0 var(--spacing-unit);
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: var(--spacing-unit);
    }

    h2 {
        font-size: 1.25rem;
        margin-top: calc(var(--spacing-unit) * 1.5);
    }

    h3 {
        font-size: 1.125rem;
    }

    h4 {
        font-size: 1rem;
    }

    .hero {
        padding: calc(var(--spacing-unit) * 1.5) var(--spacing-unit);
        margin-bottom: calc(var(--spacing-unit) * 2);
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .cta-button {
        padding: calc(var(--spacing-unit) * 0.625) calc(var(--spacing-unit) * 1.5);
        font-size: 0.9rem;
    }

    .access-portal {
        padding: 1rem;
        border-radius: 12px;
        margin: 1.5rem 0;
    }

    .portal-title {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .link-display-wrapper {
        padding: 10px;
    }

    .onion-link {
        font-size: 12px;
        line-height: 1.5;
    }

    .copy-button {
        padding: 8px 16px;
        font-size: 0.875rem;
    }

    .info-box,
    .warning-box {
        padding: var(--spacing-unit);
        margin: var(--spacing-unit) 0;
    }

    .reviews-section {
        padding: 1rem;
        border-radius: 12px;
    }

    .overall-rating {
        padding: 1rem;
        gap: 1.5rem;
    }

    .rating-number {
        font-size: 3rem;
    }

    .rating-stars {
        font-size: 1.5rem;
    }

    .rating-bars {
        min-width: 100%;
    }

    .star-label {
        width: 50px;
        font-size: 0.8rem;
    }

    .bar-percentage {
        width: 35px;
        font-size: 0.75rem;
    }

    .review-item {
        padding: 1rem;
    }

    .reviewer-avatar {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }

    .reviewer-name {
        font-size: 0.9rem;
    }

    .review-stars {
        font-size: 0.9rem;
    }

    .review-text {
        font-size: 0.875rem;
    }

    ul, ol {
        margin-left: calc(var(--spacing-unit) * 1.5);
    }

    footer {
        padding: calc(var(--spacing-unit) * 1.5) var(--spacing-unit);
        font-size: 0.85rem;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .site-title {
        font-size: 1.125rem;
    }

    nav ul {
        gap: calc(var(--spacing-unit) * 0.5);
        font-size: 0.85rem;
    }

    h1 {
        font-size: 1.375rem;
    }

    .hero h1 {
        font-size: 1.375rem;
    }

    .rating-number {
        font-size: 2.5rem;
    }

    .onion-link {
        font-size: 11px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    nav a {
        padding: calc(var(--spacing-unit) * 0.5);
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .cta-button {
        min-height: 44px;
        min-width: 120px;
    }

    .copy-button {
        min-height: 44px;
        min-width: 100px;
    }

    /* Remove hover effects on touch devices */
    .access-portal:hover {
        transform: none;
    }

    .review-item:hover {
        transform: none;
    }

    .copy-button:hover {
        transform: none;
        box-shadow: none;
    }

    .cta-button:hover {
        transform: none;
    }

    /* Add active/tap states instead */
    .copy-button:active {
        transform: scale(0.95);
    }

    .cta-button:active {
        transform: scale(0.95);
    }
}

/* Landscape orientation on phones */
@media (max-width: 812px) and (orientation: landscape) {
    header {
        padding: calc(var(--spacing-unit) * 0.5) 0;
    }

    .hero {
        padding: calc(var(--spacing-unit) * 1.5);
    }

    main {
        margin: calc(var(--spacing-unit) * 1.5) auto;
    }

    .overall-rating {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* Lazy Loading Animation */
img[loading="lazy"] {
    transition: opacity 0.3s ease-in;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Responsive Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: calc(var(--spacing-unit) * 1.5) 0;
    overflow-x: auto;
    display: block;
}

@media (max-width: 768px) {
    table {
        font-size: 0.9rem;
    }
}

/* Prevent text overflow */
* {
    max-width: 100%;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Responsive iframes and embedded content */
iframe,
embed,
object,
video {
    max-width: 100%;
    height: auto;
}

/* Improve form inputs on mobile */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    font-size: 16px; /* Prevents iOS zoom on focus */
    max-width: 100%;
}

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

/* iOS Safari specific optimizations */
@supports (-webkit-touch-callout: none) {
    body {
        /* Prevent rubber-band scrolling */
        position: fixed;
        overflow: hidden;
        width: 100%;
        height: 100%;
    }

    main {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Momentum scrolling for iOS */
body,
main,
.access-portal,
.reviews-section {
    -webkit-overflow-scrolling: touch;
}

/* Prevent tap highlight on mobile */
a,
button,
.copy-button,
.cta-button {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-touch-callout: none;
}

/* Optimize animations for mobile */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Стили для блока ссылок с кнопкой копирования */
.access-portal {
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.access-portal:hover {
    border-color: #00ff7f;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 255, 127, 0.15);
}

.portal-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.link-display-wrapper {
    background-color: #282c34;
    padding: 15px;
    border: 2px solid #61dafb;
    border-radius: 5px;
    position: relative;
    box-shadow: 0 0 10px rgba(97, 218, 251, 0.5);
    transition: all 0.3s ease-in-out;
}

.link-display-wrapper:hover {
    box-shadow: 0 0 15px rgba(97, 218, 251, 0.8);
    transform: translateY(-2px);
}

.onion-link {
    color: #61dafb;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    display: block;
    margin-bottom: 10px;
    line-height: 1.6;
}

.copy-button {
    background: linear-gradient(135deg, #00ff7f 0%, #4ecdc4 100%);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.copy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 127, 0.4);
}

.copy-button:active {
    transform: translateY(0);
}

.copy-button.copied {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: #fff;
}

.copy-icon {
    display: inline-block;
    margin-right: 0.3rem;
}

.copy-success {
    color: #4caf50;
    font-size: 14px;
    margin-top: 10px;
    display: none;
    font-weight: 600;
    animation: fadeIn 0.3s ease-in;
}

.copy-success.show {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portal-status {
    color: #4ecdc4;
    font-weight: 600;
    margin-left: 1rem;
    font-size: 0.9rem;
}

.warning-box {
    background: rgba(0, 255, 127, 0.08);
    border: 1px solid #00ff7f;
    border-radius: 15px;
    padding: 1.5rem;
    margin-top: 2rem;
    text-align: center;
}

.warning-box p {
    color: #cccccc;
    font-size: 0.9rem;
    margin: 0;
}

/* Стили для блока рейтинга и отзывов */
.reviews-section {
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 20px;
    padding: 2.5rem;
    margin: 2rem 0;
}

.overall-rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem;
    background: rgba(0, 255, 127, 0.05);
    border-radius: 15px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.rating-score {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rating-number {
    font-size: 4rem;
    font-weight: 700;
    color: #00ff7f;
    line-height: 1;
}

.rating-stars {
    font-size: 2rem;
    color: #ffd700;
    margin: 0.5rem 0;
}

.rating-count {
    color: #888;
    font-size: 0.9rem;
}

.rating-bars {
    flex: 1;
    min-width: 300px;
}

.rating-bar-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0;
}

.star-label {
    width: 60px;
    color: #ccc;
    font-size: 0.9rem;
}

.bar-container {
    flex: 1;
    height: 8px;
    background: #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff7f, #4ecdc4);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.bar-percentage {
    width: 40px;
    text-align: right;
    color: #888;
    font-size: 0.85rem;
}

.reviews-list {
    margin-top: 2rem;
}

.review-item {
    background: rgba(0, 255, 127, 0.03);
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    transition: all 0.3s ease;
}

.review-item:hover {
    border-color: #00ff7f;
    transform: translateX(5px);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reviewer-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #00ff7f, #4ecdc4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #000;
}

.reviewer-name {
    font-weight: 600;
    color: #fff;
}

.review-stars {
    color: #ffd700;
    font-size: 1rem;
}

.review-date {
    color: #888;
    font-size: 0.85rem;
}

.review-text {
    color: #ccc;
    line-height: 1.6;
    margin-top: 0.5rem;
}

.review-verified {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(0, 255, 127, 0.1);
    color: #00ff7f;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
}