:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --button-gradient: linear-gradient(45deg, #667eea, #764ba2);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-color: #2c3e50;
    --muted-color: #6c757d;
    --bg-color: #f8f9fa;
    --white: #ffffff;
}

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
    font-family: 'Poppins', sans-serif;
}

.navbar {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-weight: 700;
    color: var(--text-color) !important;
}

/* Hero Section */
.hero-section {
    background: var(--primary-gradient);
    color: var(--white);
    padding: 40px 0;
    text-align: center;
}

.hero-section h1 {
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-section .lead {
    font-size: 1.25rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.search-form-container {
    max-width: 800px;
    margin: 0 auto;
}

.search-form-container .form-control {
    border-radius: 30px 0 0 30px;
    padding-left: 25px;
    border: none;
}

.search-form-container .btn {
    border-radius: 0 30px 30px 0;
    padding-right: 25px;
    padding-left: 20px;
    background: var(--white);
    color: var(--primary-color);
    border: none;
}

/* Book Grid */
.book-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background: var(--white);
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.book-cover-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1/1;
    /* Square book cards */
}



.book-cover-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.book-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.book-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    display: block;
}

.button-container {
    margin-top: auto;
    padding-top: 15px;
}

.book-meta {
    font-size: 0.8rem;
    color: var(--muted-color);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-meta i {
    width: 18px;
}

.category-tag {
    background-color: #e9ecef;
    color: #495057;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    margin: 2px;
    display: inline-block;
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-tag:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-1px);
}

.category-tag.active {
    background: var(--primary-color);
    color: var(--white);
}

/* Post Detail */
.post-header {
    background: var(--white);
    padding: 40px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 40px;
}

.post-detail-container {
    background: var(--white);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.detail-image {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.detail-table td {
    padding: 10px 0;
}

.detail-table strong {
    color: var(--muted-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* CPAgrip Locker */
.locker-card {
    background: #fdfdfd;
    border: 2px dashed #e0e0e0;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    margin: 40px 0;
}

.styled-button {
    background: var(--button-gradient);
    color: var(--white);
    padding: 16px 40px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.styled-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.link-box {
    background-color: #f0fff4;
    border: 2px solid #38a169;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.styled-link {
    color: #2f855a;
    font-weight: 700;
    text-decoration: none;
    word-break: break-all;
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
    border-radius: 8px;
    margin: 0 3px;
    border: none;
    background: var(--white);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    color: var(--white);
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: #bdc3c7;
    padding: 60px 0 20px;
    margin-top: 80px;
}

footer a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--white);
}

/* Unlock Instruction Box */
.unlock-instruction-layout {
    max-width: 800px;
    margin: 0 auto 40px;
}

.unlock-box-header {
    background-color: #005cbf;
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    font-size: 1.5rem;
    font-weight: 500;
    text-align: center;
}

.unlock-box-body {
    background-color: #fffff0;
    /* Light yellow background */
    border: 1px solid #f0f0f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 30px;
}

.unlock-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    text-align: left;
}

.unlock-steps li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 20px;
    color: #333;
    font-size: 1rem;
    line-height: 1.5;
}

.unlock-steps li i {
    position: absolute;
    left: 0;
    top: 3px;
    color: #005cbfcc;
    /* Matching teal/green */
    font-size: 1.2rem;
}

.unlock-action-area {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #ddd;
}

.unlock-code-input-area {
    max-width: 400px;
    margin: 0 auto;
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* Detailed Download Link */
.download-result-link {
    display: block;
    background-color: #f2f5ff;
    color: #2268ff;
    padding: 20px;
    border: 2px dashed #33a8e2;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;

    /* Text Wrapping Logic */
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.download-result-link:hover {
    background-color: #ffebee;
    border-color: #ef5350;
    color: #b71c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.15);
}

/* Mobile Redesign Styles */
@media (max-width: 767px) {
    .hero-section {
        padding: 30px 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section .lead {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .book-card {
        border-radius: 8px;
    }

    .book-body {
        padding: 0.75rem;
    }

    .book-title {
        font-size: 0.85rem;
        height: auto;
        display: block;
        -webkit-line-clamp: unset;
        margin-bottom: 5px;
    }

    .book-meta-section .book-meta,
    .book-card .button-container {
        display: none !important;
    }

    .book-card .category-tag {
        background: transparent;
        padding: 0;
        margin: 0;
        font-size: 0.75rem;
        font-style: italic;
        color: var(--muted-color);
        display: block;
    }

    .book-card .category-tag:hover {
        background: transparent;
        transform: none;
        color: var(--primary-color);
    }

    .search-form-container .form-control::placeholder {
        font-size: 0.9rem;
    }
}