:root {
  --primary-color: #3490dc;
  --primary-hover-color: #2779bd;
  --text-color: #333;
  --border-radius: 5px;
  --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --secondary-color: #3b82f6;
  --hover-color: #f59e0b;
  --background-light: #f7fafc;
  --background-dark: #1a1a1a;
  --text-light: #000000;
  --text-dark: #ffffff;
  --shadow-color: rgba(0, 0, 0, 0.2);
}

  .swipe-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
  }

  .swipe-wrapper {
    display: flex;
    width: 100%;
    transition: transform 0.3s ease;
}

.swipe-slide {
    flex: 0 0 100%;
    padding: 16px;
}
.swipe-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--shadow-color);
    color: var(--text-dark);
    border: none;
    padding: 8px;
    cursor: pointer;
    z-index: 1;
}

.swipe-button-prev {
    left: 0;
}

.swipe-button-next {
    right: 0;
}

  .hidden {
    display: none;
  }


  .flow-step {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}


.flow-step img {
    width: 50px;
    height: 50px;
    margin-right: 1rem;
}
.flow-step-content {
    flex: 1;
}
.flow-step-number {
    background-color: var(--primary-color);
    color: var(--text-dark);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}
.flow-container {
    background-color: var(--background-light);
    padding: 2rem;
    border-radius: 0.5rem;
}

/* Modern Styling for Cramming AI Home */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 10px;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    margin-left: 20px;
}

/* Section Styling */
section {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease-in-out;
}

/* Headers */
h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
}

/* Book Library */
#library-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    #library-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

.book {
    background: var(--background-light);
    color: var(--text-light);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.book-title {
    font-size: 1.2em;
    margin: 0 0 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%; 
}

.book-title:hover::after {
    content: attr(title);
    position: absolute;
    background-color: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    top: 100%; /* Mostra il tooltip sotto il testo */
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 10;
    opacity: 1;
    visibility: visible;
}

.book-title::after {
    content: attr(title);
    position: absolute;
    background-color: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    top: 100%; /* Nascondi il tooltip inizialmente */
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
}

.book-label {
    font-weight: bold;
}

.book-content {
    display: flex;
    flex-wrap: wrap;
}

.book-item {
    flex: 1 1 100%;
    display: flex;
    justify-content: space-between;
}

@media (max-width: 600px) {
    #library-modal {
        padding: 15px;
    }

    h2 {
        font-size: 1.2em;
    }

    .book-title {
        font-size: 1em;
    }

    .book-item {
        font-size: 0.9em;
    }
}

/* Scores */
#scores-container p {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 5px;
}

/* Flashcards */
.flashcard {
    background: var(--background-light);
    color: var(--text-light);
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.flashcard:hover {
    transform: rotate(-2deg);
}

/* Challenge Button */
#start-challenge {
    background: #3b82f6;
    color: black;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    /* transition: all 0.3s ease; */
}

#start-challenge:hover {
    background: #f59e0b;
    transform: scale(1.05);
}

/* Dark mode styles */
.dark {
    background-color: var(--background-dark);
    color: var(--text-dark);
}

.dark .book,
.dark .flashcard,
.dark .action-card {
    background: #2d2d2d;
    color: var(--text-dark);
}

.dark .sidebar {
    background: rgba(0, 0, 0, 0.2);
}

.dark #start-challenge {
    background: var(--primary-color);
    color: var(--text-dark);
}

.dark #start-challenge:hover {
    background: var(--hover-color);
}

/* Loading skeleton animation */
.loading-skeleton {
    animation: skeleton-loading 1s linear infinite alternate;
    background: #f6f7f8;
    border-radius: 4px;
    height: 200px;
}

@keyframes skeleton-loading {
    0% { background-color: #f6f7f8; }
    100% { background-color: #e9ebee; }
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* Improved transitions */
.section-transition {
    transition: all 0.3s ease-in-out;
}

/* Quick actions styling */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-card {
    background: var(--background-light);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.2s;
    cursor: pointer;
}

.action-card:hover {
    transform: translateY(-5px);
}

@media (prefers-reduced-motion: reduce) {
  .section-transition,
  .book,
  .flashcard,
  .action-card,
  section {
    transition: none;
  }
}

/* Add dark mode styles for missing components */
.dark .flow-container {
    background-color: #2d2d2d;
}

.dark .loading-skeleton {
    background: #333;
}

.dark .empty-state {
    color: #999;
}

.dark #scores-container p {
    background: rgba(255, 255, 255, 0.1);
} 

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: bold;
    display: inline-block;
}

.status-complete {
    background-color: #38a169; /* Green 600 */
    color: white;
}

.status-uploading {
    background-color: #e53e3e; /* Red 600 */
    color: white;
}

.button-group button {
    min-width: 80px;
    text-align: center;
}

@media (max-width: 600px) {
    #library-modal {
        padding: 15px;
    }

    h2 {
        font-size: 1.2em;
    }

    .book-title {
        font-size: 1em;
        max-width: 150px; /* Aggiungi questa riga per ridurre ulteriormente la larghezza massima sui dispositivi mobili */
    }

    .book-item {
        font-size: 0.9em;
    }
}

.relative:hover .tooltip-content {
    display: block;
}

.tooltip-content {
    display: none;
    position: absolute;
    z-index: 10;
    background-color: white;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 10px;
    width: 250px;
}