/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */
:root {
    /* Color Palette */
    --color-primary: #667eea;
    --color-primary-dark: #764ba2;
    --color-secondary: #000d57;
    --color-tertiary: #16213e;
    --color-accent: #0f3460;
    
    --color-success: #27ae60;
    --color-success-light: #d4edda;
    --color-success-dark: #155724;
    --color-success-border: #c3e6cb;
    
    --color-error: #ff6b6b;
    --color-error-light: #f8d7da;
    --color-error-dark: #721c24;
    --color-error-border: #f5c6cb;
    
    --color-info: #3498db;
    --color-info-light: #d1ecf1;
    --color-info-dark: #0c5460;
    --color-info-border: #bee5eb;
    
    --color-warning: #e67e22;
    
    --color-neutral-100: #f8f9ff;
    --color-neutral-200: #f0f0f0;
    --color-neutral-300: #e0e0e0;
    --color-neutral-400: #999;
    --color-neutral-500: #e0dada;
    --color-neutral-900: #1a1a2e;
    
    --color-white: #ffffff;
    --color-overlay: rgba(255, 255, 255, 0.98);
    
    /* Spacing Scale */
    --space-xs: 6px;
    --space-sm: 10px;
    --space-md: 15px;
    --space-lg: 20px;
    --space-xl: 30px;
    --space-2xl: 40px;
    --space-3xl: 60px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 15px;
    --radius-2xl: 18px;
    --radius-3xl: 20px;
    --radius-4xl: 25px;
    --radius-round: 50%;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 25px rgba(102, 126, 234, 0.4);
    --shadow-xl: 0 12px 35px rgba(102, 126, 234, 0.5);
    --shadow-2xl: 0 40px 100px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 5px 20px rgba(102, 126, 234, 0.15);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    --font-weight-regular: 400;
    --font-weight-medium: 600;
    --font-weight-bold: 700;
    --font-weight-black: 900;
    
    /* Z-index Scale */
    --z-base: 1;
    --z-dropdown: 10;
    --z-sticky: 100;
    --z-modal: 1000;
    --z-tooltip: 2000;
}

/* ==========================================================================
   CSS Reset & Base Styles
   ========================================================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, 
        var(--color-secondary) 0%, 
        var(--color-tertiary) 50%, 
        var(--color-accent) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    color: var(--color-neutral-900);
}

/* Improve text rendering */
body,
button,
input,
select,
textarea {
    text-rendering: optimizeLegibility;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   Header Component
   ========================================================================== */
.header {
  background: var(--color-overlay);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: var(--space-md) var(--space-xl);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

/* Logo */
.logo {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: var(--font-weight-black);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: default;
}

/* Mode Toggle */
.mode-toggle {
  display: flex;
  gap: var(--space-sm);
  background: rgba(255,255,255,0.08);
  padding: 4px;
  border-radius: 999px;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.05);
}

.mode-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-neutral-400);
  background: transparent;
  transition: all var(--transition-base);
  white-space: nowrap;
  position: relative;
}

.mode-btn:hover:not(.active) {
  color: var(--color-primary);
  background: rgba(102, 126, 234, 0.1);
}

.mode-btn.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  box-shadow: 0 3px 10px rgba(102,126,234,0.4);
  transform: translateY(-1px);
}

.mode-btn:active {
  transform: scale(0.98);
}

/* ==========================================================================
   User Info Component
   ========================================================================== */
.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 16px;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.1), 
        rgba(118, 75, 162, 0.1));
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-secondary);
    border: 1px solid rgba(102, 126, 234, 0.15);
    transition: all var(--transition-base);
    text-decoration: none;
    cursor: pointer;
}

.user-info:hover {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.15), 
        rgba(118, 75, 162, 0.15));
    transform: translateY(-2px);
    text-decoration: none;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
    flex: 1;
    padding: var(--space-2xl) var(--space-lg);
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.container {
    
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: var(--radius-4xl);
    box-shadow: var(--shadow-2xl);
    margin: 10px;
    will-change: transform;
}

/* ==========================================================================
   Mode Content Transitions
   ========================================================================== */
.mode-content {
    display: none;
}

.mode-content.active {
    display: block;
    animation: fadeInUp var(--transition-slow) ease;
}

@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(20px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
    }
}

/* ==========================================================================
   Upload Area Component
   ========================================================================== */
.upload-area {
    border: 3px dashed rgba(102, 126, 234, 0.3);
    border-radius: var(--radius-3xl);
    padding: var(--space-3xl) var(--space-2xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.03), 
        rgba(118, 75, 162, 0.03));
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.05), 
        rgba(118, 75, 162, 0.05));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.upload-area:hover {
    border-color: var(--color-primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.upload-area:hover::before {
    opacity: 1;
}

.upload-area.drag-over {
    border-color: var(--color-primary);
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    font-size: clamp(3rem, 5vw, 4rem);
    margin-bottom: var(--space-lg);
    display: inline-block;
    transition: transform var(--transition-base);
}

.upload-area:hover .upload-icon {
    transform: scale(1.1) rotate(5deg);
}

.upload-text {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    font-weight: var(--font-weight-bold);
    color: var(--color-secondary);
    margin-bottom: var(--space-sm);
}

.upload-subtext {
    color: var(--color-neutral-400);
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

/* ==========================================================================
   Checklist Mode Components
   ========================================================================== */
.checklist-controls {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.add-checklist-btn {
    flex: 1;
    padding: var(--space-md);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-lg);
    font-weight: var(--font-weight-bold);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.add-checklist-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2), 
        rgba(255, 255, 255, 0));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.add-checklist-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.add-checklist-btn:hover::before {
    opacity: 1;
}

.add-checklist-btn:active {
    transform: translateY(0);
}

.checklist-section {
    background: linear-gradient(135deg, var(--color-neutral-100), var(--color-white));
    border: 2px solid rgba(102, 126, 234, 0.15);
    border-radius: var(--radius-2xl);
    padding: 25px;
    margin-bottom: var(--space-lg);
    animation: slideInLeft var(--transition-slow) ease;
    transition: all var(--transition-base);
}

.checklist-section:hover {
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: var(--shadow-sm);
}

@keyframes slideInLeft {
    from { 
        opacity: 0; 
        transform: translateX(-20px);
    }
    to { 
        opacity: 1; 
        transform: translateX(0);
    }
}

.checklist-header {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    margin-bottom: var(--space-lg);
}

.checklist-name-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
    transition: all var(--transition-base);
}

.checklist-name-input:hover {
    border-color: rgba(102, 126, 234, 0.4);
}

.checklist-name-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.delete-checklist-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--color-error);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: var(--font-weight-bold);
    transition: all var(--transition-base);
    white-space: nowrap;
}

.delete-checklist-btn:hover {
    background: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

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

.checklist-upload-area {
    border: 2px dashed rgba(102, 126, 234, 0.3);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--color-white);
}

.checklist-upload-area:hover {
    border-color: var(--color-primary-dark);
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
}

.checklist-upload-area.drag-over {
    border-color: var(--color-primary);
    background: rgba(102, 126, 234, 0.1);
}

/* ==========================================================================
   UNI DOC BUILDER MODE - Course File Contents Styles
   ========================================================================== */
   #unidocbuilderMode .container {
  display: none;
}
#unidocActions {
  justify-content: center; /* or flex-start / flex-end */
}


.cfc {
    width: 100%;
}

.cfc-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid var(--color-neutral-200);
}

.cfc-header h2 {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

/* Course Meta Grid */
.course-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.2rem;
}

.course-meta label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.course-meta strong {
    font-size: 0.8rem;
    color: var(--color-neutral-500);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.course-meta input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--color-neutral-300);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition-base);
    background: var(--color-white);
    color: var(--color-secondary);
}

.course-meta input:hover {
    border-color: rgba(102, 126, 234, 0.4);
}

.course-meta input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.course-meta input::placeholder {
    color: var(--color-neutral-400);
}

/* Group Container */
.group {
    margin:1.5rem 0;
    border: 2px solid rgba(102, 126, 234, 0.15);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    transition: all var(--transition-base);
    background: linear-gradient(135deg, var(--color-neutral-100), var(--color-white));
}

.group:hover {
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: var(--shadow-sm);
}

/* Toggle Button */
.toggle-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    padding: 1.1rem 1.5rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    text-align: left;
    transition: all var(--transition-base);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
}

.toggle-btn:hover {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    box-shadow: var(--shadow-lg);
}

.toggle-btn:active {
    transform: scale(0.98);
}

.toggle-btn.small {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    background: var(--color-neutral-400);
    border-radius: var(--radius-sm);
    margin-left: auto;
    font-weight: 600;
}

.toggle-btn.small:hover {
    background: var(--color-neutral-500);
}

/* Panel Content */
.panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background: var(--color-white);
}

.panel.active {
    max-height: 5000px;
    padding: 1.5rem;
    animation: slideDown 0.4s ease;
}

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

/* Items List */
.items {
    list-style: none;
}

.items > li {
    display: flex;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--color-neutral-100), var(--color-white));
    border-radius: var(--radius-lg);
    border: 2px solid rgba(102, 126, 234, 0.08);
    transition: all var(--transition-base);
    gap: 1rem;
}

.items > li:hover {
    border-color: rgba(102, 126, 234, 0.2);
    box-shadow: var(--shadow-hover);
    transform: translateX(5px);
}

.items > li:last-child {
    margin-bottom: 0;
}

/* Index Number */
.idx {
    min-width: 2.5rem;
    font-weight: 900;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Title */
.title {
    flex: 1;
    font-weight: 600;
    color: var(--color-secondary);
    font-size: 0.95rem;
}

/* Controls Container */
.controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all var(--transition-base);
    font-family: inherit;
}

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

.btn.upload:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

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

.btn.preview:hover:not(:disabled) {
    background: #d35400;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

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

.btn.delete:hover:not(:disabled) {
    background: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn:active:not(:disabled) {
    transform: scale(0.95);
}

/* Filename Display */
.filename {
    font-size: 0.8rem;
    color: var(--color-success);
    font-weight: 600;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sub Items */
.sub-items {
    list-style: none;
    margin: 1rem 0 0 3rem;
    padding-left: 1.5rem;
    border-left: 3px solid rgba(102, 126, 234, 0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.sub-items.active {
    max-height: 2000px;
    margin-top: 1rem;
}

.sub-items li {
    padding: 0.75rem;
    margin-bottom: 0.6rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sub-items li:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(102, 126, 234, 0.2);
    transform: translateX(3px);
}

.sub-items li:last-child {
    margin-bottom: 0;
}

.sub-title {
    flex: 1;
    color: var(--color-neutral-500);
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 200px;
}

/* File Input Hidden */
.file-input {
    display: none;
}

/* ==========================================================================
   File List Component (Shared between modes)
   ========================================================================== */
.files-list {
    margin-top: var(--space-xl);
}

.file-item {
    background: linear-gradient(135deg, var(--color-white), var(--color-neutral-100));
    padding: 18px var(--space-lg);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid rgba(102, 126, 234, 0.08);
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
}

.file-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(102, 126, 234, 0.2);
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-item::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, 
        var(--color-primary), 
        var(--color-primary-dark));
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    transition: width var(--transition-base);
}

.file-item:hover::after {
    width: 4px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
    min-width: 0;
}

.file-icon {
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-black);
    color: var(--color-white);
    font-size: 0.7rem;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base);
}

.file-item:hover .file-icon {
    transform: scale(1.1);
}

.file-icon.pdf { 
    background: linear-gradient(135deg, #e74c3c, #c0392b); 
}

.file-icon.docx { 
    background: linear-gradient(135deg, var(--color-info), #2980b9); 
}

.file-icon.pptx { 
    background: linear-gradient(135deg, var(--color-warning), #d35400); 
}

.file-icon.txt { 
    background: linear-gradient(135deg, #95a5a6, #7f8c8d); 
}

.file-icon.img { 
    background: linear-gradient(135deg, var(--color-success), #27ae60); 
}

.file-name {
    font-weight: var(--font-weight-medium);
    color: var(--color-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-file {
    background: var(--color-error);
    color: var(--color-white);
    border: none;
    width: 35px;
    height: 35px;
    min-width: 35px;
    border-radius: var(--radius-round);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-file:hover {
    transform: rotate(90deg) scale(1.1);
    background: #e74c3c;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.remove-file:active {
    transform: rotate(90deg) scale(0.95);
}

/* ==========================================================================
   Action Buttons
   ========================================================================== */
.action-buttons {
    margin-top: var(--space-xl);
    display: flex;
    gap: var(--space-md);
}

.action-btn {
    flex: 1;
    padding: 18px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-family);
    position: relative;
    overflow: hidden;
}

.combine-btn {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-white);
    box-shadow: var(--shadow-lg);
}

.combine-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2), 
        rgba(255, 255, 255, 0));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.combine-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.combine-btn:hover:not(:disabled)::before {
    opacity: 1;
}

.combine-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.combine-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.clear-btn {
    background: var(--color-neutral-200);
    color: var(--color-neutral-500);
}

.clear-btn:hover {
    background: var(--color-neutral-300);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.clear-btn:active {
    transform: translateY(0);
}

/* Ripple effect for buttons */
.action-btn::after,
.mode-btn::after,
.add-checklist-btn::after,
.delete-checklist-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: var(--radius-round);
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.action-btn:active::after,
.mode-btn:active::after,
.add-checklist-btn:active::after,
.delete-checklist-btn:active::after {
    width: 300px;
    height: 300px;
}

/* ==========================================================================
   Status Messages
   ========================================================================== */
.status-message {
    margin-top: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    font-weight: var(--font-weight-medium);
    display: none;
}

.status-message.active {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    animation: fadeInUp var(--transition-slow) ease;
}

.status-message.success {
    background: var(--color-success-light);
    color: var(--color-success-dark);
    border: 2px solid var(--color-success-border);
}

.status-message.success::before {
    content: '✓';
    display: inline-block;
    animation: successCheckmark 0.6s ease;
}

@keyframes successCheckmark {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

.status-message.error {
    background: var(--color-error-light);
    color: var(--color-error-dark);
    border: 2px solid var(--color-error-border);
}

.status-message.processing {
    background: var(--color-info-light);
    color: var(--color-info-dark);
    border: 2px solid var(--color-info-border);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

/* ==========================================================================
   Footer Component
   ========================================================================== */
.footer {
  background: rgba(30, 33, 50, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(102, 126, 234, 0.3);
  padding: 16px 20px 12px;
  margin-top: 24px;
  width: 100%;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left {
  flex: 1;
  min-width: 200px;
}

.footer-logo {
  font-weight: 700;
  font-size: 1rem;
  color: #a5b4fc;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-tagline {
  margin: 0;
  font-size: 0.75rem;
  color: #9ca3af;
  line-height: 1.3;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.footer-links a {
  color: #c7d2fe;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  position: relative;
  padding-bottom: 2px;
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: #818cf8;
  transition: width 0.3s ease;
}

.footer-links a:hover {
  color: #fff;
}

.footer-links a:hover::after {
  width: 100%;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.75rem;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 3px;
}

.footer-bottom strong {
  color: #c7d2fe;
  font-weight: 600;
}

.sponsor-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 4px 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 8px;
  transition: all 0.3s ease;
  color: #e0e7ff;
}

.sponsor-inline:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.25));
  border-color: rgba(139, 92, 246, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.sponsor-inline span {
  font-size: 0.7rem;
  font-weight: 500;
  color: #d1d5db;
}

.sponsor-logo {
  height: 20px;
  width: auto;
  object-fit: contain;
  filter: brightness(1.1);
  transition: filter 0.3s ease;
  background: white;
  padding: 2px;
  border-radius: 3px;
}

.sponsor-inline:hover .sponsor-logo {
  filter: brightness(1.2);
}

/* ==========================================================================
   Loader Component
   ========================================================================== */
.loader {
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top: 4px solid var(--color-primary);
    border-radius: var(--radius-round);
    width: 25px;
    height: 25px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: var(--space-sm);
    vertical-align: middle;
}

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

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.no-scroll {
    overflow: hidden;
}

.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
    color: var(--color-neutral-400);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-neutral-500);
    margin-bottom: var(--space-sm);
}

.empty-state-description {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ==========================================================================
   Scrollbar Styling
   ========================================================================== */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--color-neutral-200);
    border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, 
        var(--color-primary), 
        var(--color-primary-dark));
    border-radius: var(--radius-md);
    border: 2px solid var(--color-neutral-200);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, 
        var(--color-primary-dark), 
        var(--color-primary));
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--color-neutral-200);
}

/* ==========================================================================
   Selection Styling
   ========================================================================== */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--color-secondary);
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--color-secondary);
}

/* ==========================================================================
   Enhanced Drag and Drop Feedback
   ========================================================================== */
.upload-area.drag-over,
.checklist-upload-area.drag-over {
    animation: dragPulse 0.5s ease-in-out infinite alternate;
}

@keyframes dragPulse {
    from {
        transform: scale(1);
        border-color: var(--color-primary);
    }
    to {
        transform: scale(1.02);
        border-color: var(--color-primary-dark);
    }
}

.file-item.uploading {
    opacity: 0.6;
    pointer-events: none;
}

.file-item.uploading::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        var(--color-primary), 
        var(--color-primary-dark));
    animation: uploadProgress 2s ease-in-out;
}

@keyframes uploadProgress {
    from { width: 0; }
    to { width: 100%; }
}
/* Add to your existing style.css */

/* Install Button */
.install-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: none;
}

.install-container.show {
  display: block;
  animation: slideInUp 0.4s ease-out;
}

.install-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

.install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(102, 126, 234, 0.45);
}

.install-btn:active {
  transform: translateY(0);
}

.install-btn .icon {
  font-size: 20px;
}

.close-install {
  position: absolute;
  top: -8px;
  right: -8px;
  background: white;
  border: 2px solid #667eea;
  color: #667eea;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.2s ease;
}

.close-install:hover {
  background: #667eea;
  color: white;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .install-container {
    bottom: 15px;
    right: 15px;
  }

  .install-btn {
    padding: 12px 20px;
    font-size: 14px;
  }
}
.ios-install-prompt {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  z-index: 1000;
  max-width: 90%;
  text-align: center;
  animation: slideInUp 0.4s ease-out;
}

.ios-install-prompt .close-install {
  position: absolute;
  top: -8px;
  right: -8px;
}

/* Progress Bar Styles - Add anywhere in your CSS file */
.progress-container {
  display: none;
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border-radius: 15px;
  border: 2px solid rgba(102, 126, 234, 0.2);
  position: relative;
  width: 100%;
}

.progress-container.active {
  display: block;
  animation: fadeInUp 0.5s ease;
}

.progress-bar-wrapper {
  width: 100%;
  height: 30px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.progress-text {
  margin-top: 10px;
  text-align: center;
  font-weight: 600;
  color: white;
  font-size: 14px;
}

/* Adjust action buttons to prevent expansion */
.action-buttons {
  position: relative;
  flex-wrap: wrap;
}
/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    :root {
        --space-xl: 20px;
        --space-2xl: 30px;
    }
    
    .header-content, 
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .mode-toggle {
        width: 100%;
        flex-wrap: wrap;
    }

    .mode-btn {
        flex: 1;
        min-width: 120px;
        padding: var(--space-sm) var(--space-md);
    }

   
    .action-buttons {
        flex-direction: column;
    }

    .checklist-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .delete-checklist-btn {
        width: 100%;
    }
    
    .upload-area {
        padding: var(--space-2xl) var(--space-lg);
    }
    
    .file-item {
        padding: var(--space-md);
    }
    
    .file-name {
        font-size: 0.9rem;
    }

    .cfc {
        padding: 1.5rem;
    }

    .course-meta {
        grid-template-columns: 1fr;
    }

    .items > li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .controls {
        width: 100%;
        justify-content: flex-start;
    }

    .sub-items {
        margin-left: 1rem;
        padding-left: 1rem;
    }

    .footer {
        padding: 14px 16px 10px;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        padding-bottom: 10px;
    }

    .footer-left {
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
        font-size: 0.95rem;
    }

    .footer-tagline {
        font-size: 0.7rem;
    }

    .footer-links {
        justify-content: center;
        gap: 16px;
    }

    .footer-links a {
        font-size: 0.75rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        padding-top: 8px;
        gap: 10px;
    }

    .footer-bottom p {
        justify-content: center;
        font-size: 0.7rem;
    }

    .sponsor-inline {
        width: auto;
        padding: 3px 10px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: var(--space-md) var(--space-lg);
    }
    
    .main-content {
        padding: var(--space-lg) var(--space-sm);
    }
    
    .container {
        padding: var(--space-lg);
    }
    
    .footer {
        padding: 12px 16px 8px;
    }
    
    .checklist-controls {
        flex-direction: column;
    }

    .cfc {
        padding: 1rem;
        border-radius: var(--radius-xl);
    }

    .cfc-header h2 {
        font-size: 1.5rem;
    }

    .toggle-btn {
        font-size: 0.9rem;
        padding: 0.9rem 1rem;
    }

    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
    }

    .sponsor-inline {
        padding: 3px 10px;
    }

    .sponsor-logo {
        height: 18px;
    }

    .sponsor-inline span {
        font-size: 0.65rem;
    }
}

@media (max-width: 1024px) {
    html {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .header,
    .footer,
    .mode-toggle,
    .action-buttons,
    .remove-file,
    .delete-checklist-btn {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .container {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    @page {
        margin: 2cm;
    }
    
    .file-item,
    .checklist-section {
        page-break-inside: avoid;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* ==========================================================================
   Accessibility - Reduced Motion Support
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   Accessibility - High Contrast Mode Support
   ========================================================================== */
@media (prefers-contrast: high) {
    .upload-area,
    .checklist-upload-area {
        border-width: 4px;
    }
    
    .mode-btn.active,
    .combine-btn {
        border: 2px solid var(--color-white);
    }
}

/* Remove the @media query and apply dark mode styles directly */

:root {
    --color-overlay: rgba(26, 26, 46, 0.95);
    --color-neutral-100: #2a2a3e;
    --color-neutral-200: #333349;
    --color-neutral-300: #3d3d54;
    --color-neutral-900: #e8e8f0;
    --color-white: #1a1a2e;
}

body {
    background: linear-gradient(135deg, #0a0a14 0%, #0d111f 50%, #0a1929 100%);
    color: #e8e8f0;
}

.header {
    background: rgba(26, 26, 46, 0.95);
    border-bottom-color: rgba(102, 126, 234, 0.3);
}

.container {
    background: rgba(26, 26, 46, 0.85);
}

.upload-text,
.file-name,
.logo,
.title {
    color: #e8e8f0;
}

.upload-subtext,
.sub-title {
    color: #9ca3af;
}

.mode-toggle {
    background: rgba(42, 42, 62, 0.5);
}

.mode-btn {
    color: #9ca3af;
}

.mode-btn:hover:not(.active) {
    color: #c7d2fe;
}

.upload-area,
.checklist-upload-area {
    background: linear-gradient(135deg, rgba(42, 42, 62, 0.3), rgba(31, 31, 46, 0.3));
    border-color: rgba(102, 126, 234, 0.4);
}

.checklist-section {
    background: linear-gradient(135deg, #2a2a3e, #1f1f2e);
    border-color: rgba(102, 126, 234, 0.3);
}

.file-item,
.items > li {
    background: linear-gradient(135deg, #2a2a3e, #252535);
    border-color: rgba(102, 126, 234, 0.15);
}

.checklist-name-input,
.course-meta input {
    background: #2a2a3e;
    color: #e8e8f0;
    border-color: rgba(102, 126, 234, 0.3);
}

.checklist-name-input::placeholder,
.course-meta input::placeholder {
    color: #6b7280;
}

.panel {
    background: #1f1f2e;
}

.sub-items li {
    background: rgba(42, 42, 62, 0.6);
    border-color: rgba(102, 126, 234, 0.15);
}

.sub-items li:hover {
    background: rgba(42, 42, 62, 0.9);
}

.clear-btn {
    background: #333349;
    color: #e8e8f0;
}

.clear-btn:hover {
    background: #3d3d54;
}
