/* KC7 Custom CSS
 * This file contains custom styles that extend Bootstrap
 * and provide consistent components across the application
 */

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    /* Colors */
    --color-primary: #3869D4;
    --color-secondary: #6c757d;
    --color-success: #22BC66;
    --color-danger: #FF6136;
    --color-warning: #FFB900;
    --color-info: #17a2b8;
    --link-1: #3869D4;
    
    /* Typography */
    --font-primary: 'Nunito Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-secondary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    /* Spacing */
    --spacing-unit: 1rem;
    --spacing-xs: calc(var(--spacing-unit) * 0.25);  /* 4px */
    --spacing-sm: calc(var(--spacing-unit) * 0.5);   /* 8px */
    --spacing-md: var(--spacing-unit);               /* 16px */
    --spacing-lg: calc(var(--spacing-unit) * 1.5);   /* 24px */
    --spacing-xl: calc(var(--spacing-unit) * 2);     /* 32px */
    
    /* Border Radius */
    --border-radius-sm: 0.25rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 1rem;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-base: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s ease;
}

/* ==========================================================================
   Typography
   ========================================================================== */
body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
}

/* Heading Scale */
h1, .h1 { font-size: 2.5rem; }    /* 40px */
h2, .h2 { font-size: 2rem; }      /* 32px */
h3, .h3 { font-size: 1.75rem; }   /* 28px */
h4, .h4 { font-size: 1.5rem; }    /* 24px */
h5, .h5 { font-size: 1.25rem; }   /* 20px */
h6, .h6 { font-size: 1rem; }      /* 16px */

/* Text Styles */
.lead {
    font-size: 1.25rem;
    line-height: 1.6;
    font-weight: 300;
}

.text-small {
    font-size: 0.875rem;
    line-height: 1.4;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */
.breadcrumb {
    background: transparent;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
}

.breadcrumb-item {
    color: var(--color-primary);
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-base);
}

.breadcrumb-item a:hover {
    color: #2a4fa3;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #000;
    font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--color-secondary);
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 0.5rem;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
    --container-padding: var(--spacing-md);
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.container-narrow {
    max-width: 720px;
}

.container-wide {
    max-width: 1320px;
}

/* ==========================================================================
   Page Headers
   ========================================================================== */
.page-header {
    margin-bottom: var(--spacing-xl);
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.page-description {
    color: var(--color-secondary);
    font-size: 1rem;
}

.section-header {
    padding: var(--spacing-xl) 0;
    position: relative;
}

.section-header .pattern {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 100%);
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-md);
    transition: var(--transition-base);
    background: #fff;
}

.form-card {
    box-shadow: var(--shadow-sm);
}

.content-card {
    box-shadow: var(--shadow-sm);
}

.content-card:hover {
    box-shadow: var(--shadow-md);
}

.image-card {
    overflow: hidden;
}

.image-card .card-img-container {
    position: relative;
    overflow: hidden;
}

.image-card .card-img-container img {
    transition: var(--transition-base);
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.image-card:hover .card-img-container img {
    transform: scale(1.05);
}

/* Learning Path Cards */
.learning-path-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    border-radius: 10px;
    margin-bottom: 20px;
}

.learning-path-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* ==========================================================================
   Forms
   ========================================================================== */
.standard-form {
    max-width: 100%;
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-actions {
    margin-top: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    transition: var(--transition-base);
}

.btn-icon {
    padding: var(--spacing-sm);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-social {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* ==========================================================================
   Timeline
   ========================================================================== */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    padding-left: 40px;
    margin-bottom: 15px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #6c757d;
    z-index: 1;
}

.timeline-content {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* ==========================================================================
   Dropdowns
   ========================================================================== */
.dropdown-menu {
    min-width: 200px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: none;
    border-radius: 8px;
}

.dropdown-item {
    padding: 8px 16px;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    color: #6c757d;
}

.dropdown-item.text-danger i {
    color: #dc3545;
}

.dropdown-divider {
    margin: 0.5rem 0;
}

/* ==========================================================================
   Timer
   ========================================================================== */
.timer-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.timer-display {
    text-align: center;
}

.countdown-timer {
    font-size: 1.2rem;
    font-weight: 500;
    color: #fff;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 15px;
    border-radius: 4px;
    display: inline-block;
    margin: 5px 0;
}

#time-message {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 5px;
}

/* ==========================================================================
   Utilities
   ========================================================================== */
/* Spacing */
.m-0 { margin: 0 !important; }
.m-1 { margin: var(--spacing-xs) !important; }
.m-2 { margin: var(--spacing-sm) !important; }
.m-3 { margin: var(--spacing-md) !important; }
.m-4 { margin: var(--spacing-lg) !important; }
.m-5 { margin: var(--spacing-xl) !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: var(--spacing-xs) !important; }
.p-2 { padding: var(--spacing-sm) !important; }
.p-3 { padding: var(--spacing-md) !important; }
.p-4 { padding: var(--spacing-lg) !important; }
.p-5 { padding: var(--spacing-xl) !important; }

/* Text */
.text-primary { color: var(--color-primary) !important; }
.text-secondary { color: var(--color-secondary) !important; }
.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-info { color: var(--color-info) !important; }

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (min-width: 576px) {
    .container {
        --container-padding: var(--spacing-lg);
    }
}

@media (min-width: 768px) {
    h1, .h1 { font-size: 2.75rem; }
    h2, .h2 { font-size: 2.25rem; }
    
    .section-header {
        padding: var(--spacing-xl) 0;
    }
}

@media (min-width: 992px) {
    h1, .h1 { font-size: 3rem; }
    h2, .h2 { font-size: 2.5rem; }
    
    .container {
        --container-padding: var(--spacing-xl);
    }
}

/* ==========================================================================
   Legacy Styles (to be migrated)
   ========================================================================== */
.leaderboard_link {
    color: var(--link-1);
    text-decoration: none;
}

.leaderboard_link:hover {
    text-decoration: underline;
}

/* Module page fancy links */
.module-link {
    position: relative;
    display: inline-block;
    padding: 10px 20px;
    color: var(--link-1);
    text-decoration: none;
    transition: var(--transition-base);
}

.module-link:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.module-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
    transform: scaleX(0);
    transition: var(--transition-base);
}

.module-link:hover::after {
    transform: scaleX(1);
}

/* Custom CSS for the arrow */
.arrow-button {
    position: relative;
    padding: .5rem 2.5rem;
    display: inline-block;
    transition: 0.5s;
    /* width: 100%; */
}


.arrow-button.get-started {
    width: 50%;
}

.arrow-button:hover {
    padding-right: 24px;
    padding-left:8px;
}

.arrow-button::after {
    content: '\2192'; /* Unicode character for right arrow */
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    opacity: 0; /* Initially hidden */
    transition: 0.5s;
    right: -20px;
}

.arrow-button:hover::after {
    opacity: 1; /* Display the arrow on hover */
    right: 10px;
}

/***** For fancy links on modules page ***/
/* https://codepen.io/sowmyaseshadri/pen/PdajzN */
$pri: #128CFC;
$sec: #fffffe;
$dark-pri: #0B5AA2;

.items-body {
    padding: 10px;
    margin: 10px;
    display: grid;
    grid-gap: 10px;
    color: darkslategray;
  }
  
  .items-body-content {
    padding: 10px;
    padding-right: 0px;
    display: grid;
    grid-template-columns: 10fr 1fr;
    // background-color: lightblue;
    font-size: 16px;
    grid-gap: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
  }

  .items-body-content a {
    /* Remove underline for anchor tags inside .items-body-content */
    text-decoration: none;
  }

  .items-body-content:hover {
    border-radius: 15px;
    border: 1px solid #000;
  }

  
  .items-body-content i {
    align-self: center;
    font-size: 15px;
    color: $dark-pri;
    font-weight: bold;
    animation: icon 1.5s infinite forwards;
  }
  
  @keyframes icon {
    0%,100%{
      transform: translate(0px);
    }
    50% {
      transform: translate(3px);
    }
  }

/* custom css for the modules pages **/

  h1.module-title {
    font-weight: bolder;
    color: white;
    font-size: 50px;
  }

  .text-light-gray{
    color: lightgray;
  }

  .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Adjust the opacity as needed */
  }

  .padded-image {
      margin: 20px;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Subtle shadow */
      border-radius: 10px; /* Rounded corners */
  }

  .section-light {
       background-color: lightgray;
  }
  .py-10 {
    padding-top: 6rem !important;
    padding-bottom: 6rem !important;
}

  .bg-gradient-primary-to-secondary {
    background-color: #0061f2 !important;
    background-image: linear-gradient(135deg, #01529f 0%, rgba(105, 0, 199, 0.8) 100%) !important;
}

/* ========================================================================== */
/* Imported & Reconciled Styles from manage-challenges.css (2024-06)         */
/* ========================================================================== */

/* Feature Card */
.feature-card {
    background: #fff;
    border-radius: var(--border-radius-md);
    border: 1px solid #e9ecef;
    transition: var(--transition-base);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.feature-card-body {
    padding: 1.5rem;
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.feature-icon i {
    font-size: 24px;
    color: #3498db;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #101010;
}

/* General Card */
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #101010;
    margin-bottom: 1.5rem;
}

/* Danger Card */
.danger-card {
    border: 1px solid #fee2e2;
    border-radius: 12px;
    background-color: #fff5f5;
    transition: all 0.2s ease;
}

.danger-card:hover {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.1);
}

.danger-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Badge Preview Card */
.badge-preview-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.badge-preview-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.badge-image {
    text-align: center;
    margin-bottom: 1rem;
}

.badge-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.badge-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #101010;
    margin-bottom: 0.5rem;
}

.badge-description {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Member Card */
.member-card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.2s ease;
    background: #fff;
}

.member-card:hover {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.1);
}

.member-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #101010;
    margin-bottom: 0.5rem;
}

/* Info Box */
.info-box {
    display: flex;
    gap: 1rem;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    padding: 1rem;
}

.info-icon {
    color: #3498db;
    font-size: 1.25rem;
}

.info-content {
    flex: 1;
    font-size: 0.95rem;
}

/* Modern Alert */
.alert-modern {
    background: #fff3cd;
    border: none;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.alert-icon {
    width: 40px;
    height: 40px;
    background: #ffeeba;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-icon i {
    color: #856404;
    font-size: 20px;
}

.alert-content {
    flex: 1;
}

.alert-heading {
    color: #856404;
    margin-bottom: 0.5rem;
}

/* CSV Format Info */
.csv-format-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.format-header {
    font-weight: 600;
    color: #101010;
}

.format-content {
    background: #fff;
    border-radius: 6px;
    padding: 1rem;
}