html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    cursor: pointer;
}

a:hover {
    text-decoration: underline dotted var(--bs-warning);
}

header, .aside_container {
    background-color: #F8FAFC;
}

.aside_container {
    flex: 1;
    min-height: 0;
}

#tec-container {
    height: 100vh;
}

.logo_container {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    align-items: center;
}

#logo_svg, .logo {
    display: inline;
}

.logo {
    margin: 0;
}

.logo #logo_red {
	color:#e53e3e;
}

.logo #logo_grey {
	color: var(--bs-secondary);
}

#logo_svg:hover {
    transform: rotate(10deg);
    transition: transform 0.3s;
}

.badge {
    font-weight: 500;
}

.active > .badge {
    color: var(--bs-warning);
    outline: var(--bs-warning) solid 2px;
}

.accordion-item.active .accordion-header i {
    color: var(--bs-warning);
}

/* Override bootstrap modal defaults */

.modal-backdrop {
    --bs-backdrop-opacity: 0.1;
}

.modal-content {
    box-shadow: 0 0 1em;
}

.list-inline-item:not(:last-child) {
    margin-right: 0.2rem;
}

.list-inline-item:not(:last-child)::after {
    content: " •";
    margin-left: 0.2rem;
    color: var(--bs-secondary);
}

.accordion {
    --bs-accordion-btn-focus-box-shadow: none;
}

.filter-name {
	font-size: 13px;
}

/* Override toggle switch defaults */

.switch-toggle {
    background-color: var(--bs-gray-200);
    height: 1.5em;
}

.switch-toggle a {
    background-color: var(--bs-gray-500);
}

.switch-toggle label {
    line-height: unset;
}

.switch-toggle input:focus ~ span a, .switch-toggle input:focus + label {
    outline: none;
}

.switch-toggle input + label {
    cursor: pointer;
}

/* Styles for custom elements */

#clear-search {
    cursor: pointer;
}

#toggle-help {
    cursor: pointer;
}

#reset-filters {
    cursor: pointer;
}

.tec-item {
    width: 150px;
    position: absolute;
    transition: left 500ms, top 500ms, transform 500ms;
}

.tec-item:hover {
    transform: rotate(3deg);
}

/* Auth admin */

.auth_container {
	display: flex;
	justify-content: center;
	padding-top: 50px;
	position: relative;
}

.login-container {
	background-color: white;
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
	width: 400px;
	max-width: 90%;
	padding: 40px;
	text-align: center;
	position: relative;
}

.close_auth_admin {
	position: absolute;
	top: 20px;
	right: 20px;
	border: none;
	cursor: pointer;
	background-color: white;
	color: #333;
}

.login-header {
	margin-bottom: 30px;
}

.login-header h1 {
	color: #333;
	font-size: 24px;
	margin-bottom: 10px;
}

.login-header p {
	color: #666;
	font-size: 14px;
}

.input-group {
	margin-bottom: 20px;
	text-align: left;
}

.input-group label {
	display: block;
	margin-bottom: 8px;
	color: #555;
	font-size: 14px;
	font-weight: bold;
}

.input-group input {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid #ddd;
	border-radius: 5px;
	font-size: 16px;
	transition: border 0.3s;
}

.input-group input:focus {
	border-color: #667eea;
	outline: none;
}

.remember-forgot {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	font-size: 14px;
}

.remember-me {
	display: flex;
	align-items: center;
}

.remember-me input {
	margin-right: 5px;
}

.forgot-password a {
	color: #667eea;
	text-decoration: none;
}

.login-button {
	width: 100%;
	padding: 12px;
	background: linear-gradient(to right, #667eea, #764ba2);
	border: none;
	border-radius: 5px;
	color: white;
	font-size: 16px;
	font-weight: bold;
	cursor: pointer;
	transition: opacity 0.3s;
}

.login-button:hover {
	opacity: 0.9;
}

.error-message {
	color: #e74c3c;
	font-size: 14px;
	margin: 10px 0;
	display: none;
}

.admin-icon {
	width: 60px;
	height: 60px;
	margin: 0 auto 20px;
	background-color: #f0f0f0;
	border-radius: 50%;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 24px;
	color: #667eea;
}
/* /Auth admin */

/* Admin-panel */

.admin-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 20px;
    background-color: #f8f9fa;
}

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

.articles-list {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table-header, .article-row {
    display: grid;
	grid-template-columns: repeat(7, 1fr);
    gap: 15px;
    padding: 12px 15px;
    align-items: center;
}

.table-header {
    font-weight: bold;
    border-bottom: 2px solid #dee2e6;
}

.article-row {
    border-bottom: 1px solid #eee;
}

.article-row:hover {
    background-color: #f8f9fa;
}

.action-btn {
    margin-right: 5px;
}

.bib-preview {
    max-height: 200px;
    overflow-y: auto;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    font-family: monospace;
    white-space: pre-wrap;
}

/* /Admin-panel */

/* Мобильная адаптация */
@media (max-width: 767.98px) {
    /* Хэдер */
    header {
        padding: 0.5rem !important;
    }
    
    .logo {
        font-size: 1.1rem !important;
    }
    
    #logo_svg {
        display: none;
    }
    
    /* Боковая панель */
    .aside_container {
        flex-direction: column;
    }
    
    #sidebar {
        min-width: 100% !important;
        height: auto !important;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    /* Основной контент */
    #tec-container {
        min-height: 50vh;
    }
    
    /* Аккордеон */
    .accordion-button {
        padding: 0.5rem !important;
        font-size: 0.9rem;
    }
    
    /* Переключатели */
    .cat-switch {
        transform: scale(0.8);
        transform-origin: right;
    }
    
    /* Форма поиска */
    #search {
        font-size: 0.9rem;
    }
}

@media (max-width: 575px) {
    .logo_container {
        flex-direction: column;
        align-items: flex-start;
    }

    .badge {
        display: none;
    }
}

@media (max-width: 450px) {
    header {
        gap: 10px;
        flex-direction: column;
    }
}