@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

:root {
    --primary-color: #e74c3c;
    --secondary-color: #c0392b;
    --dark-color: #1a1a1a;
    --gray-color: #2a2a2a;
    --light-color: #ffffff;
    --text-color: #cccccc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--dark-color);
    color: var(--light-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid #333;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

header .logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

header .logo:hover {
    color: var(--secondary-color);
}

header nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

header nav ul li a {
    color: var(--light-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

header nav ul li a:hover,
header nav ul li a.active {
    color: var(--primary-color);
    background: rgba(231, 76, 60, 0.1);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--light-color);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Footer */
footer {
    background: var(--gray-color);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid #333;
}

footer p {
    color: var(--text-color);
    font-size: 0.9rem;
}

/* Main content */
main {
    margin-top: 80px;
}

main section {
    padding: 4rem 0;
}

main h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--light-color);
    font-weight: 700;
}

/* Hero Section */
#hero {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 80vh;
    display: flex;
    align-items: center;
    text-align: center;
    position: relative;
}

#hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

#hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

/* Gradient animation for server items */
@keyframes gradient-move {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Buttons */
.btn, .btn-large {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: var(--light-color);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover, .btn-large:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

/* Typography */
h1, h2, h3 {
    color: var(--light-color);
    font-weight: 700;
}

/* Logo gradient effect */
header .logo {
    background: linear-gradient(45deg, var(--primary-color), #ff6b6b);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-move 3s ease infinite;
}

/* About Section */
#about {
    background: var(--gray-color);
}

#about p {
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    color: var(--text-color);
}

/* Server List */
.server-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.server-item {
    background: var(--gray-color);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid #333;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.server-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.server-item h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--light-color);
    font-weight: 600;
}

.server-item p {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* Progress bar with gradient */
.progress {
    height: 8px;
    background: linear-gradient(90deg, #e74c3c, #f39c12, #27ae60);
    background-size: 200% 100%;
    animation: gradient-move 2s ease infinite;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-bar {
    background: #333;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.online-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 600;
}

.player-count {
    color: var(--primary-color);
    font-weight: bold;
}

#download-launcher .filesize {
    color: var(--text-color);
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Account Page */
.account-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem;
}

.form-container {
    display: none;
    background: var(--gray-color);
    border: 1px solid #333;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.form-container.active {
    display: block;
}

.account-container .form {
    width: 100%;
}

.account-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--light-color);
    font-size: 2rem;
}

.account-container p {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-color);
}

.account-container p a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.account-container p a:hover {
    text-decoration: underline;
}

/* Forms */
.form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--light-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 1px solid #555;
    background: #222;
    color: var(--light-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-group input::placeholder {
    color: #888;
}

.form .btn {
    width: 100%;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 1rem;
    margin-top: 1rem;
}

/* Info Box */
.info-box {
    background: #222;
    border-left: 5px solid var(--primary-color);
    padding: 1.5rem;
    margin-top: 2rem;
    max-width: 600px;
    margin: 2rem auto;
    border-radius: 8px;
}

.info-box p {
    margin: 0;
    color: var(--text-color);
    line-height: 1.6;
}

/* Download Page */
#download-launcher {
    text-align: center;
    padding: 4rem 0;
}

#download-launcher .btn-large {
    font-size: 1.5rem;
    padding: 1.5rem 3rem;
    margin-top: 2rem;
}

/* Success/Error Pages */
#success-section, #error-section {
    text-align: center;
    padding: 4rem 0;
}

.success-content, .error-content {
    max-width: 600px;
    margin: 0 auto;
    background: var(--gray-color);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.3);
}

.success-icon, .error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.success-details, .error-details {
    background: #222;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 2rem 0;
    text-align: left;
}

.success-actions, .error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.success-info, .error-info {
    margin-top: 2rem;
    padding: 1rem;
    background: #222;
    border-radius: 10px;
}

.success-info p, .error-info p {
    margin: 0.5rem 0;
    color: #ccc;
}

.status-success {
    color: #00ff5a;
    font-weight: bold;
}

.status-error {
    color: #ff4444;
    font-weight: bold;
}

/* Messages */
.message {
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 8px;
    font-weight: 500;
    border: 1px solid;
}

.message.success {
    background-color: rgba(39, 174, 96, 0.1);
    border-color: #27ae60;
    color: #27ae60;
}

.message.error {
    background-color: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
    color: #e74c3c;
}

.message.info {
    background-color: rgba(52, 152, 219, 0.1);
    border-color: #3498db;
    color: #3498db;
}

/* Profile Page Styles */
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.profile-card {
    background: var(--gray-color);
    border: 1px solid #333;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.3);
}

.profile-card h3 {
    color: #667eea;
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    font-size: 1.5rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 15px;
    background: #222;
    border-radius: 8px;
    transition: all 0.3s;
}

.stat-item:hover {
    background: #2a2a2a;
    transform: translateX(5px);
}

.stat-label {
    color: #ccc;
    font-weight: 500;
}

.stat-value {
    color: #667eea;
    font-weight: bold;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.no-data {
    color: #888;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.game-stats {
    grid-column: 1 / -1;
}

/* ===== АДАПТИВНОСТЬ ДЛЯ ВСЕХ УСТРОЙСТВ ===== */

/* Большие экраны (1200px и больше) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
        padding: 0 30px;
    }
    
    #hero h1 {
        font-size: 4rem;
    }
    
    #hero p {
        font-size: 1.5rem;
    }
    
    main h2 {
        font-size: 3rem;
    }
    
    .server-list {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 2.5rem;
    }
    
    .profile-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Планшеты (768px - 1199px) */
@media (max-width: 1199px) and (min-width: 768px) {
    .container {
        padding: 0 30px;
    }
    
    #hero h1 {
        font-size: 3rem;
    }
    
    #hero p {
        font-size: 1.2rem;
    }
    
    main h2 {
        font-size: 2.2rem;
    }
    
    .server-list {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .profile-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .profile-card {
        padding: 20px;
    }
}

/* Мобильные устройства (до 767px) */
@media (max-width: 767px) {
    .container {
        padding: 0 15px;
    }
    
    /* Header для мобильных */
    header .container {
        padding: 0.8rem 15px;
    }
    
    header .logo {
        font-size: 1.5rem;
    }
    
    /* Мобильное меню */
    .mobile-menu-toggle {
        display: flex;
    }
    
    header nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(26, 26, 26, 0.98);
        backdrop-filter: blur(10px);
        transition: left 0.3s ease;
        z-index: 999;
    }
    
    header nav.active {
        left: 0;
    }
    
    header nav ul {
        flex-direction: column;
        padding: 2rem 0;
        gap: 0;
    }
    
    header nav ul li {
        width: 100%;
        border-bottom: 1px solid #333;
    }
    
    header nav ul li a {
        display: block;
        padding: 1rem 2rem;
        font-size: 1.1rem;
        border-radius: 0;
    }
    
    /* Hero секция */
    #hero {
        min-height: 60vh;
        padding: 2rem 0;
    }
    
    #hero h1 {
        font-size: 2.2rem;
        margin-bottom: 0.8rem;
    }
    
    #hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* Основные секции */
    main section {
        padding: 2.5rem 0;
    }
    
    main h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    /* Серверы */
    .server-list {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 2rem;
    }
    
    .server-item {
        padding: 1.5rem;
    }
    
    .server-item h3 {
        font-size: 1.3rem;
    }
    
    /* Кнопки */
    .btn, .btn-large {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
    }
    
    #download-launcher .btn-large {
        font-size: 1.2rem;
        padding: 1rem 2rem;
    }
    
    /* Формы */
    .account-container {
        padding: 1rem;
    }
    
    .form-container {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .account-container h2 {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }
    
    .form-group input {
        padding: 0.8rem;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    /* Профиль */
    .profile-container {
        padding: 15px;
    }
    
    .profile-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .profile-card {
        padding: 20px;
    }
    
    .profile-card h3 {
        font-size: 1.3rem;
    }
    
    .stat-item {
        padding: 12px;
        flex-direction: column;
        gap: 5px;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    /* Страницы успеха/ошибки */
    .success-content, .error-content {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    
    .success-actions, .error-actions {
        flex-direction: column;
    }
    
    .success-actions .btn, .error-actions .btn {
        width: 100%;
    }
    
    /* Информационные блоки */
    .info-box {
        margin: 1.5rem 1rem;
        padding: 1rem;
    }
    
    /* Footer */
    footer {
        padding: 1.5rem 0;
        margin-top: 2rem;
    }
    
    footer p {
        font-size: 0.8rem;
    }
}

/* Очень маленькие экраны (до 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    header .container {
        padding: 0.6rem 10px;
    }
    
    header .logo {
        font-size: 1.3rem;
    }
    
    #hero h1 {
        font-size: 1.8rem;
    }
    
    #hero p {
        font-size: 0.9rem;
    }
    
    main h2 {
        font-size: 1.5rem;
    }
    
    .server-item {
        padding: 1rem;
    }
    
    .server-item h3 {
        font-size: 1.2rem;
    }
    
    .btn, .btn-large {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .form-container {
        padding: 1rem;
    }
    
    .account-container h2 {
        font-size: 1.4rem;
    }
    
    .profile-header {
        padding: 15px;
    }
    
    .profile-card {
        padding: 15px;
    }
    
    .stat-item {
        padding: 10px;
    }
    
    .success-content, .error-content {
        padding: 1.5rem 1rem;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-width: 767px) and (orientation: landscape) {
    #hero {
        min-height: 50vh;
    }
    
    #hero h1 {
        font-size: 1.8rem;
    }
    
    main section {
        padding: 2rem 0;
    }
    
    header nav {
        top: 60px;
        height: calc(100vh - 60px);
    }
}

/* Высокие экраны (высота больше 800px) */
@media (min-height: 800px) {
    #hero {
        min-height: 70vh;
    }
}

/* Печать */
@media print {
    header, footer, .btn, .mobile-menu-toggle {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    main {
        margin-top: 0 !important;
    }
    
    .container {
        max-width: none !important;
        padding: 0 !important;
    }
}

/* Поддержка темной темы системы */
@media (prefers-color-scheme: dark) {
    :root {
        --dark-color: #0a0a0a;
        --gray-color: #1a1a1a;
    }
}

/* Поддержка уменьшенного движения */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .server-item:hover {
        transform: none;
    }
    
    .btn:hover, .btn-large:hover {
        transform: none;
    }
    
    .stat-item:hover {
        transform: none;
    }
}