:root {
    --bg-color: #f9fbfd;
    --dark: #2c3e50;
    --orange: #f39c12;
    --light-grey: #ecf0f1;
    --success: #27ae60;
    --danger: #e74c3c;
    --text-main: #333;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.app-container {
    max-width: 600px;
    width: 100%;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: var(--dark);
    font-size: 2rem;
    margin: 0;
}

.subtitle {
    font-family: 'Courier New', Courier, monospace;
    color: var(--orange);
    margin-top: 5px;
}


.flashcard {
    background: #fff;
    border: 2px solid var(--light-grey);
    border-radius: 12px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    position: relative;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

#card-text {
    font-size: 1.5rem;
    font-weight: 500;
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--dark);
    color: white;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
}


.controls {
    text-align: center;
    margin-bottom: 40px;
}

.action-group {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn {
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary {
    background: var(--dark);
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: #1a252f;
}

.btn-secondary {
    background: var(--orange);
    color: #fff;
}

.btn-success {
    background: var(--success);
    color: #fff;
    flex: 1;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    flex: 1;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--dark);
    color: var(--dark);
}

.hidden {
    display: none !important;
}

.cursor-pointer {
    cursor: pointer;
    display: inline-block;
}


.add-section,
.sync-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--light-grey);
}

.input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.input-group input {
    flex: 1;
    min-width: 150px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
}

.sync-group {
    display: flex;
    gap: 10px;
}

.sync-info {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 10px;
}

.deck-controls {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

select#deck-select {
    flex: 2;
    padding: 10px;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    background-color: white;
}

.list-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--light-grey);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px dashed #eee;
    padding-bottom: 10px;
}

.list-header h3 {
    margin: 0;
    color: var(--dark);
    font-family: 'Courier New', monospace;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.mini-card {
    background: var(--bg-color);
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 6px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    word-wrap: break-word;
}

.mini-card strong {
    display: block;
    color: var(--dark);
    margin-bottom: 5px;
    font-size: 1.1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.mini-card span {
    color: #555;
    display: block;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.mini-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--orange);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.btn-delete-mini {
    width: 100%;
    padding: 5px;
    font-size: 0.85rem;
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-delete-mini:hover {
    background: var(--danger);
    color: white;
}
