* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    animation: fadeIn 0.4s ease-in forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

body.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: scale(0.98);
    }
}

body:not(.dashboard-container) {
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease-out;
}

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

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-hint {
    display: block;
    margin-top: 6px;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

.tooltip-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    line-height: 16px;
    cursor: help;
    margin-left: 4px;
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e4e8;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.btn {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.4);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: translateY(0);
    box-shadow: none;
}

.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.success {
    background: #efe;
    border: 1px solid #cfc;
    color: #3c3;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

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

.link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

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

.btn-link {
    background: none;
    border: none;
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: opacity 0.2s;
}

.btn-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.btn-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.verify-actions {
    text-align: center;
    margin-top: 24px;
}

.verify-actions p {
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
}

.divider {
    margin: 20px 0;
    color: #999;
    font-size: 14px;
    text-align: center;
}

/* Dashboard styles */
.header {
    background: white;
    padding: 20px 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header h1 {
    margin: 0;
    color: #667eea;
}

.app-title-link {
    color: #667eea;
    text-decoration: none;
    transition: opacity 0.2s;
}

.app-title-link:hover {
    opacity: 0.8;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-icon {
    font-size: 16px;
    margin-right: 6px;
}

.btn-secondary {
    padding: 8px 16px;
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    width: auto;
}

.btn-secondary:hover {
    background: #e5e5e5;
}

.main-content {
    padding: 40px;
    margin-top: 80px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.dashboard-container {
    background: transparent;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Sets section */
.sets-section {
    margin-bottom: 50px;
}

/* Sets header */
.sets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e4e8;
}

.sets-header h2 {
    color: #333;
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* Sets grid */
.sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.empty-state {
    color: #666;
    text-align: center;
    font-size: 18px;
    grid-column: 1 / -1;
    padding: 40px;
}

.set-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.set-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.set-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.set-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.4;
}

.set-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.icon-btn:hover {
    opacity: 1;
}

.star-btn {
    font-size: 18px;
    opacity: 0.4;
}

.star-btn.starred {
    opacity: 1;
}

.star-btn:hover {
    opacity: 0.8;
}

.star-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #666;
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 4px;
}

.set-description {
    color: #666;
    margin: 0 0 12px 0;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.set-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.set-meta {
    color: #999;
    font-size: 12px;
    margin: 0;
}

.create-set-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(255, 255, 255, 0.5);
    min-height: 150px;
}

.create-set-card:hover {
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.create-set-content {
    text-align: center;
    color: white;
}

.create-set-icon {
    font-size: 48px;
    font-weight: 300;
    margin-bottom: 8px;
}

.create-set-card h3 {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 500;
}

/* Account Page */
.account-container {
    max-width: 800px;
    margin: 0 auto;
}

.account-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.account-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.account-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.account-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item label {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.info-item p {
    color: #333;
    font-size: 16px;
    margin: 0;
}

.info-text {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.info-text a {
    color: #667eea;
    text-decoration: none;
}

.info-text a:hover {
    text-decoration: underline;
}

.warning-text {
    color: #ff6b6b;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

/* Danger zone section */
.danger-section {
    border: 2px solid #ff6b6b;
    background: #fff5f5;
}

.danger-section h3 {
    color: #ff6b6b;
}

.btn-danger {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-danger:hover:not(:disabled) {
    background: #ff5252;
}

.btn-danger:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #333;
    font-size: 24px;
}

.modal-content p {
    margin-bottom: 12px;
    color: #666;
    line-height: 1.6;
}

.modal-content ul {
    margin: 12px 0 16px 24px;
    color: #666;
}

.modal-content ul li {
    margin-bottom: 8px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions button {
    flex: 1;
}

/* Search */
.search-container {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e4e8;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Pagination */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 20px 0;
}

.pagination-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e1e4e8;
    background: white;
    color: #333;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.pagination-btn:hover:not(:disabled) {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: scale(1.05);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #e1e4e8;
}

.page-numbers {
    display: flex;
    gap: 4px;
    align-items: center;
}

.page-number {
    min-width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: white;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0 8px;
}

.page-number:hover {
    background: #f0f0f0;
    color: #333;
}

.page-number.active {
    background: #667eea;
    color: white;
    font-weight: 600;
}


/* Alert Modal */
.alert-modal .modal-content {
    max-width: 400px;
    text-align: center;
    padding: 20px 24px;
}

.alert-modal .alert-message {
    color: #333;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 0;
}

.alert-modal.error .modal-content {
    border-left: 4px solid #e74c3c;
}

.alert-modal.warning .modal-content {
    border-left: 4px solid #f39c12;
}

.alert-modal.info .modal-content {
    border-left: 4px solid #3498db;
}

.alert-modal.success .modal-content {
    border-left: 4px solid #27ae60;
}

.alert-modal .alert-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.alert-modal .btn {
    width: auto;
    min-width: 100px;
}

textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e4e8;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Flashcard Set Viewer */
.set-page-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.set-viewer-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.back-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 10px;
}

.back-link:hover {
    text-decoration: underline;
}

.set-title-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e4e8;
    margin-bottom: 20px;
}

.set-viewer-header h2 {
    color: #333;
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.5px;
    flex: 1;
}

.set-title-row .star-btn {
    font-size: 24px;
    flex-shrink: 0;
}

/* Browse Controls */
.browse-controls {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.browse-btn {
    padding: 10px 16px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.browse-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

.browse-btn:focus {
    outline: none;
}

.browse-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.browse-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: white;
    color: #667eea;
    border-color: #667eea;
}

/* Flashcard Viewer */
.flashcard-viewer {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.flashcard-container {
    perspective: 1000px;
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    position: relative;
}

.flashcard-front .card-action-buttons,
.flashcard-back .card-action-buttons {
    position: absolute;
    top: 20px;
    right: 30px;
    display: flex;
    gap: 8px;
    z-index: 5;
    opacity: 1;
    transition: opacity 0.3s;
}

/* Hide buttons during flip transition */
.flashcard.flipping .card-action-buttons {
    opacity: 0;
}

/* Show front buttons only when card is not flipped */
.flashcard:not(.flipped) .flashcard-front .card-action-buttons {
    display: flex;
}

.flashcard:not(.flipped) .flashcard-back .card-action-buttons {
    display: none;
}

/* Show back buttons only when card is flipped */
.flashcard.flipped .flashcard-front .card-action-buttons {
    display: none;
}

.flashcard.flipped .flashcard-back .card-action-buttons {
    display: flex;
}

.card-action-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.2s, transform 0.2s;
    padding: 4px;
}

.card-action-btn.edit-delete-btn {
    display: none;
}

.card-action-btn.edit-delete-btn.show {
    display: block;
}

.card-action-btn:hover {
    opacity: 0.6;
    transform: scale(1.1);
}

.card-action-btn.flagged {
    opacity: 1;
}

.flashcard {
    width: 100%;
    max-width: 800px;
    height: 400px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
}

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

.flashcard.no-transition {
    transition: none;
}

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

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

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

.card-label {
    position: absolute;
    top: 20px;
    left: 30px;
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-content {
    font-size: 32px;
    color: #333;
    text-align: center;
    word-wrap: break-word;
    max-width: 100%;
}

.create-first-card-btn {
    font-size: 16px;
    padding: 12px 24px;
}

.card-progress {
    position: absolute;
    bottom: 20px;
    right: 30px;
    font-size: 12px;
    color: #999;
    font-weight: 500;
}

/* Flashcard Controls */
.flashcard-controls {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 40px;
    margin-bottom: 20px;
}

.center-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.control-btn {
    padding: 12px 20px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    outline: none;
    min-width: 130px;
    justify-content: center;
}

.control-btn:focus {
    outline: none;
}

.control-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

.control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-arrow {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    position: relative;
    top: -5px;
}

.btn-text {
    font-size: 16px;
    line-height: 1;
}

.flip-arrow {
    font-size: 20px;
    top: 0;
}

.flip-btn {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    flex-direction: column;
    gap: 6px;
    min-width: 90px;
    padding: 8px 16px;
    font-size: 14px;
}

.flip-btn .btn-text {
    font-size: 14px;
}

.flip-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

.flip-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.card-counter {
    color: white;
    font-size: 20px;
    font-weight: 600;
    min-width: 100px;
    text-align: center;
}

/* Cards List Section */
.cards-list-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
}

.cards-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e4e8;
    cursor: pointer;
    margin-bottom: 0;
}

.cards-list-header h3 {
    margin: 0;
    color: #333;
    font-size: 22px;
    font-weight: 600;
}

.toggle-cards-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #667eea;
    transition: all 0.2s;
    padding: 8px;
    width: 36px;
    height: 36px;
}

.toggle-cards-btn:hover {
    color: #5568d3;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
}

.chevron {
    transition: transform 0.3s ease;
    font-weight: bold;
}

.cards-list-section.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}

.cards-list-section {
    max-height: 5000px;
    opacity: 1;
    margin-top: 30px;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}

.cards-list-section.collapsed ~ .cards-list-header .chevron,
.cards-list-header.collapsed .chevron {
    transform: rotate(-90deg);
}

.cards-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.cards-list .empty-state {
    color: #666;
    text-align: center;
    font-size: 16px;
    padding: 40px;
    grid-column: 1 / -1;
}

.cards-list-section .pagination-controls {
    padding: 20px 30px;
}

.card-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.2s;
    cursor: pointer;
    border: 2px solid #e1e4e8;
    min-height: 100px;
    position: relative;
}

.card-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-item.flagged {
    border-color: #e74c3c;
}

.card-item.active {
    background: rgba(102, 126, 234, 0.08);
    border-color: #667eea;
    border-width: 2px;
}

.card-item.active:hover {
    background: rgba(102, 126, 234, 0.12);
    border-color: #667eea;
}

.card-item.active.flagged {
    border-color: #e74c3c;
}

.card-item-content {
    flex: 1;
    min-width: 0;
    padding-right: 40px;
}

.card-item-content strong {
    display: block;
    color: #333;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
}

.card-item-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.add-card-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px dashed rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-card-item:hover {
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.add-card-icon {
    font-size: 64px;
    font-weight: 300;
    color: white;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    html, body {
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
    }

    .header {
        padding: 15px 20px;
    }

    .header h1 {
        font-size: 20px;
    }

    .main-content {
        padding: 20px;
        margin-top: 70px;
    }

    .set-viewer-header h2 {
        font-size: 20px;
    }

    .flashcard {
        height: 300px;
        max-width: 100%;
    }

    .card-content {
        font-size: 24px;
    }

    .flashcard-controls {
        gap: 15px;
        flex-wrap: wrap;
    }

    .control-btn {
        min-width: 100px;
        padding: 10px 16px;
        font-size: 14px;
    }

    .btn-arrow {
        font-size: 20px;
    }

    .flip-arrow {
        font-size: 18px;
    }

    .card-counter {
        font-size: 18px;
    }

    .cards-list {
        grid-template-columns: 1fr;
    }

    .sets-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px 15px;
    }

    .header h1 {
        font-size: 18px;
    }

    .main-content {
        padding: 15px;
    }

    .flashcard {
        height: 250px;
    }

    .card-content {
        font-size: 20px;
    }

    .flashcard-controls {
        gap: 10px;
    }

    .control-btn {
        min-width: 80px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .btn-arrow {
        font-size: 18px;
    }

    .flip-arrow {
        font-size: 16px;
    }

    .set-card {
        padding: 16px;
    }
}

/* Toggle Switch Styling */
.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.toggle-text {
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-input:checked + .toggle-slider {
    background-color: #667eea;
}

.toggle-input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* OR Divider */
.divider-or {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #999;
    font-size: 14px;
}

.divider-or::before,
.divider-or::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e1e4e8;
}

.divider-or span {
    padding: 0 15px;
    font-weight: 500;
}

/* Google Sign-In Button */
.btn-google {
    width: 100%;
    padding: 12px;
    background: white;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #dadce0;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}

.google-icon {
    width: 18px;
    height: 18px;
}

/* Drag-and-Drop Styling */
.drag-handle {
    position: absolute;
    top: 8px;
    right: 8px;
    cursor: grab;
    color: #999;
    font-size: 18px;
    padding: 4px 8px;
    user-select: none;
    z-index: 1;
}

.drag-handle:active {
    cursor: grabbing;
}

.card-item-ghost {
    opacity: 0.4;
    background: #f0f0f0;
}

.card-item-chosen {
    background: #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.card-item-drag {
    opacity: 0.8;
    transform: rotate(2deg);
}
