/* https://gwfh.mranftl.com/fonts/inter?subsets=latin */

/* Global Styles */
/* inter-300 - latin_latin-ext */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  src: url('/fonts/inter-v20-latin_latin-ext-300.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* inter-regular - latin_latin-ext */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  src: url('/fonts/inter-v20-latin_latin-ext-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* inter-500 - latin_latin-ext */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  src: url('/fonts/inter-v20-latin_latin-ext-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* inter-600 - latin_latin-ext */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  src: url('/fonts/inter-v20-latin_latin-ext-600.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* inter-700 - latin_latin-ext */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  src: url('/fonts/inter-v20-latin_latin-ext-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* Loading animation styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #121212;
    /* Dark background matching the site */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #2d2d2d;
    /* Darker border matching sidebar active */
    border-top: 6px solid #df927a;
    /* Primary color from the site */
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 18px;
    color: #e0e0e0;
    /* Text primary color */
    font-family: 'Inter', sans-serif;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.hidden {
    opacity: 0;
    pointer-events: none;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

:root {
    --primary-color: #df927a;
    --primary-hover: #ec5b2f;
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --sidebar-bg: #1a1a1a;
    --sidebar-active: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #333333;
    --hover-bg: #2a2a2a;
    --scrollbar-width: 8px;
    --scrollbar-thumb: #555555;
    --scrollbar-thumb-hover: #777777;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--bg-color);
}

nav {
    display: flex;
    flex-direction: column;
}

/* Webkit scrollbar styling for the whole page */
::-webkit-scrollbar {
    width: var(--scrollbar-width);
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 4px;
    border: 2px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Mobile menu toggle button */
.menu-toggle {
    display: none;
    position: fixed;
    top: 17px;
    left: 15px;
    z-index: 1000;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    color: var(--text-primary);
    padding: 20px 0 0 0;
    overflow-y: auto;
    height: 100vh;
    position: fixed;
    border-right: 1px solid var(--border-color);
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--sidebar-bg);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Webkit scrollbar styling (Chrome, Safari, newer versions of Opera) */
.sidebar::-webkit-scrollbar {
    width: var(--scrollbar-width);
}

.sidebar::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 4px;
    border: 2px solid var(--sidebar-bg);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

.logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.logo i {
    font-size: 24px;
    color: var(--primary-color);
}

.logo h2 {
    font-size: 18px;
    font-weight: 600;
}

nav {
    padding: 0;
    flex: 1;
    overflow-y: auto;
}

.category {
    margin-bottom: 8px;
}

.category-header {
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
    border-radius: 4px;
    margin: 0 8px;
}

.category-header span {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-header span i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    color: var(--primary-color);
}

.category-header:hover {
    background-color: var(--hover-bg);
}

.category-header.active {
    background-color: var(--sidebar-active);
    color: var(--primary-color);
    font-weight: 500;
}

.category-header i.fa-chevron-right {
    transition: transform 0.2s;
    color: var(--text-secondary);
    font-size: 14px;
}

.category-header i.fa-chevron-right.rotate {
    transform: rotate(90deg);
    color: var(--primary-color);
}

.subcategories {
    display: none;
    padding-left: 20px;
    margin-top: 4px;
}

.subcategories.active {
    display: block;
}

.subcategory {
    padding: 8px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 4px;
    margin: 4px 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.subcategory:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.subcategory.active {
    background-color: var(--sidebar-active);
    color: var(--primary-color);
    font-weight: 500;
}

/* Content Styles */
.content {
    flex: 1;
    padding: 40px;
    margin-left: 280px;
    width: calc(100% - 280px);
    max-width: none;
}

.welcome-screen {
    padding: 60px 0;
}

.welcome-screen.hidden {
    display: none;
}

.welcome-screen h1 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 32px;
}

.welcome-screen p {
    color: var(--text-secondary);
    font-size: 18px;
    max-width: 600px;
}

.welcome-screen i {
    color: var(--primary-color);
}

.resource-section {
    margin-bottom: 40px;
}

.resource-section h1 {
    margin-bottom: 30px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 32px;
}

.resource-section h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 24px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 450px));
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

.resource-item {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.resource-item.completed-item {
    border: 1px solid var(--primary-color);
    position: relative;
    background-color: rgba(223, 146, 122, 0.05);
}

.resource-item.completed-item.animate-completion {
    animation: border-pulse 0.6s ease;
}

/* Border animation for completed items */
@keyframes border-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(223, 146, 122, 0);
        border-color: var(--border-color);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(223, 146, 122, 0.4);
        border-color: var(--primary-color);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(223, 146, 122, 0);
        border-color: var(--primary-color);
    }
}

/* Border animation for when an item is unmarked */
@keyframes border-fade {
    0% {
        border-color: var(--primary-color);
    }

    100% {
        border-color: var(--border-color);
    }
}

.resource-item.animate-uncompletion {
    animation: border-fade 0.3s ease forwards;
}

.resource-item.with-image {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
/*
.resource-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}
*/
.resource-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
}

.resource-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.resource-image.loaded img {
    opacity: 1;
}

.resource-image.error img {
    display: none;
}

.image-loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--card-bg);
    z-index: 1;
}

.resource-image.loaded .image-loading-spinner {
    display: none;
}

.resource-image.error .image-loading-spinner {
    background-color: var(--card-bg);
}

.resource-image.error .image-loading-spinner:after {
    content: "Image failed to load";
    color: var(--text-secondary);
    font-size: 14px;
}

.resource-image.error .image-loading-spinner .spinner {
    display: none;
}

.image-loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #2d2d2d;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.resource-item:hover .resource-image img {
    transform: scale(1.05);
}

.resource-content {
    padding: 20px 20px 10px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

/* Resource actions container */
.resource-actions {
    display: flex;
    justify-content: space-between; /* Spaces out the left group and the completion button */
    align-items: center;
    /* margin-top: 15px; */
}

.action-group-left {
    display: flex;
    align-items: center; /* Vertically aligns 'Learn More' and report icon */
}

/* Completion container styles */
.completion-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 0;
}

/* Completion toggle button styles */
.completion-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 5px 0px 5px 5px;
}

.completion-toggle:hover {
    color: var(--primary-color);
    transform: scale(1.15);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

.completion-toggle.completed {
    color: var(--primary-color);
}

/* Add a subtle check animation */
@keyframes check-animation {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.completion-toggle.completed i {
    animation: check-animation 0.3s ease forwards;
}

/* Add a subtle hover animation for the unchecked box */
@keyframes pulse-scale {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.completion-toggle:not(.completed):hover i {
    animation: pulse-scale 0.8s ease infinite;
}

/* Report error button styles */
.report-error-btn.icon-only-button {
    background: none;
    transform-origin: center center;
    backface-visibility: hidden;
    transform: translateZ(0); /* Promote to its own layer */
    filter: drop-shadow(0 0 0 rgba(0,0,0,0)); /* Neutral base filter */
    border: none;
    cursor: pointer;
    font-size: 20px; /* Slightly smaller than completion toggle for differentiation */
    color: var(--text-secondary);
    transition: color 0.3s ease, transform 0.3s ease, filter 0.3s ease; /* Transition color, transform, and filter */
    display: flex;
    align-items: center;
    padding: 0 5px; /* Add some padding if needed */
    margin-left: 8px; /* Space it from the 'Learn More' link */
}

.report-error-btn.icon-only-button:hover {
    color: #e14b4b; /*var(--primary-color); /* Change color on hover, similar to other interactive elements */
    transform: translateY(-1px); /* Slight upward lift effect */
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2)); /* Re-enable filter */
}


/* Add a subtle attention-grabbing effect for uncompleted items */
@keyframes attention {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    10% {
        transform: scale(1.05);
        opacity: 1;
    }

    20% {
        transform: scale(1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

.completion-toggle:not(.completed) i {
    opacity: 0.8;
    animation: attention 6s ease infinite;
}

/* Completion label styles */
.completion-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-color);
    margin-right: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show the label only when the item is completed */
.completion-toggle.completed~.completion-label,
.completion-container:has(.completion-toggle.completed) .completion-label {
    opacity: 1;
}

/* Add a ribbon effect to the completed bookmark */
.completion-toggle.completed i {
    position: relative;
    color: var(--primary-color);
    text-shadow: 0 0 5px rgba(223, 146, 122, 0.5);
}

.resource-item h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
}

.resource-item p {
    margin-bottom: auto;
    color: var(--text-secondary);
    font-size: 14px;
    flex: 1;
}

.resource-item .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    margin-top: 30px;
}

.resource-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s;
}

.resource-item a:hover {
    color: var(--primary-hover);
}

.resource-item a i {
    margin-left: 5px;
    font-size: 12px;
}

/* Tag Styles */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    margin-top: 30px;
}

.tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

.sidebar-footer {
    padding: 10px 10px;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
    background-color: var(--bg-color);
    width: 100%;
}

.sidebar-buttons {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.sidebar-btn {
    background-color: var(--sidebar-active);
    color: var(--text-primary);
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex: 1;
}

.sidebar-btn:hover {
    background-color: #7a4939;
    color: white;
}

.sidebar-btn i {
    font-size: 12px;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .logo {
        padding: 0 70px 20px;
    }

    .sidebar {
        transform: translateX(-100%);
        z-index: 999;
        width: 280px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
        padding-top: 60px;
    }

    .welcome-screen {
        padding: 30px 0;
    }

    .welcome-screen h1 {
        font-size: 28px;
    }

    .welcome-screen p {
        font-size: 16px;
    }

    .resource-section h1 {
        font-size: 28px;
    }

    .resource-section h2 {
        font-size: 22px;
    }
}

@media (max-width: 576px) {
    .resources-grid {
        grid-template-columns: 1fr;
    }

    .resource-item {
        margin-bottom: 15px;
    }

    .content {
        padding: 15px;
        padding-top: 60px;
    }

    .resource-image {
        height: 200px;
    }

    .resource-content {
        min-height: 180px;
    }

    .welcome-screen h1 {
        font-size: 24px;
    }

    .welcome-screen p {
        font-size: 15px;
    }
}

/* Feedback Button and Modal Styles */
.feedback-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background-color: #423131;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-btn:hover {
    background-color: #7a4939;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.feedback-btn:active {
    transform: scale(0.95);
}

/* Feedback Modal */
.feedback-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

/* Ensure SweetAlert2 appears above feedback modal */
.swal2-container {
    z-index: 10000 !important;
}

.feedback-modal.active {
    display: flex;
}

.feedback-modal-content {
    background-color: var(--card-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-color);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.feedback-modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.feedback-modal-header h3 i {
    color: var(--primary-color);
}

.feedback-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-close-btn:hover {
    color: var(--text-primary);
}

.feedback-modal-body {
    padding: 24px;
}

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

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

.feedback-form-group .required {
    color: var(--primary-color);
}

.feedback-form-group select,
.feedback-form-group input,
.feedback-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--sidebar-bg);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feedback-form-group select:focus,
.feedback-form-group input:focus,
.feedback-form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(223, 146, 122, 0.1);
}

.feedback-form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.feedback-form-group small.char-count {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    text-align: right;
}

.feedback-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.feedback-cancel-btn,
.feedback-submit-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-cancel-btn {
    background-color: #3a3939;
    color: var(--text-primary);
}

.feedback-cancel-btn:hover {
    background-color: #343333;
}

.feedback-submit-btn {
    background-color: #7a4939;
    color: white;
}

.feedback-submit-btn:hover {
    background-color: #b84826;
}

.feedback-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .feedback-btn {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
        font-size: 22px;
    }

    .feedback-modal-content {
        width: 95%;
        margin: 10px;
    }

    .feedback-modal-header,
    .feedback-modal-body {
        padding: 16px;
    }

    .feedback-form-actions {
        flex-direction: column;
    }

    .feedback-cancel-btn,
    .feedback-submit-btn {
        width: 100%;
        justify-content: center;
    }
}