/* Base Styles */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    font-size: 14px;
    line-height: 1.5;
}

body:has(.login-only-container) {
    background-color: transparent !important;
}



/* Уменьшенные размеры заголовков */
h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.9rem; }
h6 { font-size: 0.85rem; }

/* Header Styles */
header {
    background-color: #000000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100000;
    height: 72px;
    display: flex;
    align-items: center;
}

.header-content {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    position: absolute;
    left: 0;
    top: 0;
    width: 280px;
    height: 72px;
    padding-left: 20px;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.site-title a {
    text-decoration: none;
    display: block;
}

.header-logo-container {
    position: absolute;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo-container a {
    text-decoration: none;
    display: block;
}

.header-logo {
    height: 50px;
    width: auto;
    display: block;
}

.mobile-menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: none;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.mobile-menu-btn i {
    transition: transform 0.3s ease;
}

.mobile-menu-btn.active i {
    transform: rotate(90deg);
}

.site-name {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.auth-buttons {
    position: absolute;
    right: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.login-btn, .logout-btn, .admin-link {
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.login-btn {
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
}

.login-btn:hover {
    background-color: #0056b3;
}

.logout-btn {
    background-color: transparent;
    color: white;
    border: 1px solid white;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.admin-link {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.admin-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.admin-link:hover::before {
    left: 100%;
}

.admin-link:hover {
    background: linear-gradient(135deg, #495057, #343a40);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.admin-link:before {
    content: '\f0c9';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 8px;
}

.user-info {
    color: #ffffff;
    font-size: 0.9rem;
    margin-right: 1rem;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.user-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.user-info:hover::before {
    left: 100%;
}

.user-info:hover {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    text-decoration: none;
}

/* Layout Styles */
.layout {
    display: flex;
    margin-top: 72px;
    min-height: calc(100vh - 72px);
    position: relative;
}

/* Стили для основного контента */
main {
    flex: 1;
    margin-left: 280px;
    padding: 1rem;
    background-color: #ffffff;
    min-height: calc(100vh - 72px);
    overflow-y: auto;
}



/* Стили для страницы входа неавторизованных пользователей */
body:has(.login-only-container),
html:has(.login-only-container) {
    background: transparent !important;
    background-color: transparent !important;
}

.login-only-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    background: transparent;
}

.login-background {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    background-image: url('/static/img/loginPage.png');
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    position: relative;
    overflow: hidden;
    background-color: #000000;
}

.login-background::before {
    display: none;
}

.login-arms-text {
    position: absolute;
    top: 80%;
    left: 55%;
    transform: translateX(-50%);
    font-size: 5.175rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Playfair Display', 'Times New Roman', Times, serif;
    letter-spacing: 0.2em;
    z-index: 5;
    text-shadow: 
        0 0 8px rgba(255, 255, 255, 0.4),
        0 0 15px rgba(255, 255, 255, 0.3),
        0 0 25px rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    white-space: nowrap;
    font-style: normal;
    opacity: 0.95;
    animation: pulse-glow 3s ease-in-out infinite;
    position: relative;
    text-align: center;
    width: 100%;
}

.login-arms-text::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 150%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    border-radius: 50%;
    filter: blur(30px);
    z-index: -1;
    animation: expand-pulse 4s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        text-shadow: 
            0 0 8px rgba(255, 255, 255, 0.4),
            0 0 15px rgba(255, 255, 255, 0.3),
            0 0 25px rgba(255, 255, 255, 0.2);
        opacity: 0.9;
    }
    50% {
        text-shadow: 
            0 0 10px rgba(255, 255, 255, 0.5),
            0 0 20px rgba(255, 255, 255, 0.4),
            0 0 30px rgba(255, 255, 255, 0.3);
        opacity: 0.95;
    }
}

@keyframes expand-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.5;
    }
}

.login-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #343a40;
    z-index: 10;
    width: 90%;
    max-width: 500px;
}

.company-logo img {
    height: 80px;
    width: auto;
    margin: 0 auto 2rem auto;
    display: block;
    background-color: #000000;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    filter: invert(1);
}

.company-logo h1 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: #212529;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.company-logo p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
    color: #6c757d;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

.login-main-button {
    background: linear-gradient(145deg, #5c6874, #5f748a);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(135, 146, 158, 0.2);
    text-decoration: none;
    display: inline-block;
}

.login-main-button:hover {
    background: linear-gradient(145deg, #0056b3, #007bff);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    color: white;
    text-decoration: none;
}

/* Адаптивность для страницы входа */
@media (max-width: 768px) {
    .login-background {
        background-size: contain;
        background-position: center center;
    }
    
    .login-arms-text {
        top: 80%;
        left: 50%;
        transform: translateX(-50%);
        font-size: 3.45rem;
        letter-spacing: 0.15em;
        font-weight: 600;
        width: 100%;
        text-align: center;
    }
    
    .company-logo img {
        height: 60px;
        margin: 0 auto 1.5rem auto;
        padding: 1.2rem;
        border-radius: 10px;
    }
    
    .company-logo h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .company-logo p {
        font-size: 0.9rem;
        margin-bottom: 1.2rem;
        padding: 0 1rem;
    }
    
    .login-main-button {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .login-overlay {
        width: 95%;
        max-width: 400px;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .login-main-button {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .login-background {
        background-size: contain;
        background-position: center center;
    }
    
    .login-arms-text {
        top: 70%;
        left: 50%;
        transform: translateX(-50%);
        font-size: 2.53rem;
        letter-spacing: 0.1em;
        font-weight: 600;
        padding: 0 1rem;
        width: 100%;
        text-align: center;
    }
    
    .company-logo img {
        height: 45px;
        margin: 0 auto 1rem auto;
        padding: 1rem;
        border-radius: 8px;
    }
    
    .company-logo h1 {
        font-size: 1.3rem;
        margin-bottom: 0.4rem;
    }
    
    .company-logo p {
        font-size: 0.8rem;
        margin-bottom: 1rem;
        padding: 0 1.5rem;
    }
    
    .login-main-button {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .login-overlay {
        width: 95%;
        max-width: 350px;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .login-main-button {
        width: 100%;
        max-width: 280px;
    }
}

/* Modal styles moved to modals.css to avoid conflicts with Bootstrap modals */

/* Responsive Styles */
@media (max-width: 768px) {
    body {
        font-size: 12px;
        line-height: 1.4;
    }
    
    h1 { font-size: 1.26rem; }
    h2 { font-size: 0.98rem; }
    h3 { font-size: 0.84rem; }
    h4 { font-size: 0.7rem; }
    h5 { font-size: 0.63rem; }
    h6 { font-size: 0.6rem; }

    header {
        height: 50px;
    }
    
    .mobile-menu-btn {
        display: block;
        font-size: 1.8rem;
        padding: 0.6rem;
        margin-right: 0.5rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .header-content {
        padding: 0 1rem;
    }

    .header-logo-container {
        left: 0.5rem;
        gap: 0.5rem;
    }
    
    .header-logo {
        height: 35px;
    }

    .site-title {
        width: auto;
        height: 50px;
        padding-left: 0;
        left: 0;
    }

    .auth-buttons {
        right: 0.5rem;
        gap: 0.5rem;
    }

    main {
        margin-left: 0;
        margin-top: 50px;
        padding: 1rem;
        min-height: calc(100vh - 50px);
    }
    
    .user-info {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
        margin-right: 0.5rem;
    }
    
    .login-btn, .logout-btn, .admin-link {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    /* Modal box styles moved to modals.css */
    
    .action-button {
        width: 60px;
        height: 60px;
        font-size: 0.8rem;
    }
    
    .action-button img {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 11px;
        line-height: 1.3;
    }
    
    h1 { font-size: 1.05rem; }
    h2 { font-size: 0.84rem; }
    h3 { font-size: 0.7rem; }
    h4 { font-size: 0.63rem; }
    h5 { font-size: 0.56rem; }
    h6 { font-size: 0.49rem; }

    header {
        height: 45px;
    }
    
    .header-content {
        padding: 0 0.5rem;
    }
    
    .header-logo-container {
        left: 0.25rem;
    }
    
    .header-logo {
        height: 30px;
    }
    
    .auth-buttons {
        right: 0.25rem;
        gap: 0.25rem;
    }
    
    main {
        margin-top: 45px;
        padding: 0.5rem;
        min-height: calc(100vh - 45px);
    }
    
    .user-info {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        margin-right: 0.25rem;
    }
    
    .login-btn, .logout-btn, .admin-link {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }
    

    


    /* Modal box styles moved to modals.css */
    
    .action-button {
        width: 50px;
        height: 50px;
        font-size: 0.7rem;
    }
    
    .action-button img {
        width: 20px;
        height: 20px;
    }
}

.brand-title-framed {
    display: inline-block;
    padding: 0.4em 1.2em;
    border: 2.5px solid #6c757d;
    border-radius: 10px;
    background: linear-gradient(90deg, #23272b 60%, #495057 100%);
    color: #e0e0e0;
    font-weight: 700;
    font-size: 1.35em;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 12px rgba(60,60,60,0.10);
    margin-bottom: 0.7em;
    text-shadow: 0 1px 2px #222a, 0 0px 1px #fff2;
}

.action-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    background: linear-gradient(145deg, #2c3e50, #34495e);
    color: white;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: linear-gradient(145deg, #34495e, #2c3e50);
}

.action-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-button img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

.action-button.add-brand {
    background: linear-gradient(145deg, #27ae60, #2ecc71);
}

.action-button.add-brand:hover {
    background: linear-gradient(145deg, #2ecc71, #27ae60);
}

.action-button.add-material {
    background: linear-gradient(145deg, #2980b9, #3498db);
}

.action-button.add-material:hover {
    background: linear-gradient(145deg, #3498db, #2980b9);
}

/* Modal actions styles moved to modals.css */

/* Styles from base.html */
.submenu-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

.submenu-item:hover {
    background-color: #f5f5f5;
}

.brand-name {
    flex: 1;
    margin-left: 8px;
    color: #000;
}

.material-count {
    color: #000;
    font-size: 0.85em;
    background-color: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

/* Общие медиа-запросы для всех карточек и контейнеров */
@media (max-width: 576px) {
    /* Bootstrap row и column адаптация */
    .row > [class*="col-"] {
        margin-bottom: 1rem;
    }
    
    /* Общие стили для всех карточек */
    .card, .material-card, .order-card, .test-card {
        margin-bottom: 1rem;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Контейнеры с grid */
    .row.row-cols-1.row-cols-md-2.row-cols-lg-3.g-4,
    .row.row-cols-1.row-cols-md-2.row-cols-xl-3.g-4,
    .row.row-cols-1.row-cols-sm-2.row-cols-md-3.g-4 {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }
    
    /* Принуждение 1 колонки для всех grid контейнеров */
    .row.row-cols-md-2 > .col,
    .row.row-cols-lg-3 > .col,
    .row.row-cols-xl-3 > .col,
    .row.row-cols-sm-2 > .col,
    .row.row-cols-md-3 > .col {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* Отступы для контейнеров */
    .container, .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Кнопки */
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
        white-space: nowrap;
    }
    
    .btn-group-vertical .btn {
        margin-bottom: 0.5rem;
    }
    
    /* Заголовки */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    
    /* Отступы */
    .mb-4 { margin-bottom: 1.5rem !important; }
    .mb-3 { margin-bottom: 1rem !important; }
    .mt-4 { margin-top: 1.5rem !important; }
    .mt-3 { margin-top: 1rem !important; }
}

@media (max-width: 480px) {
    /* Еще более компактные стили для очень маленьких экранов */
    .container, .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .card, .material-card, .order-card, .test-card {
        margin-bottom: 0.75rem;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
        white-space: nowrap;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.35rem; }
    h3 { font-size: 1.15rem; }
    h4 { font-size: 1rem; }
    h5 { font-size: 0.95rem; }
    
    .mb-4 { margin-bottom: 1rem !important; }
    .mb-3 { margin-bottom: 0.75rem !important; }
    .mt-4 { margin-top: 1rem !important; }
    .mt-3 { margin-top: 0.75rem !important; }
}

/* Общие стили для изображений из CKEditor */
.ck-content img,
.ckeditor-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 15px auto;
    display: block;
    object-fit: contain !important;
}

/* Убираем принудительные размеры у изображений, КРОМЕ фотографий руководителей отделов */
img[style*="width"]:not(.department-head-node img),
img[style*="height"]:not(.department-head-node img) {
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}

/* Исключение для фотографий руководителей отделов */
.department-head-node img[style*="width"],
.department-head-node img[style*="height"] {
    max-width: none !important;
    width: auto !important;
    height: auto !important;
    object-fit: cover !important;
}

/* Плавающие кнопки */
/* Кнопка нотатника */
.notes-floating-btn {
    position: fixed;
    left: 20px;
    bottom: 90px; /* Выше кнопки инструкции */
    z-index: 999;
    animation: notesFadeIn 1s ease-out 0.2s both;
}

.notes-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #6f42c1, #e83e8c);
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 6px 20px rgba(111, 66, 193, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 14px;
    position: relative;
    overflow: hidden;
    width: 250px;
    height: 48px;
    justify-content: center;
    white-space: nowrap;
}

.notes-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);
    transition: left 0.6s ease;
}

.notes-btn:hover {
    background: linear-gradient(135deg, #5a32a3, #c73777);
    color: white;
    text-decoration: none;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(111, 66, 193, 0.6);
}

.notes-btn:hover::before {
    left: 100%;
}

.notes-btn i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.notes-btn:hover i {
    transform: scale(1.2);
}

.notes-text {
    font-weight: 600;
    letter-spacing: 0.5px;
}

@keyframes notesFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    60% {
        opacity: 1;
        transform: translateY(-5px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Кнопка инструкции */
.instruction-floating-btn {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 999;
    animation: instructionFadeIn 1s ease-out;
}

.instruction-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 14px;
    position: relative;
    overflow: hidden;
    width: 250px;
    height: 48px;
    justify-content: center;
    white-space: nowrap;
}

.instruction-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);
    transition: left 0.6s ease;
}

.instruction-btn:hover {
    background: linear-gradient(135deg, #218838, #1e7e6a);
    color: white;
    text-decoration: none;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(40, 167, 69, 0.6);
}

.instruction-btn:hover::before {
    left: 100%;
}

.instruction-btn i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.instruction-btn:hover i {
    transform: scale(1.2);
}

.instruction-text {
    font-weight: 600;
    letter-spacing: 0.5px;
}

@keyframes instructionFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    60% {
        opacity: 1;
        transform: translateY(-5px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Пульсирующий эффект привлечения внимания */
.instruction-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(40, 167, 69, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: instructionPulse 3s infinite;
    z-index: -1;
}

@keyframes instructionPulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
    .notes-floating-btn {
        left: 15px;
        bottom: 85px;
    }
    
    .notes-btn {
        padding: 10px 16px;
        font-size: 13px;
        width: 220px;
        height: 44px;
        gap: 8px;
        white-space: nowrap;
    }
    
    .notes-btn i {
        font-size: 14px;
    }
    
    .notes-text {
        font-size: 12px;
    }
    
    .instruction-floating-btn {
        left: 15px;
        bottom: 15px;
    }
    
    .instruction-btn {
        padding: 10px 16px;
        font-size: 13px;
        width: 220px;
        height: 44px;
        gap: 8px;
        white-space: nowrap;
    }
    
    .instruction-btn i {
        font-size: 14px;
    }
    
    .instruction-text {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .notes-floating-btn {
        left: 10px;
        bottom: 75px;
    }
    
    .notes-btn {
        padding: 8px 12px;
        font-size: 12px;
        width: 80px;
        height: 40px;
        gap: 6px;
        white-space: nowrap;
    }
    
    .notes-btn i {
        font-size: 12px;
    }
    
    .notes-text {
        display: none; /* Скрываем текст на очень маленьких экранах */
    }
    
    .instruction-floating-btn {
        left: 10px;
        bottom: 10px;
    }
    
    .instruction-btn {
        padding: 8px 12px;
        font-size: 12px;
        width: 80px;
        height: 40px;
        gap: 6px;
        white-space: nowrap;
    }
    
    .instruction-btn i {
        font-size: 12px;
    }
    
    .instruction-text {
        display: none; /* Скрываем текст на очень маленьких экранах */
    }
}

/* Уменьшение масштаба для десктопа на 30% */
@media (min-width: 769px) {
    body {
        zoom: 0.7; /* Уменьшаем масштаб на 30% */
    }
}