/* ===== БАЗОВЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    animation: fadeIn 0.5s ease-in;
}

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

/* ===== HEADER ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    color: #667eea;
    font-size: 2em;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===== ГЛАВНАЯ СТРАНИЦА ===== */
.hero-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hero-content {
    max-width: 1200px;
    width: 100%;
}

.hero-header {
    text-align: center;
    margin-bottom: 50px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo-icon {
    font-size: 3.5em;
}

.logo h1 {
    font-size: 3.5em;
    color: #667eea; /* Золотой цвет */
    font-weight: 800;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
}

.hero-subtitle {
    font-size: 1.3em;
    color: #667eea; /* Светло-серый */
    margin-top: 10px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5);
    font-weight: 600;
}

.hero-subtitle a {
    color: #667eea; /* Золотой для ссылки */
    text-decoration: none;
    font-weight: 600;
}

.hero-subtitle a:hover {
    text-decoration: underline;
}

/* ===== FEATURES GRID ===== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 50px;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.feature-card h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.feature-detail {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9em;
    color: #888;
}

/* ===== LOGIN BOX ===== */
.login-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 50px;
}

.login-box h2 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2em;
}

.login-description {
    color: #666;
    margin-bottom: 25px;
    font-size: 1.1em;
}

.login-hint {
    margin-top: 20px;
    color: #888;
    font-size: 0.9em;
}

#telegram-login-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

/* ===== HOW IT WORKS ===== */
.how-it-works {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 50px;
}

.how-it-works h2 {
    text-align: center;
    color: #667eea;
    margin-bottom: 40px;
    font-size: 2em;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.step {
    text-align: center;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: bold;
    margin: 0 auto 20px;
}

.step h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.step p {
    color: #666;
    line-height: 1.6;
    font-size: 0.95em;
}

/* ===== STATS SECTION ===== */
.hero-content .stats-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 50px;
}

/* Stats в дашборде */
.stats-card .stats-section {
    display: block;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.stat-label {
    color: #666;
    font-size: 1em;
}

/* ===== FOOTER ===== */
.hero-footer {
    text-align: center;
    color: white;
    padding: 20px;
    font-size: 0.9em;
}

/* ===== TABS ===== */
.user-tabs,
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    padding: 12px 24px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn:hover {
    background: #f5f5f5;
    border-color: #667eea;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    margin-bottom: 25px;
}

.card h2,
.card h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.card-header h2 {
    margin-bottom: 0;
}

/* ===== PROFILE CARD ===== */
.profile-info p {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 200px 1fr;
    align-items: center;
    gap: 20px;
}

.profile-info strong {
    color: #667eea;
    font-weight: 600;
    text-align: left;
}

.profile-info p > span:last-child {
    text-align: right;
    font-weight: 600;
    color: #333;
}

.rating {
    font-size: 1.2em;
}

/* ===== ACTIONS CARD ===== */
.action-section {
    margin-bottom: 30px;
}

.action-section:last-child {
    margin-bottom: 0;
}

.action-section h3 {
    margin-bottom: 15px;
    color: #333;
}

/* ===== SETTINGS CARD ===== */
.setting-section {
    margin-bottom: 25px;
}

.setting-section:last-child {
    margin-bottom: 0;
}

.setting-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1em;
}

/* ===== STATS CARD ===== */
.stats-card .stats-section {
    margin-bottom: 25px;
    background: transparent;
    padding: 0;
    box-shadow: none;
    display: block;
}

.stats-card .stats-section:last-child {
    margin-bottom: 0;
}

.stats-card .stats-section h3 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 1.2em;
}

.stats-card .stats-section p {
    padding: 8px 0;
    color: #666;
}

.stats-card .stats-section strong {
    color: #333;
    font-weight: 600;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.btn-admin {
    background: #ff6b6b;
    color: white;
}

.btn-admin:hover:not(:disabled) {
    background: #ff5252;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85em;
}

/* ===== INPUTS ===== */
.input,
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95em;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group .input {
    flex: 1;
}

/* ===== TABLES (DESKTOP) ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.table th {
    font-weight: 600;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table a {
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
}

.table a:hover {
    text-decoration: underline;
}

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

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #333;
}

.pagination button:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    padding: 8px 16px;
    color: #666;
    font-size: 0.9em;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-in;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
}

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

.modal-content h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.modal-actions .btn {
    flex: 1;
    min-width: 120px;
}

/* ===== ALERTS ===== */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    animation: slideInRight 0.3s ease-out;
    max-width: 400px;
    word-wrap: break-word;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background: #28a745;
    color: white;
}

.alert-error {
    background: #dc3545;
    color: white;
}

.alert-info {
    background: #17a2b8;
    color: white;
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
        border-radius: 12px;
    }

    /* Header */
    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header h1 {
        font-size: 1.5em;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
        text-align: center;
    }

    /* Hero */
    .hero-wrapper {
        padding: 10px;
    }

    .hero-content {
        max-width: 100%;
    }

    .logo-icon {
        font-size: 2.5em;
    }

    .logo h1 {
        font-size: 2.5em;
    }

    .hero-subtitle {
        font-size: 1.1em;
    }

    /* Features Grid */
    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .feature-card {
        padding: 20px;
    }

    /* Steps Grid */
    .steps-grid {
        grid-template-columns: 1fr !important;
        gap: 25px;
    }

    /* Stats Section на главной */
    .hero-content .stats-section {
        grid-template-columns: 1fr !important;
        gap: 20px;
        padding: 25px !important;
    }

    .stat-number {
        font-size: 2em;
    }

    /* Login Box */
    .login-box {
        padding: 25px;
    }

    .login-box h2 {
        font-size: 1.5em;
    }

    /* How It Works */
    .how-it-works {
        padding: 25px;
    }

    .how-it-works h2 {
        font-size: 1.5em;
    }

    /* Tabs */
    .user-tabs,
    .admin-tabs {
        gap: 5px;
        padding-bottom: 5px;
    }

    .tab-btn {
        padding: 10px 16px;
        font-size: 0.85em;
    }

    /* Cards */
    .card {
        padding: 20px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-header > div {
        width: 100%;
    }

    .card-header select {
        width: 100%;
    }

    /* Profile Info - мобильная адаптация */
    .profile-info p {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .profile-info strong {
        text-align: left;
    }

    .profile-info p > span:last-child {
        text-align: left;
    }

    /* Tables - стековый вид для мобильных */
    .table {
        display: block;
        overflow-x: visible;
    }

    .table thead {
        display: none;
    }

    .table tbody {
        display: block;
    }

    .table tr {
        display: block;
        margin-bottom: 20px;
        border: 2px solid #e0e0e0;
        border-radius: 8px;
        padding: 15px;
        background: white;
    }

    .table td {
        display: block;
        text-align: right;
        padding: 10px 0;
        border: none;
        position: relative;
        padding-left: 50%;
    }

    .table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-right: 10px;
        font-weight: 600;
        color: #667eea;
        text-align: left;
    }

    .table td:last-child {
        text-align: center;
        padding-left: 0;
        padding-top: 15px;
        border-top: 1px solid #e0e0e0;
        margin-top: 10px;
    }

    .table td:last-child::before {
        display: none;
    }

    /* Buttons в таблицах */
    .table .btn {
        display: block;
        width: 100%;
        margin-bottom: 5px;
    }

    /* Input Groups */
    .input-group {
        flex-direction: column;
    }

    .input-group .btn {
        width: 100%;
    }

    /* Modal */
    .modal {
        padding: 10px;
    }

    .modal-content {
        margin: 20px auto;
        padding: 20px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
    }

    /* Alerts */
    .alert {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }

    /* Pagination */
    .pagination {
        font-size: 0.85em;
    }

    .pagination button {
        padding: 6px 12px;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
        order: -1;
        margin-bottom: 10px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .logo-icon {
        font-size: 2em;
    }

    .logo h1 {
        font-size: 2em;
    }

    .hero-subtitle {
        font-size: 1em;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 0.8em;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.9em;
    }

    .stat-number {
        font-size: 1.8em;
    }
}