/* Import fonts and colors */
@import url('https://fonts.googleapis.com/css2?family=Commissioner:wght@700&family=IBM+Plex+Sans&display=swap');

@media (prefers-color-scheme: dark) {
    :root {
        --text-50: #091111;
        --text-100: #112222;
        --text-200: #224444;
        --text-300: #336666;
        --text-400: #448888;
        --text-500: #55aaaa;
        --text-600: #77bbbb;
        --text-700: #99cccc;
        --text-800: #bbdddd;
        --text-900: #ddeeee;
        --text-950: #eef6f6;

        --background-50: #091111;
        --background-100: #112222;
        --background-200: #224444;
        --background-300: #336666;
        --background-400: #448888;
        --background-500: #55aaaa;
        --background-600: #77bbbb;
        --background-700: #99cccc;
        --background-800: #bbdddd;
        --background-900: #ddeeee;
        --background-950: #eef6f6;

        --primary-50: #081110;
        --primary-100: #112220;
        --primary-200: #224441;
        --primary-300: #326761;
        --primary-400: #438982;
        --primary-500: #54aba2;
        --primary-600: #76bcb5;
        --primary-700: #98cdc7;
        --primary-800: #bbddda;
        --primary-900: #ddeeec;
        --primary-950: #eef7f6;

        --secondary-50: #090c11;
        --secondary-100: #111822;
        --secondary-200: #222f44;
        --secondary-300: #334766;
        --secondary-400: #445e88;
        --secondary-500: #5576aa;
        --secondary-600: #7791bb;
        --secondary-700: #99adcc;
        --secondary-800: #bbc8dd;
        --secondary-900: #dde4ee;
        --secondary-950: #eef1f6;

        --accent-50: #090b11;
        --accent-100: #111522;
        --accent-200: #222b44;
        --accent-300: #334066;
        --accent-400: #445588;
        --accent-500: #556aaa;
        --accent-600: #7788bb;
        --accent-700: #99a6cc;
        --accent-800: #bbc4dd;
        --accent-900: #dde1ee;
        --accent-950: #eef0f6;

    }
}

:root {
    --text-50: #edf7f5;
    --text-100: #dcefec;
    --text-200: #b9dfd9;
    --text-300: #95d0c6;
    --text-400: #72c0b3;
    --text-500: #4fb0a0;
    --text-600: #3f8d80;
    --text-700: #2f6a60;
    --text-800: #204640;
    --text-900: #102320;
    --text-950: #081210;

    --background-50: #eef6f6;
    --background-100: #ddeeee;
    --background-200: #bbdddd;
    --background-300: #99cccc;
    --background-400: #77bbbb;
    --background-500: #55aaaa;
    --background-600: #448888;
    --background-700: #336666;
    --background-800: #224444;
    --background-900: #112222;
    --background-950: #091111;

    --primary-50: #eef7f6;
    --primary-100: #ddeeec;
    --primary-200: #bbddda;
    --primary-300: #98cdc7;
    --primary-400: #76bcb5;
    --primary-500: #54aba2;
    --primary-600: #438982;
    --primary-700: #326761;
    --primary-800: #224441;
    --primary-900: #112220;
    --primary-950: #081110;

    --secondary-50: #eef1f6;
    --secondary-100: #dde4ee;
    --secondary-200: #bbc8dd;
    --secondary-300: #99adcc;
    --secondary-400: #7791bb;
    --secondary-500: #5576aa;
    --secondary-600: #445e88;
    --secondary-700: #334766;
    --secondary-800: #222f44;
    --secondary-900: #111822;
    --secondary-950: #090c11;

    --accent-50: #eef0f6;
    --accent-100: #dde1ee;
    --accent-200: #bbc4dd;
    --accent-300: #99a6cc;
    --accent-400: #7788bb;
    --accent-500: #556aaa;
    --accent-600: #445588;
    --accent-700: #334066;
    --accent-800: #222b44;
    --accent-900: #111522;
    --accent-950: #090b11;

    --box-shadow: rgba(17, 21, 34, 0.3);


}
  


/* Styles CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: var(--text-950);
}

html {
    font-size: 100%; 
    height: 100%;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    height: 100%;
    background-color: var(--background-100);
    background-size: cover;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* Typography */
h1, h2, h3, h4, h5 {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
}

h1 { font-size: 4.210rem; }
h2 { font-size: 3.158rem; }
h3 { font-size: 2.369rem; }
h4 { font-size: 1.777rem; }
h5 { font-size: 1.333rem; }
small { font-size: 0.750rem; }

.header {
    grid-area: header;
    padding: 2rem 10%;
    background-color: var(--background-400);
    box-shadow: 0px 5px 5px -5px var(--box-shadow);
    border-radius: 0 0 10px 10px;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
}

button { cursor: pointer; }
img { border-style: none; }

main {
    grid-area: content;
    padding: 2rem;
    background-color: var(--primary-200); 
    border-radius: 10px; 
    box-shadow: 0px 5px 15px var(--box-shadow);
}

.container_2-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 2fr;
    grid-template-areas: 
        "info btns"
        "sect sect";
    max-width: 40rem;
    max-height: 40rem;
    justify-content: center;
    align-content: center;
    justify-self: center;
}

.info__ {
    background-color: var(--background-50);
    box-shadow: 0px 2px 3px var(--box-shadow);
    border-radius: 8px;
    align-content: center;
    height: 15rem;
    width: 25rem;
    align-self: center;
    font-size: 1.3rem;
    position: relative;
}

.container_2-2 div {
    padding: 2rem;
}

.create__sections {
    padding: 30rem;
    align-items: center;
    align-content: center;
    justify-self: center;
    justify-content: center;
    overflow: overlay;
    max-height: 50em;
    max-width: 45em;
    box-shadow: 5px 5px 5px -5px var(--box-shadow) inset;
    border-radius: 8px;
    background-color: var(--background-50);
    
}

.create__sections a {
    min-width: 8rem;
    min-height: 3.5rem;
    margin: 1rem 0.5rem;
    background-color: var(--secondary-400);
    color: var(--text-100);
    align-content: center;
    font-size: 1.3rem;
}
.create__sections a:nth-child(2n+1) {
    min-width: 60px;
    min-height: 60px;
    border-radius: 50%;

}
.create__sections a:nth-child(2n) {
    min-width: 200px;
    min-height: 90px;
}

.edit_btns a {
    margin: 0.5rem;
    min-width: 14rem;
    min-height: 4rem;
    align-content: center;
    background-color: var(--primary-100);
    color: var(--text-700);
    font-weight: 400;
    box-shadow: 0px 2px 3px var(--box-shadow);
}


td, th { vertical-align: top; }

.container_nbs {
    display: grid;
    min-height: 100dvh;
    grid-template-columns: 16rem 1fr 16rem;
    grid-template-rows: auto 1fr auto;
    grid-template-areas: 
        "header header header"
        "nav content sidebar"
        "footer footer footer";
    
}

#logo { text-align: left; cursor: pointer; font-family: Arial; font-size: 18px; font-weight: bold; color: black; }

.aButton{
    display: inline-block;
    font-family: 'Trebuchet MS', sans-serif;
    font-weight: 600;
    font-size: 1.125rem;
    text-align: center;
    background-color: var(--primary-100);
    color: var(--text-700);
    box-shadow: 0px 2px 3px var(--box-shadow);
    text-decoration: none;
    max-width: 12rem;
    border-radius: 1rem;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
    margin: 1px 0;
}

.aButton:hover {
    background: var(--primary-300);
    color: var(--text-800);
    transform: scale(1.05);
}

.aButton:active {
    background: var(--primary-500);
}

.aButton:focus {
    outline: 1px solid var(--accent-800);
    outline-offset: 2px;
}

nav {
    grid-area: nav;
    padding: 2rem;
}

aside {
    grid-area: sidebar;
    padding: 2rem;
}

.navbar a {
    background-color: transparent;
    box-shadow: none;
}

@media (max-width: 992px) {
    .container_nbs {
        min-height: 100dvh;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr auto auto;
        grid-template-areas: 
            "header"
            "nav"
            "content"
            "sidebar"
            "footer";
    }

    .navbar-nav {
        margin-top: 1rem;
    }
    
    .nav-link {
        margin: 0.25rem 0;
    }
    
    .dropdown {
        margin-top: 1rem;
        margin-bottom: 0.5rem;
    }
}

#footerPart { margin-top: 30px; }
#footerPart div { text-align: center; flex: 1 1 200px; margin: 0.5rem 0;}

footer {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-evenly;
    align-items: center;
    grid-area: footer;
    padding: 2rem;
    color: var(--text-800);
    box-shadow: 0px 5px 15px var(--box-shadow);
    margin-top: 1%;
    border-radius: 10px;
}

footer a {
    color: var(--text-500);
    text-decoration: none;
}

.image-slider { font-size: 20px; position: relative; }
.image-slider .image-item { display: block; padding: 0px 40px; }
.image-slider .image-item img { margin: 0; }
.image-slider .photo-next,
.image-slider .photo-prev { position: absolute; top: 45%; font-weight: bold; }
.image-slider .photo-next { right: 0; }
.image-slider .photo-prev { left: 0; }

.dropdown {
    display: inline-block;
    margin-left: auto; 
    margin-right: 1rem; 
}

.input-group {
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;

}

.input-group label {
    position: absolute;
    transform: translateY(-50%);
    top: 50%;
    font-size: 16px;
    pointer-events: none;
    color: var(--accent-800);
    padding: 0 5px;
    transition: .5s;
}

input {
    border-radius: 8px;
}

.input-group>input {
    width: 20rem;
    height: 4rem;
    position: relative;
    color: var(--text-800);
    font-size: 16px;
    padding: 0 15px;
    border: 0.1rem solid var(--accent-800);
    background: transparent;
    outline: none;
}

.input-group>input:focus~label,
.input-group>input:valid~label {
    top: 0.7rem;
    font-size: 14px;

}

header {
    grid-area: header;
    padding: 2rem;
}

form {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    color: var(--text-700);
}

.login__box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5%;
    border-radius: 10%;
    background-color: var(--secondary-300);
    box-shadow: 0px 5px 15px var(--box-shadow);
    max-width: 25rem;
    min-width: 22rem;
    margin: auto;
}

textarea {
    background-color: var(--background-50);
    color: var(--text-800);
    font-size: 1.2rem;
    border-radius: 8px;
    border: none;
    box-shadow: 0px 2px 9px var(--box-shadow) inset;
    padding: 1rem;
}



/* Дополнительные стили для карточек */
.card-article {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    border: none;
    min-height: 280px;
}

.card-article:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card-title a {
    color: var(--text-900);
    text-decoration: none;
    transition: color 0.2s;
}

.card-title a:hover {
    color: var(--primary-600);
    text-decoration: underline;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-600);
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    background-color: var(--primary-100);
    color: var(--primary-700);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
}

.card-footer {
    background-color: var(--background-50);
    border-top: 1px solid var(--primary-100);
    font-size: 0.8rem;
}

.link-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-right: 70px;
    min-height: 24px;
}

.link-copy {
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-grow: 1;
    padding-right: 70px;
    margin-right: -70px;
}

.copy-hint {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-500);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.link-container:hover .copy-hint {
    opacity: 1;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-500);
}

/* Header Styles */
.header {
    background-color: var(--background-400);
    box-shadow: 0px 5px 5px -5px var(--box-shadow);
    padding: 0.5rem 0;
}

.navbar .aButton {
    color: var(--text-700);
}
.navbar .aButton:hover {
    color: var(--text-800);
    transform: scale(1.1);
    text-shadow: -2px 11px 8px var(--box-shadow);   
}

.navbar .dropdown .aButton {
    color: var(--text-700);
    background: var(--primary-400);
    outline: none;
    box-shadow: none;
}

.navbar .dropdown .aButton:hover {
    color: var(--text-800);
    transform: scale(1.1);
    text-shadow: -2px 11px 8px var(--box-shadow);
    background: var(--primary-300);
    
}
.custom-toggler {
    border: none;
    padding: 0.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.custom-toggler:focus {
    box-shadow: 0 0 0 2px var(--primary-300);
    outline: none;
}

.burger-icon {
    width: 24px;
    height: 24px;
    color: var(--text-100); 
    transition: transform 0.3s ease;
}

/* Стили для мобильного меню */
.navbar-nav.d-lg-none {
    width: 100%;
    margin-top: 1rem;
}

.navbar-nav.d-lg-none .nav-item {
    border-bottom: 1px solid var(--primary-200);
    border-top: 1px solid var(--primary-200);
}

.navbar-nav.d-lg-none .nav-link {
    padding: 0.75rem 1rem;
    color: var(--text-700);
}

.navbar-nav.d-lg-none .nav-link:hover {
    background-color: var(--primary-100);
}

/* Анимация при открытии меню */
.custom-toggler[aria-expanded="true"] .burger-icon {
    transform: rotate(90deg);
}

.navbar-toggler-icon {
    display: none;
}

.navbar-collapse {
    transition: all 0.3s ease;
}

.nav-link {
    white-space: nowrap;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
}

.dropdown-toggle::after {
    margin-left: 0.5em;
    vertical-align: 0.15em;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 5px 15px var(--box-shadow);
    border-radius: 8px;
    padding: 0.5rem;
    background-color: var(--background-100);
}

.dropdown-item {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    color: var(--text-700);
    transition: all 0.2s ease;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--primary-100);
    color: var(--text-900);
}

.dropdown-divider {
    border-color: var(--primary-300);
    margin: 0.5rem 0;
}

/* Дополнительные стили для улучшения доступности */
.card-article {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-article:focus-within, 
.card-article:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    outline: 2px solid var(--primary-500);
}

.card-title a:focus {
    outline: 3px solid var(--primary-300);
    outline-offset: 3px;
}

.link-container:focus-within {
    outline: 2px dashed var(--primary-500);
    border-radius: 4px;
}

.tag {
    transition: background-color 0.2s ease;
}

.tag:focus, .tag:hover {
    background-color: var(--primary-300) !important;
    color: white !important;
}

.empty-state svg {
    fill: var(--primary-500);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-500);
    color: white;
    padding: 8px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}