/* ==================== Layout Components (Login Modal, Tools Sidebar, Newsletter, Consent) ==================== */

/* Login Modal */
#loginModal .modal-content { border-radius: 16px; border: none; }
#loginModal .modal-header { padding: 1.25rem 1.25rem 0; }
#loginModal .nav-tabs .nav-link { color: #6B7280; border: none; padding: 0.75rem 1.5rem; border-radius: 10px; transition: all 0.2s; }
#loginModal .nav-tabs .nav-link.active { color: #4F46E5; background: #EEF2FF; font-weight: 700; }
#loginModal .nav-tabs .nav-link:hover:not(.active) { background: #F3F4F6; }
#loginModal .form-control { border-radius: 10px; border: 1.5px solid #E5E7EB; padding: 0.65rem 1rem; font-size: 0.9rem; }
#loginModal .form-control:focus { border-color: #4F46E5; box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
#loginModal .btn { border-radius: 10px; }
#loginModal .btn-close { position: absolute; right: 1rem; top: 1rem; z-index: 10; }

/* Tools Sidebar */
.tools-page-wrap { display: flex; gap: 0; min-height: calc(100vh - 60px); }
.tools-sidebar { width: 220px; min-width: 220px; background: var(--light-bg, #fff); border-right: 1px solid #E5E7EB; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; transition: all 0.3s ease; z-index: 10; }
.tools-sidebar::-webkit-scrollbar { width: 3px; }
.tools-sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
.tools-sidebar.collapsed { width: 56px; min-width: 56px; }
.tools-sidebar.collapsed .tsb-list { display: none; }
.tools-sidebar.collapsed .tsb-header span:last-child { display: none; }
.tools-sidebar.collapsed .tsb-header { justify-content: center; padding: 12px 0; }
.tsb-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; font-weight: 700; font-size: .82rem; cursor: pointer; border-bottom: 1px solid #F3F4F6; user-select: none; transition: all 0.15s; }
.tsb-header:hover { background: #F9FAFB; }
.tsb-header i:first-child { color: var(--primary-color, #4F46E5); margin-right: 8px; }
.tsb-arrow { font-size: .65rem; color: #9CA3AF; transition: transform 0.2s; }
.tsb-arrow.rotated { transform: rotate(180deg); }
.tools-sidebar.collapsed .tsb-arrow { transform: rotate(180deg); }
.tsb-list { padding: 8px; }
.tsb-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; font-size: .8rem; color: #6B7280; text-decoration: none; transition: all 0.15s; margin-bottom: 2px; }
.tsb-item:hover { background: #F3F4F6; color: var(--primary-color, #4F46E5); text-decoration: none; }
.tsb-item.active { background: rgba(79, 70, 229, 0.08); color: var(--primary-color, #4F46E5); font-weight: 600; }
.tsb-item i { width: 18px; text-align: center; font-size: .85rem; flex-shrink: 0; }
.tools-content { flex: 1; min-width: 0; }
@media(max-width: 767px) { .tools-sidebar { display: none; } .tools-page-wrap { display: block; } }

/* Newsletter form */
.newsletter-form { display: flex; gap: 6px; margin-top: 14px; }
.newsletter-form input[type="email"] { flex: 1; min-width: 300px; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.08); color: inherit; font-size: 0.85rem; }
.newsletter-form input[type="email"]::placeholder { color: rgba(255,255,255,0.6); }
.newsletter-form input[type="email"]:focus { outline: none; border-color: var(--primary-color, #4F46E5); }
.newsletter-form button { width: 42px; height: 42px; flex-shrink: 0; border: none; border-radius: 8px; background: var(--primary-color, #4F46E5); color: #fff; cursor: pointer; }
.newsletter-form button:hover { opacity: 0.9; }
.newsletter-msg { display: block; width: 100%; font-size: 0.78rem; margin-top: 6px; }
.newsletter-msg.text-success { color: #4ADE80; }
.newsletter-msg.text-danger { color: #F87171; }

/* Cookie & Notification consent banner */
.consent-banner {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 99999;
    max-width: 720px; margin: 0 auto;
    background: #1F2937; color: #F9FAFB;
    border-radius: 16px; padding: 18px 20px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
    display: none; flex-wrap: wrap; align-items: center; gap: 14px;
    font-size: .86rem; line-height: 1.5;
}
.consent-banner.show { display: flex; }
.consent-banner .cb-icon {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    background: linear-gradient(135deg, #4F46E5, #7C3AED); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.consent-banner .cb-text { flex: 1; min-width: 220px; }
.consent-banner .cb-text strong { font-size: .95rem; }
.consent-banner .cb-text p { margin: 2px 0 0; color: #D1D5DB; font-size: .78rem; }
.consent-banner .cb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.consent-banner .btn { border-radius: 10px; font-size: .82rem; padding: 9px 16px; font-weight: 600; }
.consent-banner .btn-primary { background: linear-gradient(135deg, #4F46E5, #7C3AED); border: none; }
.consent-banner .btn-outline-light { color: #F9FAFB; border-color: rgba(255,255,255,0.35); }
.consent-banner .btn-outline-light:hover { background: rgba(255,255,255,0.1); color: #fff; }
.consent-banner a { color: #A5B4FC; }
@media (max-width: 575px) {
    .consent-banner { flex-direction: column; align-items: flex-start; }
    .consent-banner .cb-actions { width: 100%; }
    .consent-banner .cb-actions .btn { flex: 1; }
}

/* Dark mode for layout components */
[data-theme="dark"] #loginModal .modal-content { background: #1E293B; }
[data-theme="dark"] #loginModal .nav-tabs .nav-link { color: #94A3B8; }
[data-theme="dark"] #loginModal .nav-tabs .nav-link.active { color: #818CF8; background: rgba(129,140,248,0.15); }
[data-theme="dark"] #loginModal .nav-tabs .nav-link:hover:not(.active) { background: #334155; }
[data-theme="dark"] #loginModal .form-control { background: #1E293B; border-color: #334155; color: #E2E8F0; }
[data-theme="dark"] #loginModal .form-control:focus { background: #1E293B; border-color: #818CF8; }

[data-theme="dark"] .tools-sidebar { background: #1E293B; border-color: #334155; }
[data-theme="dark"] .tools-sidebar::-webkit-scrollbar-thumb { background: #475569; }
[data-theme="dark"] .tsb-header { border-color: #334155; }
[data-theme="dark"] .tsb-header:hover { background: #334155; }
[data-theme="dark"] .tsb-item { color: #94A3B8; }
[data-theme="dark"] .tsb-item:hover { background: #334155; color: #818CF8; }
[data-theme="dark"] .tsb-item.active { background: rgba(129,140,248,0.15); color: #818CF8; }

[data-theme="dark"] .newsletter-form input[type="email"] { background: rgba(30,41,59,0.5); border-color: rgba(51,65,85,0.5); color: #E2E8F0; }

[data-theme="dark"] .consent-banner { background: #0F172A; }