/* FlashDeck version: 2026.04.24.1 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0D0D0D;
    color: white;
    font-family: 'Segoe UI', Roboto, Helvetica Neue, sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
}

.container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    position: relative;
    overflow-y: auto;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

.screen {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hamburger-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 100;
    padding: 8px;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background: white;
}

.nav-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 90;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
}

.nav-overlay.active {
    display: flex;
}

.nav-btn {
    background: transparent;
    border: 2px solid #00FFFF;
    color: #00FFFF;
    padding: 16px 48px;
    font-size: 18px;
    font-family: inherit;
    cursor: pointer;
    min-width: 200px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-btn:active {
    background: #00FFFF;
    color: #0D0D0D;
    transform: scale(0.96);
}

.header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    font-size: 24px;
    font-weight: bold;
    text-wrap: balance;
}

.active-deck-label {
    position: absolute;
    right: 92px;
    bottom: 40px;
    left: 118px;
    z-index: 3;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1.35;
    overflow: hidden;
    cursor: pointer;
    text-align: center;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.deck-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 100px;
    overflow-y: auto;
    flex: 1;
}

.deck-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.deck-item.active {
    border-color: #00FFFF;
    background: rgba(0, 255, 255, 0.1);
}

.deck-item:active {
    transform: scale(0.96);
}

.deck-name {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
}

.deck-stats {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-variant-numeric: tabular-nums;
}

.deck-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.btn {
    background: transparent;
    border: 2px solid #FF10F0;
    color: #FF10F0;
    padding: 12px 24px;
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    min-width: 120px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    border-radius: 8px;
}

.btn:active {
    background: #FF10F0;
    color: #0D0D0D;
    transform: scale(0.96);
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    min-width: auto;
}

.btn-danger {
    border-color: #FF073A;
    color: #FF073A;
}

.btn-danger:active {
    background: #FF073A;
}

.fab {
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #00FFFF;
    border: none;
    color: #0D0D0D;
    font-size: 32px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 255, 255, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab:active {
    transform: scale(0.96);
}

.deck-cycle-controls {
    position: absolute;
    left: 24px;
    bottom: 24px;
    display: flex;
    gap: 8px;
    z-index: 3;
}

.deck-cycle-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: #00FFFF;
    color: #0D0D0D;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0, 255, 255, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.deck-cycle-btn:active {
    transform: scale(0.96);
}

.deck-cycle-btn:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 200;
    display: none;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 24px;
    padding-top: max(24px, calc((100dvh - 360px) / 2));
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #1a1a1a;
    border: 2px solid #00FFFF;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 320px;
}

.modal-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 16px;
    text-wrap: balance;
}

.modal-copy {
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.7);
    text-wrap: pretty;
}

.input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px;
    font-size: 16px;
    font-family: inherit;
    border-radius: 8px;
    margin-bottom: 16px;
}

.input:focus {
    outline: none;
    border-color: #00FFFF;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-actions-stacked {
    flex-direction: column;
    gap: 8px;
}

.deck-management {
    padding: 16px;
    padding-bottom: 16px;
    overflow-y: auto;
    flex: 1;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    margin: 24px 0 12px 0;
    color: rgba(255, 255, 255, 0.8);
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.card-item:active {
    transform: scale(0.96);
}

.card-list-title {
    font-size: 16px;
    font-weight: 500;
    text-wrap: pretty;
}

.card-time {
    font-size: 14px;
    color: #00FFFF;
    margin-top: 4px;
}

.completed-card {
    background: rgba(255, 255, 255, 0.03);
}

.reactivate-btn {
    margin-top: 16px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.checkbox.checked {
    background: #00FFFF;
    border-color: #00FFFF;
}

.checkbox.checked::after {
    content: '✓';
    color: #0D0D0D;
    font-weight: bold;
}

.deck-actions-container {
    background: #0D0D0D;
    padding: 16px 16px 6px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.back-nav {
    display: flex;
    gap: 12px;
    padding: 6px 16px 16px;
}

.time-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px;
    font-size: 16px;
    font-family: inherit;
    border-radius: 8px;
    margin-bottom: 16px;
}

.time-input:focus {
    outline: none;
    border-color: #00FFFF;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: rgba(255, 255, 255, 0.5);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.card-display {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.card {
    width: 100%;
    height: 100%;
    max-width: 420px;
    max-height: 600px;
    border-radius: 24px;
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: absolute;
    touch-action: none;
    overflow: hidden;
}

.card:focus {
    outline: none;
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.15;
    pointer-events: none;
}

.card-content {
    position: relative;
    z-index: 1;
}

.flashcard-title {
    font-size: 36px;
    font-weight: bold;
    line-height: 1.3;
    word-wrap: break-word;
    text-wrap: balance;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.card-time-display {
    font-size: 24px;
    margin-top: 24px;
    font-weight: 600;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
}

.card.empty {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.card.empty .flashcard-title {
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.card.swiping-left {
    transform: translateX(-200px) rotate(-15deg);
    opacity: 0.7;
}

.card.swiping-right {
    transform: translateX(200px) rotate(15deg);
    opacity: 0.7;
}

.card.swiped {
    transform: translateX(500px) !important;
    opacity: 0;
}

.tick-animation {
    position: absolute;
    font-size: 128px;
    color: #00FFFF;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tick-animation.active {
    opacity: 1;
    transform: scale(1.2);
}

.tick-animation.fading {
    opacity: 0;
    transform: scale(1.5);
}

.back-exit-toast {
    position: fixed;
    left: 50%;
    bottom: 96px;
    z-index: 300;
    max-width: calc(100vw - 48px);
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.78);
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.2;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.back-exit-toast.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.settings-container {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    flex: 1;
}

.settings-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 24px;
}

.settings-section h3 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 16px;
}

.settings-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-input {
    display: none;
}

.import-conflict-modal {
    max-width: 360px;
}

.conflict-info {
    background: rgba(255, 7, 58, 0.1);
    border: 1px solid #FF073A;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.conflict-info h4 {
    color: #FF073A;
    margin-bottom: 8px;
}

.conflict-info ul {
    margin-left: 20px;
    color: rgba(255, 255, 255, 0.8);
}
