/* 
 * CV Training Blogs - Main Stylesheet
 */

:root {
    --cv-color-primary: #A855F7;
    --cv-color-primary-light: #F3E8FF;
    --cv-color-text-dark: #1F2937;
    --cv-color-text-light: #6B7280;
    --cv-color-bg-gray: #F9FAFB;
    --cv-color-border: #E5E7EB;

    --cv-badge-green-bg: #D1FAE5;
    --cv-badge-green-text: #10B981;
    --cv-badge-purple-bg: #F3E8FF;
    --cv-badge-purple-text: #A855F7;
    --cv-badge-blue-bg: #DBEAFE;
    --cv-badge-blue-text: #3B82F6;
    --cv-badge-orange-bg: #FFEDD5;
    --cv-badge-orange-text: #F97316;
    --cv-badge-pink-bg: #FCE7F3;
    --cv-badge-pink-text: #EC4899;
}

.cv-resources-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.cv-container {
    width: 100%;
}

/* Header Section */
.cv-resources-header {
    text-align: center;
    margin-bottom: 40px;
}

.cv-resources-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--cv-color-text-dark);
    margin-bottom: 16px;
    letter-spacing: -0.025em;
}

.cv-resources-highlight {
    color: var(--cv-color-primary);
}

.cv-resources-description {
    font-size: 1.125rem;
    color: var(--cv-color-text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Filter Section */
.cv-resources-filters-container {
    display: flex;
    justify-content: center;
    margin-bottom: 60px;
}

.cv-resources-filters {
    background-color: var(--cv-color-primary-light);
    border-radius: 16px;
    padding: 20px 40px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.cv-resources-filters-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--cv-color-text-dark);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.cv-resources-cat-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.cv-resources-filter-link {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 9999px;
    background-color: #fff;
    color: var(--cv-color-text-dark);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.cv-resources-filter-link:hover,
.cv-resources-filter-link:focus {
    color: var(--cv-color-primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.cv-resources-filter-link.active {
    background-color: var(--cv-color-primary);
    color: #fff;
}

/* Grid Layout */
.cv-resources-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 40px;
}

@media (min-width: 768px) {
    .cv-resources-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .cv-resources-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Post Card */
.cv-blog-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: transform 0.2s ease;
}

.cv-blog-card:hover {
    transform: translateY(-4px);
}

.cv-blog-card-image-link {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 16px;
    background-color: var(--cv-color-bg-gray);
}

.cv-blog-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cv-blog-card:hover .cv-blog-card-image {
    transform: scale(1.05);
}

.cv-blog-card-placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--cv-color-bg-gray);
}

/* Badges */
.cv-blog-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.cv-badge-green {
    background-color: var(--cv-badge-green-bg);
    color: var(--cv-badge-green-text);
}

.cv-badge-purple {
    background-color: var(--cv-badge-purple-bg);
    color: var(--cv-badge-purple-text);
}

.cv-badge-blue {
    background-color: var(--cv-badge-blue-bg);
    color: var(--cv-badge-blue-text);
}

.cv-badge-orange {
    background-color: var(--cv-badge-orange-bg);
    color: var(--cv-badge-orange-text);
}

.cv-badge-pink {
    background-color: var(--cv-badge-pink-bg);
    color: var(--cv-badge-pink-text);
}

/* Typography */
.cv-blog-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 12px 0;
}

.cv-blog-card-title a {
    color: var(--cv-color-text-dark);
    text-decoration: none;
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    transition: color 0.2s ease;
}

.cv-blog-card-title a:hover {
    color: var(--cv-color-primary);
}

.cv-blog-link-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 4px;
    transition: transform 0.2s ease;
}

.cv-blog-card-title a:hover .cv-blog-link-icon {
    transform: translate(2px, -2px);
}

.cv-blog-card-excerpt {
    font-size: 1rem;
    color: var(--cv-color-text-light);
    line-height: 1.6;
}

.cv-blog-card-excerpt p {
    margin: 0;
}

/* Pagination */
.cv-resources-main .pagination {
    margin-top: 60px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.cv-resources-main .page-numbers {
    padding: 8px 16px;
    border-radius: 8px;
    background-color: var(--cv-color-bg-gray);
    color: var(--cv-color-text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.cv-resources-main .page-numbers:hover,
.cv-resources-main .page-numbers:focus {
    background-color: var(--cv-color-border);
}

.cv-resources-main .page-numbers.current {
    background-color: var(--cv-color-primary);
    color: #fff;
}

/* =========================================================================
   SINGLE POST LAYOUT
   ========================================================================= */

.cv-single-main {
    padding: 60px 20px;
    max-width: 1280px;
    margin: 0 auto;
}

.cv-single-layout {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile first */
    gap: 40px;
    align-items: start;
}

@media (min-width: 1024px) {
    .cv-single-layout {
        /* Left sidebar (200px), Main content (flexible), Right sidebar (60px for icons) */
        grid-template-columns: 240px 1fr 60px;
        gap: 60px;
    }
}

/* Sidebar General */
.cv-single-sidebar {
    position: sticky;
    top: 100px;
}

/* Left Sidebar: Back & TOC */
.cv-sidebar-left {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

@media (max-width: 1023px) {
    .cv-sidebar-left {
        position: relative;
        top: 0;
        gap: 20px;
    }

    .cv-toc-container {
        display: none;
    }
}

.cv-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--cv-color-text-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.cv-back-link:hover {
    color: var(--cv-color-primary);
}

.cv-toc-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cv-toc-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cv-color-text-dark);
}

.cv-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cv-toc-item {
    margin: 0;
}

.cv-toc-subitem {
    margin-left: 16px;
}

.cv-toc-link {
    display: block;
    padding: 8px 16px;
    color: var(--cv-color-text-light);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.cv-toc-link:hover {
    color: var(--cv-color-text-dark);
    background-color: var(--cv-color-bg-gray);
}

.cv-toc-link.active {
    color: var(--cv-color-primary);
    background-color: var(--cv-color-primary-light);
}

/* Main Content Area */
.cv-single-article {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cv-single-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.875rem;
    color: var(--cv-color-text-light);
    font-weight: 500;
}

.cv-single-meta .cv-blog-badge {
    margin-bottom: 0;
    /* Override generic margin */
}

.cv-single-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--cv-color-text-dark);
    margin: 0;
}

@media (min-width: 768px) {
    .cv-single-title {
        font-size: 3rem;
    }
}

.cv-single-thumbnail {
    width: 100%;
    margin: 20px 0;
}

.cv-single-image {
    width: 100%;
    height: auto;
    border-radius: 16px;
}

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

.cv-single-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 40px 0 20px;
}

.cv-single-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 30px 0 16px;
}

.cv-single-content p {
    margin-bottom: 24px;
}

.cv-single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 32px 0;
}

/* Right Sidebar: Share */
.cv-share-sticky {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.cv-share-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cv-color-text-light);
}

.cv-share-button {
    background: transparent;
    border: none;
    color: var(--cv-color-text-light);
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.cv-share-button:hover {
    color: var(--cv-color-primary);
    transform: translateY(-2px);
    background-color: var(--cv-color-bg-gray);
}

/* Mobile Sticky Share overrides */
@media (max-width: 1023px) {
    .cv-sidebar-right {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--cv-color-border);
        z-index: 100;
        padding: 12px 20px;
        margin: 0;
    }

    .cv-share-sticky {
        flex-direction: row;
        justify-content: center;
        gap: 30px;
    }

    .cv-share-title {
        display: none;
        /* Hide 'SHARE' text on mobile bottom bar */
    }
}

/* Share Popup */
.cv-share-popup {
    position: absolute;
    top: 50%;
    right: 120%;
    /* Desktop */
    transform: translateY(-50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 250px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.cv-share-popup.active {
    opacity: 1;
    visibility: visible;
}

.cv-share-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--cv-color-border);
    padding-bottom: 8px;
}

.cv-share-popup-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--cv-color-text-dark);
}

.cv-share-popup-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--cv-color-text-light);
    line-height: 1;
}

.cv-share-networks-icons {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.cv-share-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--cv-color-bg-gray);
    color: var(--cv-color-text-dark);
    transition: all 0.2s;
}

.cv-share-icon:hover {
    background-color: var(--cv-color-primary-light);
    color: var(--cv-color-primary);
    transform: translateY(-2px);
}

.cv-share-copy-wrapper {
    display: flex;
    gap: 8px;
    background: var(--cv-color-bg-gray);
    border-radius: 8px;
    padding: 6px;
}

.cv-share-copy-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    color: var(--cv-color-text-light);
    padding: 0 8px;
    outline: none;
}

.cv-share-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 6px;
    background: #fff;
    color: var(--cv-color-text-dark);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.cv-share-copy-btn:hover {
    background: var(--cv-color-primary-light);
    color: var(--cv-color-primary);
}

@media (max-width: 1023px) {
    .cv-share-popup {
        top: auto;
        bottom: 100%;
        right: 50%;
        transform: translate(50%, -10px);
    }
}

/* =========================================================================
   GUIDE BOOK ARCHIVE LAYOUT
   ========================================================================= */

.cv-guide-book-main {
    text-align: center;
}

.cv-guide-book-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 40px;
    margin-top: 60px;
}

@media (min-width: 768px) {
    .cv-guide-book-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cv-guide-book-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cv-guide-book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.cv-guide-book-cover-wrapper {
    margin-bottom: 30px;
    perspective: 1000px;
}

.cv-guide-book-cover {
    width: 200px;
    height: auto;
    border-radius: 4px;
    transition: transform 0.4s ease;
}

.cv-guide-book-card:hover .cv-guide-book-cover {
    transform: translateY(-5px) rotateY(-5deg);
}

.cv-guide-book-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--cv-color-text-dark);
    margin-bottom: 12px;
}

.cv-guide-book-excerpt {
    font-size: 1rem;
    color: var(--cv-color-text-light);
    margin-bottom: 24px;
    line-height: 1.6;
}

.cv-btn-get-guide {
    background: linear-gradient(135deg, #A855F7, #6c5ce7);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

.cv-btn-get-guide:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.6);
}

/* =========================================================================
   MODAL / POPUP LAYOUT
   ========================================================================= */

.cv-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.cv-modal-content {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.cv-modal.active .cv-modal-content {
    transform: translateY(0);
}

.cv-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--cv-color-text-light);
    transition: color 0.2s;
}

.cv-modal-close:hover {
    color: var(--cv-color-text-dark);
}

.cv-modal-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cv-color-text-dark);
    text-align: center;
}

.cv-form-group {
    margin-bottom: 20px;
}

.cv-form-group input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--cv-color-border);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.cv-form-group input[type="email"]:focus {
    border-color: var(--cv-color-primary);
}

.cv-btn-submit {
    width: 100%;
    background: var(--cv-color-primary);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.cv-btn-submit:hover {
    background: #9333EA;
}

.cv-btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.cv-loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: cv-spin 1s ease-in-out infinite;
}

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

.cv-form-message {
    margin-top: 16px;
    text-align: center;
    font-size: 0.9rem;
    padding: 10px;
    border-radius: 4px;
}

.cv-form-message.error {
    background: #FEE2E2;
    color: #DC2626;
}

.cv-form-message.success {
    background: #D1FAE5;
    color: #059669;
}