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

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    background-color: #f4f7fa;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

h1, h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: 700;
    background: linear-gradient(90deg, #007bff, #00a8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, text-shadow 0.3s ease;
}

h1:hover, h2:hover {
    transform: scale(1.05);
    text-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

h1 {
    font-size: 32px;
    padding: 10px 0;
}

h2 {
    font-size: 24px;
    padding: 8px 0;
}

.header-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.search-guide {
    background: #ffffff;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    font-size: 13px;
    color: #555;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.search-guide h3 {
    font-size: 15px;
    margin-bottom: 8px;
    color: #2c3e50;
}

.search-guide ul {
    margin: 0 0 10px 15px;
    list-style-type: disc;
}

.search-guide li {
    margin-bottom: 6px;
}

.search-guide p {
    margin: 0;
    line-height: 1.4;
}

.search-form, .login-form, .add-form, .register-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.search-form .input-group {
    flex: 1;
    min-width: 200px;
}

.search-form button {
    align-self: center;
    width: 100%;
}

.search-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

input, textarea, button {
    padding: 12px;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
    transition: all 0.3s ease;
}

input[type="text"], input[type="password"], input[type="email"], textarea, input[type="file"] {
    flex: 1;
    min-width: 100%;
    background: #fff;
}

input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0,123,255,0.3);
    outline: none;
}

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

button {
    background: linear-gradient(90deg, #007bff, #00a8ff);
    color: white;
    border: none;
    cursor: pointer;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

button:hover {
    background: linear-gradient(90deg, #0056b3, #007bff);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,123,255,0.3);
}

.delete-btn {
    background: linear-gradient(90deg, #dc3545, #e4606d);
    padding: 8px 15px;
}

.delete-btn:hover {
    background: linear-gradient(90deg, #c82333, #dc3545);
    transform: translateY(-2px);
}

.edit-btn {
    background: linear-gradient(90deg, #28a745, #34c759);
    margin-left: 5px;
    padding: 8px 15px;
}

.edit-btn:hover {
    background: linear-gradient(90deg, #218838, #28a745);
    transform: translateY(-2px);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    min-width: 600px;
}

th, td {
    padding: 12px;
    border: 1px solid #dfe6e9;
    text-align: left;
}

th {
    background: #f5f5f5;
    color: #2c3e50;
    font-weight: 600;
}

@media screen and (max-width: 600px) {
    table {
        min-width: 100%;
    }
    th, td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    th {
        background: #f2f2f2;
        font-weight: bold;
    }
    td:before {
        content: attr(data-label);
        font-weight: bold;
        display: inline-block;
        width: 50%;
        padding-right: 10px;
    }
    tr {
        margin-bottom: 10px;
        border-bottom: 2px solid #ddd;
    }
    .thumbnail, video {
        max-width: 100%;
        height: auto;
    }
}

.thumbnail {
    max-width: 100px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

td img.thumbnail, td video.thumbnail {
    margin: 0 auto;
}

.doc-link {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
}

.doc-link:hover {
    text-decoration: underline;
    color: #0056b3;
}

.admin-link, .logout {
    display: block;
    text-align: center;
    color: #007bff;
    text-decoration: none;
    font-size: 16px;
}

.admin-link:hover, .logout:hover {
    text-decoration: underline;
}

.admin-icon {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    gap: 10px;
}

.admin-icon a {
    margin-right: auto;
}

.admin-icon-img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.results {
    margin-top: 20px;
}

.error {
    color: #dc3545;
    margin-bottom: 10px;
    font-size: 14px;
    text-align: center;
}

.error-light {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.input-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.input-group input, .input-group textarea {
    padding: 12px;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group input:focus, .input-group textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0,123,255,0.3);
    outline: none;
}

/* Стили для автозаполнения браузера */
.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover,
.input-group input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px #fff inset !important;
    -webkit-text-fill-color: #2c3e50 !important;
}

.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.theme-toggle:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #2c3e50;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #2c3e50;
    text-decoration: none;
}

.page-link {
    display: inline-block;
    padding: 8px 15px;
    text-decoration: none;
    color: #007bff;
    border: 1px solid #007bff;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 80px;
    box-sizing: border-box;
}

.page-link:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Стили для пагинации */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    font-size: 16px;
    flex-wrap: nowrap;
}

.pagination-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-jump {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-jump input[type="number"] {
    width: 60px;
    padding: 6px;
    font-size: 14px;
    text-align: center;
    border-radius: 8px;
}

.pagination-jump button {
    padding: 6px 12px;
    font-size: 14px;
}

/* Спиннер */
.spinner-circle {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

.spinner {
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    padding: 20px 30px;
    border-radius: 10px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.spinner span {
    font-size: 26px;
    font-weight: 700;
    animation: pulse 1.5s ease-in-out infinite;
}

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

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    .spinner {
        padding: 15px 25px;
        border-radius: 8px;
    }

    .spinner span {
        font-size: 22px;
    }
}

/* Футер */
.footer {
    text-align: center;
    margin-top: 20px;
    padding: 10px 0;
    font-size: 14px;
    color: #666;
    border-top: 1px solid #dfe6e9;
}

@media (max-width: 768px) {
    .search-form, .login-form, .add-form, .register-form {
        flex-direction: column;
        padding: 15px;
    }
    
    .search-form .input-group, .login-form .input-group, .register-form .input-group {
        min-width: 100%;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 70vh;
    }

    .pagination {
        flex-direction: column;
        gap: 10px;
    }

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

    .pagination-jump {
        justify-content: center;
    }

    .page-link {
        padding: 8px 16px;
        font-size: 15px;
        min-width: 90px;
    }

    .pagination-text {
        font-size: 14px;
    }

    .search-actions {
        flex-direction: row;
        justify-content: center;
        gap: 12px;
    }

    .header-actions {
        flex-direction: row;
        justify-content: center;
        gap: 12px;
    }

    .search-guide {
        padding: 10px;
        font-size: 12px;
    }

    .search-guide h3 {
        font-size: 14px;
    }

    .footer {
        font-size: 12px;
        padding: 8px 0;
    }

    h1 {
        font-size: 24px;
        padding: 8px 0;
    }

    h2 {
        font-size: 20px;
        padding: 6px 0;
    }
}

/* Улучшенные стили для форм входа и регистрации */
.container .login-form, .container .register-form {
    background: linear-gradient(135deg, #ffffff 0%, #e6f0fa 100%) !important;
    padding: 20px !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    max-width: 400px !important;
    width: 100% !important;
    margin: 20px auto !important;
}

.container .login-form .input-group input, .container .register-form .input-group input {
    padding: 12px !important;
    border: 1px solid #b0c4de !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    background: #f8f9fa !important;
    transition: all 0.3s ease !important;
}

.container .login-form .input-group input:focus, .container .register-form .input-group input:focus {
    border-color: #007bff !important;
    background: #fff !important;
    box-shadow: 0 0 10px rgba(0,123,255,0.4) !important;
}

.container .login-form .input-group label, .container .register-form .input-group label {
    font-size: 14px !important;
    color: #2c3e50 !important;
    font-weight: 600 !important;
    margin-bottom: 5px !important;
}

.container .login-form button, .container .register-form button {
    background: linear-gradient(90deg, #007bff, #00a8ff) !important;
    padding: 12px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    margin: 15px auto 0 !important;
    display: block !important;
}

.container .login-form button:hover, .container .register-form button:hover {
    background: linear-gradient(90deg, #0056b3, #007bff) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(0,123,255,0.4) !important;
}

.container .login-form .search-actions, .container .register-form .search-actions {
    justify-content: center !important;
    margin-top: 15px !important;
}

.container .login-form .page-link, .container .register-form .page-link {
    padding: 8px 12px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
    color: #007bff !important;
    border: 1px solid #007bff !important;
}

.container .login-form .page-link:hover, .container .register-form .page-link:hover {
    background: #007bff !important;
    color: white !important;
}

@media (max-width: 768px) {
    .container .login-form, .container .register-form {
        padding: 15px !important;
        max-width: 100% !important;
    }

    .container .login-form .input-group input, .container .register-form .input-group input {
        padding: 10px !important;
        font-size: 13px !important;
    }

    .container .login-form button, .container .register-form button {
        padding: 10px !important;
        font-size: 14px !important;
    }

    .container .login-form .page-link, .container .register-form .page-link {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
}

/* Стили для кнопок действий */
.action-button {
    padding: 8px 15px;
    margin: 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

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

.approve:hover {
    background-color: #218838;
}

.reject {
    background-color: #dc3545;
    color: white;
}

.reject:hover {
    background-color: #c82333;
}

.info-message {
    background-color: #e7f3ff;
    color: #31708f;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #bcdff1;
    border-radius: 4px;
    text-align: center;
}
.info-message a {
    color: #31708f;
    text-decoration: underline;
}
.info-message a:hover {
    text-decoration: none;
}

/* Светло-зеленый фон для заголовков таблицы */
th {
    background: #d4edda !important; /* Светло-зеленый цвет */
    color: #2c3e50;
    font-weight: 600;
}

/* Для темной темы - более темный оттенок зеленого */
.dark-theme th {
    background: #8456fc !important; /* Темно-зеленый для темной темы */
    color: #e0e0e0;
}