/* StudyApp Custom Styles */

/* 글씨 크게: 기본 18px */
html {
    font-size: 18px;
}

body {
    background-color: #f8f9fa;
    font-size: 1rem;
}

.navbar {
    padding: 0.4rem 0;
}

/* 상큼한 핑크 GNB */
.navbar-pink {
    background: linear-gradient(90deg, #f9a8d4, #f472b6);
}

.navbar-pink .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-pink .nav-link:hover,
.navbar-pink .nav-link:focus {
    color: #fff !important;
}

.brand-logo {
    flex-shrink: 0;
}

/* GNB 아래 공지 배너 */
.notice-banner {
    background-color: #fff0f6;
    border-bottom: 1px solid #fcc2d7;
    color: #a61e4d;
    padding: 0.6rem 0;
}

.notice-content {
    white-space: pre-line;
}

.navbar-brand {
    font-weight: bold;
    padding: 0.4rem 0;
}

.nav-link {
    padding: 0.5rem 1rem !important;
}

.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: none;
    margin-bottom: 1rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
}

.card-body {
    padding: 1rem 1.25rem;
}

.card-title {
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.card-text {
    margin-bottom: 0;
}

.table {
    margin-bottom: 0;
}

.dashboard-table {
    white-space: nowrap;
}

.table th {
    font-weight: 600;
    color: #495057;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
}

.table td {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    vertical-align: middle;
}

.badge {
    font-weight: 500;
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 0.5rem 0 !important;
}

/* Dashboard summary cards */
.card.text-bg-primary,
.card.text-bg-info,
.card.text-bg-success,
.card.text-bg-danger {
    border: none;
}

.card.text-bg-primary .card-body,
.card.text-bg-info .card-body,
.card.text-bg-success .card-body,
.card.text-bg-danger .card-body {
    padding: 0.75rem 1rem;
}

.card.text-bg-primary h4,
.card.text-bg-info h4,
.card.text-bg-success h4,
.card.text-bg-danger h4 {
    font-size: 1.25rem;
    margin-bottom: 0;
}

/* Row/Column spacing */
.row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 0.75rem;
}

/* Buttons - 손가락으로 누르기 쉽게 크게 */
.btn {
    padding: 0.65rem 1.1rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 0.9rem;
    font-size: 1rem;
}

/* Alerts */
.alert {
    border: none;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

h2 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.1rem;
    margin-bottom: 0;
}

.dashboard-titlebar {
    gap: 0.75rem;
}

.dashboard-actions {
    flex-wrap: wrap;
}

.usdt-position {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.usdt-position:first-child {
    padding-top: 0;
}

.usdt-position:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.usdt-position-header {
    margin-bottom: 0.6rem;
}

.usdt-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

.usdt-summary div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.usdt-summary span {
    font-size: 0.78rem;
}

.usdt-summary strong {
    font-size: 0.9rem;
    font-weight: 600;
}

.usdt-order-uuid {
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Form styles */
.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Table hover effect */
.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Alert styles */
.alert {
    border: none;
}

/* Button styles */
.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

@media (max-width: 576px) {
    html {
        font-size: 18px;
    }

    body {
        line-height: 1.35;
    }

    main.container {
        margin-top: 0.75rem !important;
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }

    .navbar {
        padding: 0.25rem 0;
    }

    .navbar .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .nav-link {
        padding: 0.45rem 0.75rem !important;
    }

    .dashboard-titlebar {
        align-items: flex-start !important;
        flex-direction: column;
    }

    .dashboard-actions {
        width: 100%;
    }

    .dashboard-actions .btn {
        flex: 1 1 9rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    h5 {
        font-size: 1rem;
    }

    .card-header {
        padding: 0.55rem 0.75rem;
    }

    .card-body {
        padding: 0.7rem 0.75rem;
    }

    .card-title {
        font-size: 0.78rem;
    }

    .card.text-bg-primary h4,
    .card.text-bg-info h4,
    .card.text-bg-success h4,
    .card.text-bg-danger h4 {
        font-size: 1rem;
    }

    .table th,
    .table td {
        padding: 0.42rem 0.5rem;
        font-size: 0.78rem;
    }

    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.45rem;
    }

    .btn {
        padding: 0.65rem 0.8rem;
        font-size: 1.1rem;
    }

    .btn-sm {
        padding: 0.5rem 0.7rem;
        font-size: 1rem;
    }

    .usdt-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .usdt-summary strong {
        font-size: 0.82rem;
    }

    .footer {
        font-size: 0.72rem;
    }
}

@media (max-width: 360px) {
    html {
        font-size: 17px;
    }
}

/* ===== 영단어 ===== */
.word-list .word { font-size: 1.4rem; font-weight: 600; overflow-wrap: anywhere; }
.word-list li > .flex-grow-1 { min-width: 0; }
.word-list .list-group-item.gap-3 { gap: 0.5rem !important; }
.word-list .list-group-item .btn-star { padding: 0.2rem; }
.word-list .meaning { font-size: 1.25rem; }
.word-list .memorized .word { color: #198754; }
.word-list.hide-meaning .meaning { filter: blur(6px); cursor: pointer; user-select: none; }
.word-list.hide-meaning .meaning.reveal { filter: none; }
.word-list.hide-word .word { filter: blur(8px); cursor: pointer; user-select: none; }
.word-list.hide-word .word.reveal { filter: none; }

.calendar { table-layout: fixed; text-align: center; }
.calendar th { padding: 0.4rem 0; font-size: 1rem; }
.calendar td { height: 84px; padding: 0.2rem; vertical-align: top; font-size: 0.9rem; }
.calendar .day { font-size: 1.05rem; font-weight: 600; }
.calendar td.out { background: #f8f9fa; color: #adb5bd; }
.calendar td.today .day { background: #0d6efd; color: #fff; border-radius: 50%; display: inline-block; width: 1.6em; }
.calendar td.done { background: #d1e7dd; }
.calendar .count { font-weight: 600; color: #0d6efd; }
.calendar td.done .count { color: #198754; }
.calendar .check { font-size: 0.75rem; color: #6c757d; }

.legend { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; }
.legend.done { background: #d1e7dd; }
.legend.registered { background: #fff; border: 1px solid #0d6efd; }

/* 표제어 듣기 버튼 */
.btn-pink {
    background-color: #f472b6;
    border-color: #f472b6;
    color: #fff;
    font-weight: bold;
}

.btn-pink:hover,
.btn-pink:focus {
    background-color: #ec4899;
    border-color: #ec4899;
    color: #fff;
}

/* 다 외웠을 때 축하 */
.celebrate-overlay {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.35);
}

.celebrate-box {
    width: 100%;
    max-width: 320px;
    padding: 2rem 1.5rem;
    border-radius: 1.25rem;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #f9a8d4, #f472b6);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2);
    animation: celebrate-pop 0.35s ease-out;
}

.celebrate-emoji {
    font-size: 3.5rem;
    line-height: 1;
}

.celebrate-text {
    margin-top: 0.75rem;
    font-size: 1.6rem;
    font-weight: bold;
    line-height: 1.4;
}

@keyframes celebrate-pop {
    from { transform: scale(0.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* 헷갈려요(⭐) 버튼 */
.btn-star {
    padding: 0.3rem 0.5rem;
    font-size: 2rem;
    line-height: 1;
    color: #adb5bd;
    border: none;
}

.btn-star.on {
    color: inherit;
}

/* 표제어 듣기 / 다시 외우기 버튼 - 나란히 같은 너비 */
.study-action {
    flex: 1 1 0;
}

.btn-outline-pink {
    border-color: #f472b6;
    color: #db2777;
    font-weight: bold;
}

.btn-outline-pink:hover,
.btn-outline-pink:focus {
    background-color: #fff0f6;
    border-color: #ec4899;
    color: #db2777;
}

/* 다시 외우기 카드 */
.review-bar {
    background-color: #f472b6;
}

.review-card {
    margin-bottom: 1rem;
    cursor: pointer;
    user-select: none;
}

.review-card .card-body {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.review-word {
    font-size: 3rem;
    font-weight: bold;
}

.review-meaning {
    margin-top: 1rem;
    font-size: 1.8rem;
    color: #6c757d;
    visibility: hidden;
}

.review-hint {
    margin-top: 1rem;
}

.review-card.revealed .review-meaning {
    visibility: visible;
}

.review-card.revealed .review-hint {
    visibility: hidden;
}

.review-done-emoji {
    font-size: 3rem;
    line-height: 1;
}

/* 카드형 - 카드 아래 ⭐ / 외웠어요 */
.deck-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}

.word-list.deck .word { font-size: 3rem; }

/* 단어 모드: 뜻을 위에 크게 보여주고, 탭하면 단어 */
.deck.word-mode .review-meaning { order: -1; margin-top: 0; font-size: 2.2rem; color: #212529; visibility: visible; }
.deck.word-mode .review-word { margin-top: 1rem; visibility: hidden; }
.deck.word-mode .review-card.revealed .review-word { visibility: visible; }
.memorize-form .btn { white-space: nowrap; }

/* 동영상 - 16:9 썸네일 / 플레이어 */
.video-card { overflow: hidden; }

.video-frame {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    padding: 0;
    background: #000;
}

.video-thumb { position: relative; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }

.video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4.5rem;
    height: 3.2rem;
    border-radius: 0.9rem;
    background: rgba(255, 0, 0, 0.9);
    color: #fff;
    font-size: 1.6rem;
    line-height: 3.2rem;
}

.video-title { font-size: 1.2rem; font-weight: 600; }
