/* Bangladesh Income Tax Information Website Styles */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans Bengali', 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-bg);
}

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

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

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

.logo img {
    height: 50px;
    width: auto;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    text-align: center;
}

.language-switcher {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.lang-btn {
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    font-weight: 500;
}

.lang-btn:hover,
.lang-btn.active {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    padding: 1rem 0;
    min-height: calc(100vh - 200px);
}

.page-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.menu-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    text-align: left;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-dark);
    border: 2px solid transparent;
    min-height: 70px;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
}

.menu-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border-color: var(--secondary-color);
    text-decoration: none;
    color: var(--text-dark);
}

.menu-icon {
    width: 45px;
    height: 45px;
    margin: 0;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.menu-icon img {
    width: 25px;
    height: 25px;
    filter: brightness(0) invert(1);
}

.menu-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    text-align: left;
    flex: 1;
}

/* Content Page Styles */
.content-page {
    background: #ededed;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 0.5rem 0;
    box-shadow: var(--shadow);
}

.content-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

.content-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

/* WordPress-style Image Handling */
.content-text img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    clear: both;
}

.content-text p img {
    margin: 1rem 0;
}

/* Image alignment classes */
.content-text .alignleft {
    float: left;
    margin: 0.5rem 1.5rem 1rem 0;
    display: inline;
}

.content-text .alignright {
    float: right;
    margin: 0.5rem 0 1rem 1.5rem;
    display: inline;
}

.content-text .aligncenter {
    display: block;
    margin: 1.5rem auto;
    text-align: center;
    clear: both;
}

/* Clear floats after images */
.content-text::after {
    content: "";
    display: table;
    clear: both;
}

/* Ensure paragraphs with images have proper spacing */
.content-text p:has(img) {
    margin-bottom: 1.5rem;
}

/* Figure and caption support */
.content-text figure {
    margin: 1.5rem 0;
    text-align: center;
}

.content-text figure img {
    margin: 0 auto 0.5rem;
}

.content-text figcaption {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    margin-top: 0.5rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.back-btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    text-decoration: none;
    color: white;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* Admin Styles */
.admin-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem 0;
    padding-left: 80px; /* Add left padding to avoid overlap with sidebar toggle */
}

.admin-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-nav .logo {
    margin-left: 0; /* Ensure logo starts from the left edge of the padded area */
}

.admin-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.admin-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: background 0.3s ease;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255,255,255,0.2);
}

.admin-content {
    padding: 2rem 0;
}

.admin-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--accent-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    padding: 15px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.table th:last-child,
.table td:last-child {
    border-right: none;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table th {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #000000;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: var(--light-bg);
    transform: scale(1.01);
}

.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Book Section Styles */
.book-section {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 4rem 0;
    margin: 2rem 0;
}

.book-content {
    display: flex;
    align-items: center;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.book-image-container {
    flex: 0 0 300px;
    text-align: center;
}

.book-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.book-image:hover {
    transform: scale(1.05);
}

.book-info {
    flex: 1;
}

.book-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.book-author {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.book-description {
    margin-bottom: 2rem;
}

.book-description p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-dark);
}

.book-features {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--light-bg);
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.feature-item:hover {
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 1.2rem;
}

.feature-text {
    font-weight: 500;
    color: var(--text-dark);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .language-switcher {
        justify-content: center;
    }
    
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        max-width: 100%;
    }
    
    .menu-item {
        padding: 0.8rem 1rem;
        min-height: 60px;
        gap: 0.8rem;
    }
    
    .menu-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .menu-icon img {
        width: 20px;
        height: 20px;
    }
    
    .menu-title {
        font-size: 0.9rem;
        line-height: 1.2;
    }
    
    .page-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }
    
    .content-page {
        padding: 2rem 1rem;
    }
    
    .admin-nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Book Section Mobile Styles */
    .book-section {
        padding: 2rem 0;
        margin: 1rem 0;
    }
    
    .book-content {
        flex-direction: column;
        gap: 2rem;
        padding: 2rem 1.5rem;
        margin: 0 1rem;
    }
    
    .book-image-container {
        flex: none;
        order: -1;
    }
    
    .book-image {
        max-width: 250px;
    }
    
    .book-title {
        font-size: 1.8rem;
        text-align: center;
    }
    
    .book-author {
        font-size: 1.1rem;
        text-align: center;
    }
    
    .book-description p {
        font-size: 1rem;
        text-align: center;
    }
    
    .book-features {
        justify-content: center;
    }
    
    .feature-item {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* Responsive adjustments for header padding */
@media (max-width: 768px) {
    .admin-header {
        padding-left: 70px; /* Slightly less padding on mobile */
    }
}

@media (max-width: 480px) {
    .admin-header {
        padding-left: 60px; /* Even less padding on small mobile */
    }
    
    .admin-nav .logo h2 {
        font-size: 1.2rem; /* Smaller font size on mobile */
    }
    
    .container {
        padding: 0 10px;
    }
    
    .main-content {
        padding: 2rem 0;
    }
    
    .menu-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    
    .menu-item {
        padding: 0.7rem 1rem;
        min-height: 55px;
        gap: 0.7rem;
    }
    
    .menu-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .menu-icon img {
        width: 18px;
        height: 18px;
    }
    
    .menu-title {
        font-size: 0.85rem;
        line-height: 1.1;
    }
    
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .site-title {
        font-size: 1.2rem;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    /* Book Section Small Mobile Styles */
    .book-content {
        padding: 1.5rem 1rem;
        margin: 0 0.5rem;
    }
    
    .book-image {
        max-width: 200px;
    }
    
    .book-title {
        font-size: 1.5rem;
    }
    
    .book-author {
        font-size: 1rem;
    }
    
    .book-description p {
        font-size: 0.95rem;
    }
    
    .feature-item {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 360px) {
    .menu-grid {
        gap: 0.5rem;
    }
    
    .menu-item {
        padding: 0.6rem 0.8rem;
        min-height: 50px;
        gap: 0.6rem;
    }
    
    .menu-icon {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .menu-icon img {
        width: 16px;
        height: 16px;
    }
    
    .menu-title {
        font-size: 0.8rem;
    }
}

/* Content Search */
.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1 1 240px;
    min-width: 200px;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.search-btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--border-radius);
    background: var(--secondary-color);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.25s ease;
}

.search-btn:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
}

.search-btn.secondary {
    background: var(--warning-color);
}

.search-btn.secondary:hover {
    filter: brightness(0.95);
}

.search-btn.ghost {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.search-btn.ghost:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.search-count {
    margin-left: auto;
    font-size: 0.95rem;
    color: var(--text-light);
}

.search-highlight {
    background: rgba(241, 196, 15, 0.35);
    border-radius: 3px;
    padding: 0 2px;
}

.search-highlight.active {
    background: rgba(46, 204, 113, 0.35);
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.45);
}

/* Sidebar Styles */
.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.sidebar-toggle span {
    width: 20px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.sidebar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.sidebar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: white;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    background: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
    padding: 0;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-menu-item {
    border-bottom: 1px solid var(--border-color);
}

.sidebar-menu-item.active .sidebar-link {
    background: var(--secondary-color);
    color: white;
}

.sidebar-menu-item.active .sidebar-icon {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 15px;
}

.sidebar-link:hover {
    background: var(--light-bg);
    color: var(--secondary-color);
    text-decoration: none;
}

.sidebar-link.logout-link:hover {
    background: var(--accent-color);
    color: white;
}

.sidebar-icon {
    width: 35px;
    height: 35px;
    background: var(--light-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.sidebar-link span {
    font-weight: 500;
    font-size: 0.95rem;
}

/* Body adjustments when sidebar is open */
body.sidebar-open {
    overflow: hidden;
}

/* Admin page adjustments */
.admin-page {
    padding-left: 0;
    transition: all 0.3s ease;
}

.admin-content {
    margin-left: 0;
    transition: all 0.3s ease;
    padding-top: 80px; /* Space for toggle button */
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        left: -100%;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .admin-content {
        padding-top: 80px;
    }
}

@media (min-width: 769px) {
    .sidebar-overlay {
        display: none;
    }
    
    .sidebar-close {
        display: none;
    }
    
    /* Desktop: sidebar open by default */
    .sidebar {
        left: 0;
    }
    
    .admin-content {
        margin-left: 280px;
        padding-top: 20px;
    }
    
    .sidebar-toggle {
        left: 300px; /* Move toggle button to the right when sidebar is open */
    }
    
    /* When sidebar is closed on desktop */
    body.sidebar-closed .sidebar {
        left: -280px;
    }
    
    body.sidebar-closed .admin-content {
        margin-left: 0;
    }
    
    body.sidebar-closed .sidebar-toggle {
        left: 20px;
    }
}