
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;700&display=swap');

* {
    box-sizing: border-box;
}

body,
html {
    height: 100%;
    margin: 0;
    font-family: "Roboto Mono", "Courier New", monospace;
    min-height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    background-attachment: fixed;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
}

/* Светлая тема (по умолчанию) */
body.light-theme,
body {
    background: #f5f5f5;
    color: #333;
}

/* Темная тема */
body.dark-theme {
    background: #121212;
    color: #e0e0e0;
}

/* Стили только для главной страницы (без прокрутки страницы) */
body:not(.about-page) {
    overflow: hidden;
}

/* Стили для страницы "О проекте" (без прокрутки страницы) */
body.about-page {
    overflow: hidden;
}

body:not(.about-page) .site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px; /* Фиксированная высота футера для главной страницы */
}

body.about-page .site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px; /* Фиксированная высота футера для страницы "О проекте" */
}

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

/* Header Styles */
/* Стили для светлой темы */
body.light-theme .site-header {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #e0e0e0;
}

body.light-theme .header-logo h1 a {
    color: #1976d2;
}

body.light-theme .header-logo h1 a:hover {
    color: #0d47a1;
}

body.light-theme .header-nav nav ul li a {
    color: #333;
}

body.light-theme .header-nav nav ul li a:hover,
body.light-theme .header-nav nav ul li a.active {
    color: #1976d2;
    background-color: rgba(25, 118, 210, 0.1);
}

/* Стили для темной темы */
body.dark-theme .site-header {
    background: rgba(30, 30, 30, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid #333;
}

body.dark-theme .header-logo h1 a {
    color: #64b5f6;
}

body.dark-theme .header-logo h1 a:hover {
    color: #90caf9;
}

body.dark-theme .header-nav nav ul li a {
    color: #e0e0e0;
}

body.dark-theme .header-nav nav ul li a:hover,
body.dark-theme .header-nav nav ul li a.active {
    color: #64b5f6;
    background-color: rgba(100, 181, 246, 0.1);
}

/* Общие стили для шапки */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    width: 100%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.header-logo h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.header-logo h1 a {
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.header-logo h1 i {
    margin-right: 10px;
}

.header-nav nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 15px;
}

.header-nav nav ul li a {
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 15px;
}

.header-nav nav ul li a i {
    margin-right: 6px;
}

/* Стили для кнопки переключения темы */
.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
    width: 40px;
    height: 40px;
}

/* Стили для светлой темы */
body.light-theme .theme-toggle-btn {
    color: #333;
    background-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .theme-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: rotate(15deg);
}

/* Стили для темной темы */
body.dark-theme .theme-toggle-btn {
    color: #e0e0e0;
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: rotate(15deg);
}

/* Main Content Styles */
.main-content {
    flex: 1;
    padding: 20px 0;
    padding-top: 35px; /* Отступ от header */
    padding-bottom: 60px; /* Отступ для футера на главной странице */
}

/* Уберем дополнительный отступ для страницы "О проекте", так как он теперь общий */
body.about-page .main-content {
    padding-top: 35px; /* Отступ от header */
    padding-bottom: 0; /* Убираем отступ для страницы "О проекте" */
}

/* Section Styles */
/* Стили для светлой темы */
body.light-theme .generator-section,
body.light-theme .output-section {
    background: #ffffff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

body.light-theme .generator-section {
    margin-top: 20px;
}

body.light-theme .section-header {
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
}

body.light-theme .section-header h2 {
    color: #1976d2;
}

body.light-theme .section-description {
    color: #666;
}

/* Стили для темной темы */
body.dark-theme .generator-section,
body.dark-theme .output-section {
    background: #1e1e1e;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
}

body.dark-theme .generator-section {
    margin-top: 20px;
}

body.dark-theme .section-header {
    border-bottom: 1px solid #333;
    background: linear-gradient(135deg, #2d2d2d 0%, #1e1e1e 100%);
}

body.dark-theme .section-header h2 {
    color: #64b5f6;
}

body.dark-theme .section-description {
    color: #aaa;
}

/* Общие стили для секций */
.generator-section,
.output-section {
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    padding-top: 0px;
}

.section-header {
    padding: 15px 20px;
    position: relative;
    z-index: 2;
}

.section-header h2 {
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 700;
}

.section-header h2 i {
    margin-right: 8px;
}

.section-description {
    margin: 0;
    font-size: 13px;
}

/* New Generator Controls Styles */
.generator-controls {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-label {
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Стили для светлой темы */
body.light-theme .control-label {
    color: #333;
}

body.light-theme .form-control {
    border: 2px solid #e0e0e0;
    background-color: #f5f5f5;
    color: #333;
}

body.light-theme .form-control:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2);
}

body.light-theme .length-slider {
    background: #e0e0e0;
}

body.light-theme .length-slider::-webkit-slider-thumb {
    background: #1976d2;
    border: 2px solid #f5f5f5;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

body.light-theme .length-slider::-moz-range-thumb {
    background: #1976d2;
    border: 2px solid #f5f5f5;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

body.light-theme .custom-checkbox-inline {
    color: #333;
}

body.light-theme .custom-checkbox-square {
    border: 2px solid #e0e0e0;
    background-color: #f5f5f5;
}

body.light-theme .custom-checkbox-input:checked + .custom-checkbox-square {
    background-color: #1976d2;
    border-color: #1976d2;
}

body.light-theme .custom-checkbox-input:checked + .custom-checkbox-square::after {
    color: #f5f5f5;
}

body.light-theme .custom-checkbox-square:hover {
    border-color: #1976d2;
}

body.light-theme .error-message {
    color: #d32f2f;
}

body.light-theme .btn-generate {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.25);
    color: white;
}

body.light-theme .btn-generate:hover {
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.35);
}

/* Стили для темной темы */
body.dark-theme .control-label {
    color: #e0e0e0;
}

body.dark-theme .form-control {
    border: 2px solid #333;
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.dark-theme .form-control:focus {
    border-color: #64b5f6;
    box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.2);
}

body.dark-theme .length-slider {
    background: #333;
}

body.dark-theme .length-slider::-webkit-slider-thumb {
    background: #64b5f6;
    border: 2px solid #1e1e1e;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

body.dark-theme .length-slider::-moz-range-thumb {
    background: #64b5f6;
    border: 2px solid #1e1e1e;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

body.dark-theme .custom-checkbox-inline {
    color: #e0e0e0;
}

body.dark-theme .custom-checkbox-square {
    border: 2px solid #333;
    background-color: #2d2d2d;
}

body.dark-theme .custom-checkbox-input:checked + .custom-checkbox-square {
    background-color: #64b5f6;
    border-color: #64b5f6;
}

body.dark-theme .custom-checkbox-input:checked + .custom-checkbox-square::after {
    color: #1e1e1e;
}

body.dark-theme .custom-checkbox-square:hover {
    border-color: #64b5f6;
}

body.dark-theme .error-message {
    color: #f44336;
}

body.dark-theme .btn-generate {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.25);
    color: white;
}

body.dark-theme .btn-generate:hover {
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.35);
}

/* Общие стили */
.form-control {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: 'Roboto Mono', 'Courier New', monospace;
}

.form-control:focus {
    outline: none;
}

.length-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    outline: none;
    opacity: 0.8;
    transition: opacity .2s;
    margin-top: 1px; /* Отступ сверху для слайдера */
}

.length-slider:hover {
    opacity: 1;
}

.length-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    cursor: pointer;
    border-radius: 50%;
}

.length-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    cursor: pointer;
    border-radius: 50%;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.custom-checkbox-inline {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    gap: 8px;
}

.custom-checkbox-input {
    display: none;
}

.custom-checkbox-square {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.custom-checkbox-input:checked + .custom-checkbox-square::after {
    content: "✓";
    font-weight: bold;
    font-size: 12px;
}

.error-message {
    text-align: center;
    min-height: 20px;
    font-weight: 600;
    padding: 10px;
}

.btn-generate {
    border: none;
    padding: 15px;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    gap: 8px;
}

.btn-generate:hover {
    transform: translateY(-2px);
}

.btn-generate:active {
    transform: translateY(0);
}


.passwords-container {
    padding: 15px 20px;
    position: relative;
    z-index: 10;
    overflow: visible;
}

.passwords-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-width: thin;
    scrollbar-color: #64b5f6 #333;
}

.passwords-grid::-webkit-scrollbar {
    width: 8px;
}

.passwords-grid::-webkit-scrollbar-track {
    background: #333;
    border-radius: 4px;
}

.passwords-grid::-webkit-scrollbar-thumb {
    background-color: #64b5f6;
    border-radius: 4px;
}

/* Стили для светлой темы */
body.light-theme .password {
    border: 2px solid #e0e0e0;
    background-color: #f5f5f5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    color: #333;
}

body.light-theme .password:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border-color: #1976d2;
}

body.light-theme .password.copied {
    background-color: #4caf50;
    color: #fff;
    border-color: #4caf50;
}

body.light-theme .copy-icon {
    color: #1976d2;
}

/* Стили для темной темы */
body.dark-theme .password {
    border: 2px solid #333;
    background-color: #2d2d2d;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    color: #e0e0e0;
}

body.dark-theme .password:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border-color: #64b5f6;
}

body.dark-theme .password.copied {
    background-color: #388e3c;
    color: #e8f5e9;
    border-color: #4caf50;
}

body.dark-theme .copy-icon {
    color: #64b5f6;
}

/* Общие стили */
.password {
    cursor: pointer;
    padding: 12px 15px;
    border-radius: 6px;
    position: relative;
    transition: all 0.2s ease;
    font-family: 'Roboto Mono', 'Courier New', monospace;
    font-size: 15px;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: visible;
    margin: 3px 0;
    z-index: 1;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.password:hover {
    transform: translateY(-2px);
    z-index: 20;
    margin: 1px 0 5px 0;
}

.password-content {
    flex-grow: 1;
    text-align: center;
    word-break: break-all;
    font-weight: 500;
    font-size: 15px;
    font-family: 'Roboto Mono', 'Courier New', monospace;
}

.copy-icon {
    opacity: 0.6;
    transition: all 0.2s ease;
    margin-left: 10px;
    font-size: 15px;
}

.password:hover .copy-icon {
    opacity: 1;
    transform: scale(1.1);
}

.copy-message {
    background-color: #4caf50;
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    animation: fadeInOut 2s ease-in-out;
    font-weight: 500;
    font-family: 'Roboto Mono', 'Courier New', monospace;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(10px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(10px); }
}

.generator-section,
.output-section {
    animation: fadeIn 0.6s ease-out forwards;
}

.generator-section {
    animation-delay: 0.1s;
}

.output-section {
    animation-delay: 0.2s;
}

/* About Page Styles */
/* Стили для светлой темы */
body.light-theme .about-container {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    border: 1px solid #e0e0e0;
}

body.light-theme .about-container .section-header {
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
}

body.light-theme .about-container h2 {
    color: #1976d2;
}

body.light-theme .about-section h3 {
    color: #333;
}

body.light-theme .about-section h3::after {
    background: #1976d2;
}

body.light-theme .about-section p,
body.light-theme .about-section ul,
body.light-theme .about-section ol {
    color: #666;
}

body.light-theme .about-section {
    background: rgba(245, 245, 245, 0.7);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

body.light-theme .about-section:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Стили для темной темы */
body.dark-theme .about-container {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    background: #1e1e1e;
    border: 1px solid #333;
}

body.dark-theme .about-container .section-header {
    border-bottom: 1px solid #333;
    background: linear-gradient(135deg, #2d2d2d 0%, #1e1e1e 100%);
}

body.dark-theme .about-container h2 {
    color: #64b5f6;
}

body.dark-theme .about-section h3 {
    color: #e0e0e0;
}

body.dark-theme .about-section h3::after {
    background: #64b5f6;
}

body.dark-theme .about-section p,
body.dark-theme .about-section ul,
body.dark-theme .about-section ol {
    color: #aaa;
}

body.dark-theme .about-section {
    background: rgba(45, 45, 45, 0.7);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.dark-theme .about-section:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Общие стили для страницы "О проекте" */
.about-container {
    border-radius: 15px;
    padding: 0;
    margin-bottom: 0;
    animation: fadeIn 0.6s ease-out forwards;
    animation-delay: 0.1s;
    height: calc(100vh - 190px); /* Уменьшена высота, чтобы футер не перекрывал */
    display: flex;
    flex-direction: column;
}

.about-container .section-header {
    padding: 25px 40px;
    text-align: center;
    border-radius: 15px 15px 0 0;
    flex-shrink: 0;
}

.about-container h2 {
    text-align: center;
    margin-bottom: 0px;
    font-size: 32px;
    font-weight: 700;
}

.about-container h2 i {
    margin-right: 15px;
}

.about-content {
    padding: 20px 40px;
    overflow-y: auto; /* Прокрутка только для содержимого */
    flex-grow: 1;
}

.about-section {
    margin-bottom: 40px;
}

.about-section h3 {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
    position: relative;
    padding-bottom: 10px;
}

.about-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    border-radius: 3px;
}

.about-section p {
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 16px;
}

.about-section ul,
.about-section ol {
    line-height: 1.8;
    margin-bottom: 20px;
    padding-left: 25px;
}

.about-section ul li,
.about-section ol li {
    margin-bottom: 12px;
    font-size: 16px;
}

.about-content {
    padding: 10px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    flex-grow: 1;
}

.about-section {
    margin-bottom: 0;
    padding: 12px;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.about-section:hover {
    transform: translateY(-3px);
}

.about-section h3 {
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 600;
    position: relative;
    padding-bottom: 8px;
}

.about-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    border-radius: 2px;
}

.about-section p {
    line-height: 1.5;
    margin-bottom: 15px;
    font-size: 14px;
}

.about-section ul,
.about-section ol {
    line-height: 1.5;
    margin-bottom: 15px;
    padding-left: 20px;
}

.about-section ul li,
.about-section ol li {
    margin-bottom: 8px;
    font-size: 14px;
}

/* Footer Styles */
/* Стили для светлой темы */
body.light-theme .site-footer {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #e0e0e0;
}

body.light-theme .footer-info p {
    color: #666;
}

body.light-theme .footer-info p:first-child {
    color: #333;
}

/* Стили для темной темы */
body.dark-theme .site-footer {
    background: rgba(30, 30, 30, 0.95);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    border-top: 1px solid #333;
}

body.dark-theme .footer-info p {
    color: #aaa;
}

body.dark-theme .footer-info p:first-child {
    color: #e0e0e0;
}

/* Общие стили для футера */
.site-footer {
    padding: 15px 0;
    backdrop-filter: blur(10px);
    flex-shrink: 0; /* Предотвращает сжатие футера */
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    text-align: center;
}

.footer-info p {
    margin: 0;
    font-size: 13px;
}

.footer-info p:first-child {
    font-weight: 500;
}

/* Адаптивность */
@media (max-width: 992px) {
    .passwords-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        max-height: 250px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    
    .header-nav nav ul {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .section-header {
        padding: 15px 20px;
    }
    
    .section-header h2 {
        font-size: 20px;
    }
    
    .generator-controls {
        padding: 15px 20px;
    }
    
    .btn-generate {
        padding: 12px;
        font-size: 15px;
    }
    
    .password {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .passwords-container {
        padding: 15px 20px;
    }
    
    .passwords-grid {
        gap: 12px;
        max-height: 200px;
    }
    
    .checkbox-group {
        gap: 10px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        padding: 0 15px;
    }
    
    .about-container {
        padding: 25px 20px;
    }
    
    .about-container h2 {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    .about-section h3 {
        font-size: 18px;
    }
    
    /* Адаптивность для кнопки переключения темы */
    .theme-toggle-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .passwords-grid {
        grid-template-columns: 1fr;
        max-height: 200px;
    }
    
    .section-header h2 {
        font-size: 18px;
    }
    
    .password-content {
        font-size: 13px;
    }
    
    .checkbox-group {
        flex-direction: column;
    }
}
