/* ===================================
   BOOK FB2 - MODERN STYLES
   Восстановленные стили для сайта
   =================================== */

/* Global Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    background-color: #f9f9f9;
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: #222;
    margin: 1em 0 0.5em 0;
    font-weight: 600;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin: 1em 0;
}

a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #0052a3;
    text-decoration: underline;
}

/* Container */
.container, #wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: #fff;
    border-bottom: 2px solid #e0e0e0;
    padding: 20px 0;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

header h1 {
    margin: 0;
    font-size: 2rem;
}

#logo {
    color: #d32f2f;
    text-decoration: none;
    font-weight: 700;
}

#logo span {
    color: #999;
    font-size: 0.8em;
    display: block;
    font-weight: 400;
}

/* Navigation */
#nav, nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0 0 0;
    padding: 0;
}

#nav li, nav li {
    display: inline;
}

#nav a, nav a {
    display: inline-block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

#nav a:hover, nav a:hover {
    background-color: #f0f0f0;
    color: #0066cc;
}

/* Main Content Area */
main, .content, .main {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Sidebar */
aside, .sidebar {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.sidebar h3 {
    color: #d32f2f;
    border-bottom: 2px solid #d32f2f;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: #0066cc;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Buttons */
button, input[type="button"], input[type="submit"], .button {
    background-color: #d32f2f;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.2s ease;
    display: inline-block;
}

button:hover, 
input[type="button"]:hover, 
input[type="submit"]:hover,
.button:hover {
    background-color: #b71c1c;
}

/* Lists */
ul, ol {
    margin: 1em 0;
    padding-left: 30px;
}

li {
    margin-bottom: 0.5em;
}

/* Search Box */
#fam, #name, #kniga, #ganr, #lang {
    display: inline-block;
    margin-right: 10px;
    font-weight: 600;
    color: #333;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.search-form input[type="text"],
.search-form select {
    flex: 1;
    min-width: 150px;
}

/* Book List / Content List */
.book-item, .post-item, .content-item {
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.book-item:hover, 
.post-item:hover,
.content-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #0066cc;
}

.book-item h4, .post-item h4 {
    margin-top: 0;
}

/* Grid Layout */
.grid-2, .grid-3 {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Footer */
footer {
    background-color: #333;
    color: #fff;
    padding: 30px 0;
    margin-top: 50px;
    border-top: 2px solid #222;
}

footer a {
    color: #0099ff;
}

footer a:hover {
    color: #33b3ff;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th {
    background-color: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

tbody tr:nth-child(odd) {
    background-color: #fafafa;
}

tbody tr:hover {
    background-color: #f0f0f0;
}

/* Alerts & Messages */
.alert, .message, .notice {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #0c5460;
    color: #0c5460;
}

.alert-success {
    background-color: #d4edda;
    border-color: #155724;
    color: #155724;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #856404;
    color: #856404;
}

.alert-error, .alert-danger {
    background-color: #f8d7da;
    border-color: #721c24;
    color: #721c24;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Code Blocks */
code, pre {
    background-color: #f5f5f5;
    font-family: 'Courier New', monospace;
    border-radius: 4px;
    padding: 2px 6px;
}

pre {
    padding: 15px;
    overflow-x: auto;
    margin: 15px 0;
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

.hidden { display: none; }
.visible { display: block; }

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

/* Print Styles */
@media print {
    body {
        background-color: white;
    }
    a {
        color: #0066cc;
        text-decoration: underline;
    }
    header, footer, aside {
        display: none;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    header {
        padding: 15px 0;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    
    main, .content {
        padding: 15px;
    }
    
    #nav {
        flex-direction: column;
        gap: 5px;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-form input,
    .search-form select {
        width: 100%;
    }
}

/* ===================================
   ANIMATIONS
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}
