@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

.tsf-flashcard-app-wrapper {
    font-family: 'Montserrat', sans-serif;
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: #f4f7f9;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    text-align: center;
}
.tsf-dashboard{
    font-family: 'Montserrat', sans-serif;
    background: #f4f7f9;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}
.tsf-dashboard .hidden{
    display: none;
}
.tsf-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 5px;
}

.tsf-header .tsf-card-counter {
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 25px;
}

.tsf-card {
    background-color: transparent;
    min-height: 250px;
    perspective: 1000px;
    margin-bottom: 25px;
}

.tsf-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 250px;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.tsf-card.is-flipped .tsf-card-inner {
    transform: rotateX(180deg);
}

.tsf-card-front,
.tsf-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    font-size: 22px;
    color: #34495e;
    line-height: 1.5;
}

.tsf-card-back {
    transform: rotateX(180deg);
}

.tsf-input-wrapper {
    margin-bottom: 20px;
}

.tsf-input-wrapper label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    text-align: left;
}

#tsf-answer-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
}
#tsf-answer-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

#tsf-controls {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}
#tsf-main-controls {
    width: 100%;
}
#tsf-feedback-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: space-between;
}

.tsf-button {
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.tsf-button-primary {
    background-color: #2196F3;
    color: white;
    width: 100%;
}
.tsf-button-primary:hover {
    background-color: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(33, 150, 243, 0.3);
}

/* Feedback Button Colors */
.tsf-button-again { background-color: #f44336; color: white; }
.tsf-button-hard { background-color: #FF9800; color: white; }
.tsf-button-good { background-color: #4CAF50; color: white; }
.tsf-button-easy { background-color: #03A9F4; color: white; }

#tsf-feedback-buttons .tsf-button:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}
.tsf-flip-side {
    display: block;
    width: 100%;
}
.tsf-button-read-aloud {
    width: 100%;
    margin-bottom: 10px;
    background-color: #3b82f6!important;
}
.tsf-button-read-aloud:hover {
    background-color: #2563eb;
}
.tsf-button-read-aloud.is-reading {
    background-color: #dc3545;
}
#tsf-no-cards {
    padding: 40px;
    font-size: 18px;
    color: #7f8c8d;
}

/* --- New Study Dashboard Styles --- */
/* Study Dashboard */
.tsf-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.tsf-dashboard-header h1 {
    margin: 0;
    font-size: 28px;
}
.tsf-deck-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.tsf-deck-list li {
    margin-bottom: 10px;
}
.tsf-deck-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: box-shadow 0.2s, transform 0.2s;
}
.tsf-deck-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.tsf-deck-name {
    font-size: 18px;
    font-weight: 500;
}
.tsf-deck-meta {
    font-size: 14px;
    color: #666;
}
.tsf-deck-due-count {
    color: #0073e6;
    font-weight: bold;
    margin-right: 15px;
}

/* --- NEW: Modern Toggle Switch Styles --- */
.tsf-dashboard-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}
.tsf-toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
}
/* Hide the default checkbox */
.tsf-toggle-switch input[type="checkbox"] {
    display: none;
}
/* The label acts as the container for our custom switch */
.tsf-toggle-switch label {
    cursor: pointer;
    color: #555;
    font-size: 15px;
    position: relative;
    padding-left: 50px!important; /* Space for the switch */
    line-height: 24px;   /* Vertically align text with the switch */
    user-select: none;
}
/* The track of the switch */
.tsf-toggle-switch label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 44px;
    height: 24px;
    background-color: #ccc;
    border-radius: 12px;
    transition: background-color 0.2s ease-in-out;
}
/* The thumb of the switch */
.tsf-toggle-switch label::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s ease-in-out;
}
/* Styles for when the switch is ON (checkbox is checked) */
.tsf-toggle-switch input[type="checkbox"]:checked + label::before {
    background-color: #0073e6;
}
.tsf-toggle-switch input[type="checkbox"]:checked + label::after {
    transform: translateX(20px);
}
/* --- Modal Styles --- */
#tsf-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
}
.tsf-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    z-index: 1001;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    text-align: center;
}
.tsf-modal h3 {
    margin-top: 0;
    color: #2c3e50;
}
.tsf-modal p {
    color: #555;
    margin-bottom: 20px;
}
.tsf-modal input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
}
.tsf-modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.tsf-button-secondary {
    background-color: #ecf0f1;
    color: #34495e;
    border: 1px solid #bdc3c7;
}
.tsf-button-secondary:hover {
     background-color: #d8e0e3;
}
.tsf-modal-feedback {
    margin-top: 15px;
    color: #e74c3c;
    font-weight: 600;
    display: none;
}
.tsf-other-deck-prompt {
    margin-top: 20px;
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}
.tsf-deck-name {
    font-size: 18px;
    font-weight: 500;
}

.tsf-deck-tag {
    font-size: 10px;
    font-weight: bold;
    color: #8a6d3b;
    background-color: #fcf8e3;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #faebcc;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 8px;
}

.tsf-deck-meta {
    font-size: 14px;
    color: #666;
}
/* **NEW:** Frontend Image Occlusion Styles */
.tsf-occlusion-view {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.tsf-occlusion-view img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.tsf-occlusion-view .tsf-occlusion-box {
    position: absolute;
    background-color: rgba(0, 124, 186, 0.7);
    border: 2px solid #007cba;
}
.tsf-occlusion-view .tsf-occlusion-box.question {
    background-color: rgba(220, 50, 50, 0.7);
    border-color: #dc3232;
}
.tsf-occlusion-view .tsf-occlusion-box.revealed {
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
}
.tsf-occlusion-answer {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2px 5px;
    border-radius: 3px;
    color: #333;
    font-size: 14px;
    font-weight: bold;
}
.tsf-occlusion-view { position: relative; width: 100%; height: 100%; }

.tsf-occlusion-view rect { fill: #007cba; }
.tsf-occlusion-view .interactive { cursor: pointer; }
.tsf-occlusion-view .interactive:hover { fill: #005bb5; }
.tsf-occlusion-view .revealed { opacity: 0; }
.occlusion-answer-text { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; text-align: center; background: rgba(255, 255, 255, 0.9); color: #333; font-size: 16px; font-weight: bold; padding: 5px; box-sizing: border-box; }

.tsf-occlusion-view .tsf-occlusion-box {
    fill: #007cba;
    cursor: pointer;
    transition: opacity 0.3s ease;
}
.tsf-occlusion-view .tsf-occlusion-box:hover {
    fill: #005bb5;
}
.tsf-occlusion-view .tsf-occlusion-box.revealed,.tsf-occlusion-view .is-revealed {
    opacity: 0;
    pointer-events: none;
}
.tsf-occlusion-box.hidden{
    opacity: 0;
    pointer-events: none;
}
/* **NEW:** Styles for the answer input feedback */
.tsf-input-wrapper input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}
.tsf-input-wrapper input:focus {
    border-color: #0073e6;
    box-shadow: 0 0 0 2px rgba(0, 115, 230, 0.2);
    outline: none;
}
.tsf-input-wrapper input.correct {
    border-color: #28a745;
    background-color: #e9f7ef;
}
.tsf-input-wrapper input.incorrect {
    border-color: #dc3545;
    background-color: #f8d7da;
}
div#tsf-heatmap {
    width: 100%;
}
div#tsf-heatmap svg {
  width: 100% !important;

}