:root {
    --tg-theme-bg-color: #ffffff;
    --tg-theme-text-color: #000000;
    --tg-theme-hint-color: #999999;
    --tg-theme-link-color: #2481cc;
    --tg-theme-button-color: #2481cc;
    --tg-theme-button-text-color: #ffffff;
    --accent-color: #2481cc;
    --section-padding: 20px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    line-height: 1.6;
}

#app {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px;
}

header {
    text-align: center;
    padding: 30px 0;
}

.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: #eee;
    /* Локальное изображение: */
    background-image: url('static/avatar.jpg');
    /* Альтернатива - внешняя ссылка: 
    background-image: url('https://example.com/your-avatar-url.jpg'); */
    background-size: cover;
    background-position: center;
    border: 3px solid var(--tg-theme-button-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.title {
    color: var(--tg-theme-hint-color);
}

.section {
    margin-bottom: 40px;
    padding: var(--section-padding);
    border-radius: 12px;
    background-color: rgba(0, 0, 0, 0.03);
}

h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-align: center;
}

h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    text-align: center;
}

/* Form styles */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: var(--tg-theme-hint-color);
}

input, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(127, 127, 127, 0.3);
    border-radius: 8px;
    font-size: 16px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--tg-theme-text-color);
}

/* Повышаем контрастность для темной темы */
.dark-theme input, .dark-theme textarea {
    border-color: rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--tg-theme-button-color);
    box-shadow: 0 0 0 2px rgba(36, 129, 204, 0.2);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

/* Portfolio styles */
#portfolio {
    margin-top: 20px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.portfolio-item {
    border-radius: 8px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 20px;
}

.dark-theme .portfolio-item {
    background-color: rgba(255, 255, 255, 0.05);
}

.portfolio-image {
    height: 250px;
    min-height: 250px;
    background-color: #eee;
    /* Используем градиент вместо изображения по умолчанию */
    background-image: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 8px 8px 0 0;
}

/* FAQ styles */
.faq-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

footer {
    text-align: center;
    padding: 20px 0;
    color: var(--tg-theme-hint-color);
    font-size: 0.9rem;
}

/* Cookie modal styles */
.cookie-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--tg-theme-bg-color);
    border-top: 1px solid rgba(127, 127, 127, 0.3);
    padding: 20px;
    z-index: 1000;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.1);
}

.cookie-modal-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.cookie-modal-content p {
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--tg-theme-text-color);
}

.cookie-modal-content .btn {
    max-width: 200px;
}

/* Checkbox styles */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: var(--tg-theme-text-color);
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 3px;
    flex-shrink: 0;
    cursor: pointer;
}

.checkbox-label span {
    flex: 1;
}

.checkbox-label a {
    color: var(--tg-theme-link-color);
    text-decoration: underline;
}

.checkbox-label a:hover {
    opacity: 0.8;
}

/* Portfolio page styles */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--tg-theme-link-color);
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.description {
    font-size: 1.1rem;
    margin-bottom: 15px;
    text-align: center;
}

.description strong {
    color: var(--tg-theme-button-color);
}

.feature-block {
    margin-bottom: 25px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border-left: 3px solid var(--tg-theme-button-color);
}

.dark-theme .feature-block {
    background-color: rgba(255, 255, 255, 0.05);
}

.feature-block h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    text-align: left;
    color: var(--tg-theme-text-color);
}

.feature-block ul {
    margin-left: 20px;
    margin-top: 10px;
}

.feature-block ul ul {
    margin-top: 5px;
    margin-left: 20px;
}

.feature-block li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.tasks-list,
.achievements-list,
.results-list {
    list-style: none;
    padding-left: 0;
}

.tasks-list li,
.achievements-list li,
.results-list li {
    padding: 10px 15px;
    margin-bottom: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
    position: relative;
    padding-left: 40px;
}

.dark-theme .tasks-list li,
.dark-theme .achievements-list li,
.dark-theme .results-list li {
    background-color: rgba(255, 255, 255, 0.05);
}

.tasks-list li::before {
    content: "✓";
    position: absolute;
    left: 15px;
    color: var(--accent-color);
    font-weight: bold;
}

.highlight-block {
    margin-bottom: 20px;
    padding: 15px;
    background-color: rgba(36, 129, 204, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(36, 129, 204, 0.2);
}

.dark-theme .highlight-block {
    background-color: rgba(36, 129, 204, 0.15);
}

.highlight-block h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--tg-theme-button-color);
    text-align: left;
}

.highlight-block p {
    margin: 0;
    line-height: 1.6;
}

.highlight-block code {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--tg-theme-button-color);
}

.dark-theme .highlight-block code {
    background-color: rgba(255, 255, 255, 0.1);
}

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

.placeholder-text {
    margin-bottom: 20px;
    color: var(--tg-theme-hint-color);
    font-style: italic;
}

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.screenshot-item {
    border-radius: 8px;
    overflow: hidden;
}

.screenshot-placeholder {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    border-radius: 8px;
    margin-bottom: 10px;
}

.screenshot-caption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--tg-theme-hint-color);
    margin-top: 5px;
}

.screenshot-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 120px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Специальные стили для Telegram WebApp */
body.telegram-webapp .screenshot-image {
    max-height: 180px;
}

body.telegram-webapp .portfolio-image {
    height: 180px;
    min-height: 180px;
}

.screenshot-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Модальное окно для просмотра скриншотов */
.screenshot-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.screenshot-modal-content {
    margin: auto;
    display: block;
    width: 95%;
    max-width: 1200px;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    margin-top: 50px;
    animation: zoom 0.3s;
}

/* Адаптация модального окна для Telegram */
body.telegram-webapp .screenshot-modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    margin-top: 20px;
    padding: 0 10px;
}

@keyframes zoom {
    from {transform: scale(0)}
    to {transform: scale(1)}
}

.screenshot-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
}

.screenshot-modal-close:hover {
    color: #bbb;
}

/* Portfolio item hover effect */
.portfolio-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.portfolio-item h3 {
    margin-top: 15px;
    margin-bottom: 8px;
    font-size: 1.1rem;
    padding: 0 15px;
}

.portfolio-item p {
    font-size: 0.9rem;
    color: var(--tg-theme-hint-color);
    margin: 0;
    padding: 0 15px 15px;
    line-height: 1.5;
}

/* Медиа-запросы для мобильных устройств */
@media (max-width: 768px) {
    :root {
        --section-padding: 15px;
    }

    #app {
        padding: 0 12px;
    }

    header {
        padding: 20px 0;
    }

    .avatar {
        width: 100px;
        height: 100px;
        border-width: 2px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    h3 {
        font-size: 1.1rem;
    }

    .section {
        margin-bottom: 25px;
        padding: var(--section-padding);
    }

    .description {
        font-size: 1rem;
    }

    .feature-block {
        padding: 12px;
        margin-bottom: 15px;
    }

    .feature-block h4 {
        font-size: 1rem;
    }

    .feature-block ul {
        margin-left: 15px;
        font-size: 0.9rem;
    }

    .highlight-block {
        padding: 12px;
        margin-bottom: 15px;
    }

    .highlight-block h4 {
        font-size: 1rem;
    }

    .screenshot-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .screenshot-image {
        min-height: 100px;
        max-height: 180px;
    }
    
    body.telegram-webapp .screenshot-image {
        max-height: 150px;
    }

    .screenshot-modal-content {
        width: 100%;
        margin-top: 20px;
        padding: 0 10px;
    }

    .screenshot-modal-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .portfolio-image {
        height: 180px;
        min-height: 180px;
    }
    
    body.telegram-webapp .portfolio-image {
        height: 150px;
        min-height: 150px;
    }

    .tasks-list li,
    .achievements-list li,
    .results-list li {
        padding: 8px 12px;
        padding-left: 35px;
        font-size: 0.9rem;
    }

    .cookie-modal {
        padding: 15px;
    }

    .cookie-modal-content p {
        font-size: 13px;
    }

    .policy-container {
        padding: 15px;
    }

    .policy-container h1 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .policy-container h2 {
        font-size: 1.2rem;
        margin-top: 20px;
    }

    input, textarea {
        font-size: 16px; /* Предотвращает зум на iOS */
    }
}

@media (max-width: 480px) {
    :root {
        --section-padding: 12px;
    }

    #app {
        padding: 0 10px;
    }

    header {
        padding: 15px 0;
    }

    .avatar {
        width: 80px;
        height: 80px;
    }

    h1 {
        font-size: 1.3rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    h3 {
        font-size: 1rem;
    }

    .section {
        padding: var(--section-padding);
        margin-bottom: 20px;
    }

    .screenshot-image {
        min-height: 80px;
        max-height: 150px;
    }
    
    body.telegram-webapp .screenshot-image {
        max-height: 120px;
    }

    .screenshot-modal-content {
        margin-top: 10px;
        padding: 0 5px;
    }

    .screenshot-modal-close {
        top: 5px;
        right: 10px;
        font-size: 25px;
    }
} 