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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #1a1a2e;
    min-height: 100vh;
    min-width: 300px;
    color: white;
    padding: 20px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    line-height: 1.6;
    height: 100%;
}

.container {
    max-width: 400px;
    min-width: 300px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 10px;
    width: 100%;
    justify-content: space-between;
}

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

.header {
    text-align: left;
    margin-bottom: 15px;
}

.header-subtitle {
    font-size: 14px;
    color: #a0a0a0;
    margin-bottom: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header-title {
    font-size: clamp(20px, 6vw, 28px);
    font-weight: 600;
    color: white;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* justify-content: center; */
}

.vacancies-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 15px;
    margin-bottom: 20px;
}

.vacancy-card:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
}

.vacancy-card:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
}

.vacancy-card:nth-child(5) {
    grid-column: 1;
    grid-row: 3;
}

.vacancy-card:nth-child(6) {
    grid-column: 2;
    grid-row: 3;
}

.vacancy-card:nth-child(7) {
    grid-column: 1;
    grid-row: 4;
}

.vacancy-card:nth-child(8) {
    grid-column: 2;
    grid-row: 4;
}

.vacancy-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    min-width: 150px;
    /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); */
}

.vacancy-image {
    width: 100%;
    height: clamp(200px, 25vw, 200px);
    object-fit: cover;
    background: linear-gradient(45deg, #2a2a2a, #3a3a3a);
}

.vacancy-title {
    /* padding: 12px 16px; */
    padding: 0.3rem;
    font-size: clamp(16px, 4vw, 20px);
    font-weight: 600;
    text-align: center;
    color: white;
    /* background: rgba(0, 0, 0, 0.4); */
    letter-spacing: 0.5px;
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    position: sticky;
    bottom: 0;
    /* background: #1a1a2e;
    box-shadow: 0 -10px 10px rgba(26, 26, 46, 1);
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px; */
}

.nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.nav-button.back {
    width: 50px;
    height: 50px;
    background: #6a6a6a;
    color: #ffffff;
    border: 1px solid #888888;
}

.nav-button.back:hover {
    background: #7a7a7a;
    transform: scale(1.05);
    color: #ffffff;
}

.nav-button.next {
    flex: 1;
    margin-left: 20px;
    height: 50px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 50%, #CD853F 100%);
    color: white;
    position: relative;
    overflow: hidden;
    animation: pulse 2s infinite;
}

.nav-button.next::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.nav-button.next:hover {
    background: linear-gradient(135deg, #A0522D 0%, #CD853F 50%, #DAA520 100%);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(139, 69, 19, 0.5);
    animation: none;
}

.nav-button.next:disabled {
    background: #4a4a4a;
    cursor: not-allowed;
    animation: none;
    transform: none;
    box-shadow: none;
}

.nav-button.next:disabled::before {
    animation: none;
    display: none;
}

.nav-button.next:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.5);
}

.nav-button.next:active::before {
    left: 100%;
    transition: left 0.3s;
}

/* Адаптивность для очень маленьких экранов */
@media (max-width: 360px) {
    body {
        padding: 15px;
    }
    
    .container {
        min-width: 280px;
        padding: 8px;
    }
    
    .header-title {
        font-size: 20px;
    }
    
    .vacancy-image {
        height: 160px;
    }
    
    .vacancy-title {
        font-size: 15px;
        padding: 0.3rem;
    }
    
    .vacancies-grid {
        gap: 8px;
    }
}

/* Для экранов меньше 320px */
@media (max-width: 320px) {
    .container {
        min-width: 300px;
        padding: 5px;
    }
    
    .vacancy-card {
        min-width: 140px;
    }
    
    .vacancy-image {
        height: 140px;
    }
}

/* Для средних экранов */
@media (min-width: 480px) and (max-width: 767px) {
    .container {
        max-width: 450px;
        padding: 15px;
    }
    
    .vacancy-image {
        height: 200px;
    }
    
    .vacancies-grid {
        gap: 20px;
    }
}

/* Для экранов больше мобильных */
@media (min-width: 768px) {
    .container {
        max-width: 500px;
    }
    
    .vacancies-grid {
        gap: 20px;
    }
}

img {
    height: auto;
    max-width: 100%;
}

/* Стили для деталей вакансии */
.vacancy-details {
    display: none;
    width: 100%;
    /* max-width: 800px; */
    /* margin: 0 auto; */
    /* padding: 20px; */
}

.vacancy-details.active {
    display: block;
}

.vacancy-details-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 20px;
}

.vacancy-details-image-small {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.vacancy-details-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.vacancy-details-title {
    color: #fff;
    font-size: 2rem;
    margin: 0 0 8px 0;
    line-height: 1.2;
    word-break: auto-phrase;
}

.vacancy-details-info {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.vacancy-salary {
    font-size: 1.2rem;
    font-weight: bold;
    color: #8B4513;
    margin: 0;
    line-height: 1.3;
}

.vacancy-salary::before {
    content: "Зарплата: ";
    font-weight: normal;
    color: #fff;
}

.vacancy-description {
    color: #fff;
    line-height: 1.8;
    font-size: 1.1rem;
    text-align: left;
}

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

/* Анимация навигации */
.navigation {
    transition: transform 0.3s ease-in-out;
}

.navigation.hidden {
    transform: translateY(100%);
}

.navigation.visible {
    transform: translateY(0);
}

/* Состояние загрузки */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #8B4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #a0a0a0;
    font-size: 16px;
    font-weight: 500;
}

/* Стили для шага контакта */
.contact-step {
    display: none;
    width: 100%;
    text-align: center;
    /* padding: 20px; */
}

.contact-step.active {
    display: block;
    animation: fadeInUp 0.6s ease-out;
}

.contact-header {
    margin-bottom: 50px;
    position: relative;
}

.contact-title {
    color: #fff;
    font-size: 3rem;
    margin: 0 0 15px 0;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    background: #ffffff;
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    line-height: normal;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.contact-subtitle {
    color: #d0d0d0;
    font-size: 1.3rem;
    margin: 0;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.manager-card {
    /* background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05)); */
    /* border-radius: 25px; */
    padding: 25px 20px;
    /* margin-bottom: 50px; */
    /* display: inline-block; */
    min-width: 300px;
    /* backdrop-filter: blur(10px); */
    /* border: 1px solid rgba(255, 255, 255, 0.2); */
    /* box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2); */
}

.manager-photo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 5px solid #ffffff47;
    box-shadow: 0 10px 30px rgb(255 255 255 / 10%);
    transition: transform 0.3s ease;
}

/* .manager-photo:hover {
    transform: scale(1.05);
} */

.manager-name {
    color: #fff;
    font-size: 2.2rem;
    /* margin: 0 0 15px 0; */
    font-weight: 300;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.manager-position {
    color: #b8b8b8;
    font-size: 1.2rem;
    margin: 0;
    font-weight: 400;
}

.contact-buttons {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    /* margin-top: 20px; */
}

.contact-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 40px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    min-width: 200px;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

.contact-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.whatsapp-btn {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.whatsapp-btn:hover {
    background: linear-gradient(135deg, #1ea952, #0f6b5f);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(37, 211, 102, 0.5);
    animation: none;
}

.telegram-btn {
    background: linear-gradient(135deg, #0088cc, #005580);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.telegram-btn:hover {
    background: linear-gradient(135deg, #006699, #003d5c);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 136, 204, 0.5);
    animation: none;
}

/* Адаптивность для деталей вакансии и контактов */
@media (max-width: 768px) {
    .vacancy-details-header {
        gap: 15px;
    }
    
    .vacancy-details-image-small {
        width: 60px;
        height: 60px;
    }
    
    .vacancy-details-title {
        font-size: 1.5rem;
    }
    
    .vacancy-salary {
        font-size: 1rem;
    }
    
    .vacancy-details-info {
        padding: 20px;
    }
    
    .vacancy-description {
        font-size: 1rem;
    }

    .contact-title {
        font-size: 2.2rem;
    }

    .contact-subtitle {
        font-size: 1.1rem;
    }

    .manager-card {
        padding: 15px 25px;
        min-width: 300px;
    }

    .manager-photo {
        width: 140px;
        height: 140px;
    }

    .manager-name {
        font-size: 1.8rem;
    }

    .contact-buttons {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .contact-btn {
        width: 100%;
        max-width: 280px;
        padding: 18px 35px;
        font-size: 1.1rem;
    }
}
