.flashcards-container {
    width: 100%;
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    box-sizing: border-box;
}

.flashcards-deck {
    width: 100%;
    max-width: 600px;
    height: 400px;
    margin: 0 auto 120px auto;
    position: relative;
    perspective: 2000px;
    transform-style: preserve-3d;
}

.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background: #fff;
    border: 1px solid #ddd;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}

.flashcard-front {
    transform: rotateY(0deg);
    z-index: 2;
}

.flashcard-back {
    transform: rotateY(180deg);
    z-index: 1;
}

.card-content {
    width: 90%;
    max-height: 60%;
    overflow-y: auto;
    margin: 0 auto;
    padding: 20px;
    font-size: 18px;
    line-height: 1.6;
    text-align: center;
}

.response-buttons {
    width: 100%;
    padding: 20px;
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: auto;
}

.response-buttons button {
    width: auto !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    font-weight: 400 !important;
    font-style: normal !important;
    text-transform: uppercase !important;
    letter-spacing: 0em !important;
    border-radius: 3rem !important;
    padding: 0.8em 2em !important;
    border: none !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    margin: 0 5px;
}

.knew-it {
    background: #06784F !important;
}

.knew-it:hover {
    background: #06784F !important;
    transform: translateY(-2px);
    opacity: 0.9;
}

.didnt-know {
    background: #B22D25 !important;
}

.didnt-know:hover {
    background: #B22D25 !important;
    transform: translateY(-2px);
    opacity: 0.9;
}

.response-buttons button:active {
    transform: translateY(0);
}

.response-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.knew-it {
    background-color: #4CAF50;
    color: white;
}

.knew-it:hover {
    background-color: #45a049;
}

.didnt-know {
    background-color: #f44336;
    color: white;
}

.didnt-know:hover {
    background-color: #da190b;
}

/* Fix for Safari */
.flashcard-front, .flashcard-back {
    -webkit-transform-style: preserve-3d;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Ensure content is readable */
.flashcard-front, .flashcard-back {
    font-size: 1.2em;
    line-height: 1.5;
}

/* Improve button styles */
.flashcard-controls button {
    padding: 10px 20px;
    margin: 0 5px;
    border: none;
    border-radius: 4px;
    background-color: #2196F3;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.flashcard-controls button:hover:not(:disabled) {
    background-color: #1976D2;
}

.flashcard-controls button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Add some animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.flashcard {
    animation: fadeIn 0.3s ease-in;
}

/* Deck Summary Styles */
.deck-summary {
    text-align: center;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin: 20px auto;
    max-width: 600px;
    animation: fadeIn 0.5s ease-in;
}

.deck-summary h3 {
    color: #2196F3;
    font-size: 24px;
    margin-bottom: 20px;
}

.summary-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    background: #f5f5f5;
    padding: 15px 25px;
    border-radius: 8px;
    min-width: 150px;
}

.stat-label {
    display: block;
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.known-count .stat-value {
    color: #4CAF50;
}

.unknown-count .stat-value {
    color: #f44336;
}

.success-rate .stat-value {
    color: #2196F3;
}

.deck-actions {
    margin-top: 20px;
}

.restart-deck {
    background: #2196F3;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.restart-deck:hover {
    background: #1976D2;
}

/* Animation for summary appearance */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.deck-summary {
    animation: slideUp 0.5s ease-out;
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 20px;
    box-sizing: border-box;
    transition: box-shadow 0.3s ease, transform 0.1s ease;
}

/* Only make front of card clickable with hover effects */
.flashcard-front {
    cursor: pointer;
}

.flashcard-front:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.flashcard-back {
    transform: rotateY(180deg);
    opacity: 0;
    visibility: hidden;
}

.flashcard.flipped .flashcard-back {
    opacity: 1;
    visibility: visible;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-controls {
    width: 100%;
    max-width: 600px;
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: -100px auto 20px;
    padding: 0 20px;
    box-sizing: border-box;
    position: relative;
    z-index: 100;
}

.flashcard-controls button {
    width: auto !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    font-weight: 400 !important;
    font-style: normal !important;
    text-transform: uppercase !important;
    letter-spacing: 0em !important;
    border-radius: 3rem !important;
    padding: 0.8em 2em !important;
    background: #13455b;
    border: none !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    margin: 0 5px;
}

.flashcard-controls button:hover:not(:disabled) {
    background: rgb(19, 69, 91);
    transform: translateY(-2px);
    opacity: 0.9;
}

.flashcard-controls button:active:not(:disabled) {
    transform: translateY(0);
}

.flashcard-controls button:disabled {
    background: #cccccc !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.flashcard-progress {
    text-align: center;
    margin: 20px 0;
    color: #666;
    font-size: 16px;
    width: 100%;
}

.response-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.response-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.knew-it {
    background: #4CAF50;
    color: white;
}

.knew-it:hover {
    background: #388E3C;
}

.didnt-know {
    background: #f44336;
    color: white;
}

.didnt-know:hover {
    background: #d32f2f;
}

.flashcards-progress {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

.flashcards-progress h2 {
    color: #2196F3;
    margin-bottom: 30px;
    text-align: center;
}

.progress-summary {
    margin-bottom: 40px;
}

.summary-box {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 30px;
}

.summary-box h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    text-align: center;
}

.stat-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-label {
    display: block;
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #2196F3;
}

.flashcards-progress table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.flashcards-progress th,
.flashcards-progress td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.flashcards-progress th {
    background: #f5f5f5;
    font-weight: bold;
    color: #333;
}

.flashcards-progress tr:hover {
    background: #f8f9fa;
}

.flashcards-progress td:nth-child(4),
.flashcards-progress td:nth-child(5) {
    text-align: center;
}

.flashcards-progress td:nth-child(5) {
    font-weight: bold;
}

/* Success rate colors */
.flashcards-progress td:nth-child(5) {
    color: #666;
}

.flashcards-progress tr[data-success-rate="high"] td:nth-child(5) {
    color: #4CAF50;
}

.flashcards-progress tr[data-success-rate="medium"] td:nth-child(5) {
    color: #FF9800;
}

.flashcards-progress tr[data-success-rate="low"] td:nth-child(5) {
    color: #f44336;
}