/* ===================================
   BOOK FB2 - COMPONENTS STYLES
   Стили для UI компонентов
   =================================== */

/* NOTIFICATIONS */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: var(--radius);
    background-color: var(--bg-info, #e3f2fd);
    color: var(--text-primary);
    border-left: 4px solid #0066cc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.notification.visible {
    opacity: 1;
    transform: translateY(0);
}

.notification-success {
    background-color: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

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

.notification-warning {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

/* FORMS */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="search"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
}

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

.form-group input.invalid,
.form-group textarea.invalid,
.form-group select.invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-group .help-text,
.form-group .error-text {
    display: block;
    font-size: 12px;
    margin-top: 4px;
    color: var(--text-secondary);
}

.form-group .error-text {
    color: #dc3545;
    font-weight: 600;
}

/* BUTTONS */
.btn,
button,
input[type="button"],
input[type="submit"],
.button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #d32f2f;
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    user-select: none;
    vertical-align: middle;
}

.btn:hover,
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
.button:hover {
    background-color: #b71c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(211, 47, 47, 0.3);
}

.btn:active,
button:active,
input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(211, 47, 47, 0.2);
}

.btn:disabled,
button:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Button variants */
.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid #d32f2f;
    color: #d32f2f;
}

.btn-outline:hover {
    background-color: #d32f2f;
    color: white;
}

/* BADGES */
.badge {
    display: inline-block;
    padding: 4px 8px;
    background-color: #d32f2f;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 4px;
}

.badge-secondary {
    background-color: #6c757d;
}

.badge-success {
    background-color: #28a745;
}

.badge-warning {
    background-color: #ffc107;
    color: #333;
}

.badge-info {
    background-color: #0099ff;
}

/* TABS */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.tabs button,
.tabs a {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    text-decoration: none;
}

.tabs button:hover,
.tabs a:hover {
    color: var(--text-primary);
}

.tabs button.active,
.tabs a.active {
    color: #d32f2f;
    border-bottom-color: #d32f2f;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--surface-2);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    margin: 0;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* LOADING SPINNER */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #d32f2f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-large {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* TOOLTIP */
.simple-tooltip {
    position: fixed;
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 999;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.simple-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* PAGINATION */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    min-width: 36px;
    text-align: center;
}

.pagination a:hover {
    background-color: #f0f0f0;
    border-color: #d32f2f;
    color: #d32f2f;
}

.pagination .active {
    background-color: #d32f2f;
    color: white;
    border-color: #d32f2f;
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* BREADCRUMB */
.breadcrumb {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumb a {
    color: #0066cc;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--text-secondary);
}

/* RATING */
.rating {
    display: flex;
    gap: 2px;
    font-size: 20px;
}

.rating span {
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.rating span.active,
.rating span:hover {
    color: #ffc107;
}

/* PROGRESS BAR */
.progress {
    height: 8px;
    background-color: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    height: 100%;
    background-color: #d32f2f;
    width: 0;
    transition: width 0.3s ease;
}

.progress-bar-success {
    background-color: #28a745;
}

.progress-bar-warning {
    background-color: #ffc107;
}

.progress-bar-info {
    background-color: #0099ff;
}

/* CARD */
.card {
    background-color: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--border-strong);
}

.card-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background-color: var(--surface-1);
}

.card-body {
    padding: 16px;
}

.card-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    background-color: var(--surface-1);
}

/* ACCORDION */
.accordion-item {
    border: 1px solid var(--border);
    border-bottom: none;
}

.accordion-item:last-child {
    border-bottom: 1px solid var(--border);
}

.accordion-header {
    padding: 16px;
    background-color: var(--surface-1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.accordion-header:hover {
    background-color: #f5f5f5;
}

.accordion-header.active {
    background-color: #f9f9f9;
}

.accordion-header::after {
    content: '▼';
    transition: transform 0.2s ease;
    display: inline-block;
    margin-left: 10px;
}

.accordion-header.active::after {
    transform: rotate(-180deg);
}

.accordion-body {
    padding: 16px;
    display: none;
    border-top: 1px solid var(--border);
}

.accordion-body.active {
    display: block;
}

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

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

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

.slide-in {
    animation: slideIn 0.3s ease;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
        top: auto;
        bottom: 20px;
    }

    .modal {
        width: 95%;
    }

    .pagination {
        gap: 2px;
    }

    .pagination a,
    .pagination span {
        padding: 6px 8px;
        min-width: 30px;
    }

    .tabs {
        flex-direction: column;
    }

    .tabs button,
    .tabs a {
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .tabs button.active,
    .tabs a.active {
        border-left-color: #d32f2f;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer button {
        width: 100%;
    }
}
