/* attendance.css */

body {
    background-color: #F0F2F5;
    color: #333;
}

.attendance-main {
    max-width: 1000px;
    margin: 70px auto;
    padding: 40px;
    background: #fff;
    border-radius: 20px;
}

/* Dark mode */
html[data-theme="dark"] .attendance-main{ background:#121212; color: var(--color-text) }

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

.credit-header h1 {
    font-size: 30px;
    font-weight: 500;
    color: #000;
    padding-bottom: 15px;
    display: inline-block;
}
html[data-theme="dark"] .credit-header h1{ color:#fff }

.credit-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.credit-option {
    display: flex;
    align-items: center;
    border: 1px solid #e5e5e5;
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    transition: transform 0.3s, box-shadow 0.3s;
}
html[data-theme="dark"] .credit-option{ background:#424242 }



.option-icon {
    margin-right: 25px;
}

.option-icon img {
    width: 80px;
    height: 80px;
}

.option-text {
    flex-grow: 1;
    flex: 1;
    min-width: 0;
}

.option-text h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.option-text p {
    font-size: 15px;
    color: #666;
    margin: 0;
    line-height: 1.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.option-action .action-btn {
    background: var(--brand-action);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 12px 25px;
    border-radius: 10px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;   
}

.option-action .action-btn:hover {
    background: var(--brand-hover);
}

/* Responsive adjustments */
@media (max-width: 980px){
  .attendance-main{ max-width: 920px; padding: 24px }
  .credit-option{ padding: 20px }
  .option-icon img{ width: 64px; height: 64px }
}
@media (max-width: 640px){
  .attendance-main{ max-width: 100%; margin: 40px auto; padding: 16px }
  .credit-option{ flex-direction: row; align-items: flex-start; padding: 16px; gap: 12px }
  .option-icon img{ width: 48px; height: 48px }
  .option-text h2{ font-size: 18px }
  .option-text p{ font-size: 14px }
  .option-action .action-btn{ padding: 10px 18px; font-size: 14px }
}

/* Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 20px;
    width: 80%;
    max-width: 700px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slide-down 0.4s ease-out;
}

@keyframes slide-down {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: #000;
    text-decoration: none;
}

.modal-header {
    text-align: center;
    margin-bottom: 25px;
    background: url('../image/modal-header-bg.png') no-repeat center top;
    padding-top: 60px;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.daily-checkin-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.day-item {
    background: #f7f7f7;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #eee;
}

.day-item.checked {
    background-color: #E8F5E9;
    border-color: #A5D6A7;
}

.day-item span {
    display: block;
    margin-bottom: 10px;
}

.icon-check {
    font-size: 24px;
    color: #4CAF50;
}

.icon-points {
    background: url('../image/coin-icon.png') no-repeat center center;
    background-size: contain;
    color: #E65100;
    font-weight: 700;
    font-size: 16px;
    padding: 8px 0;
}

.checkin-subtitle {
    text-align: center;
    font-size: 16px;
    color: #555;
    margin-bottom: 20px;
}

.checkin-button {
    display: block;
    width: 50%;
    margin: 0 auto 20px;
    padding: 15px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(to right, #8E2DE2, #4A00E0);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.3s;
}

.checkin-button:hover {
    background: linear-gradient(to right, #8028c9, #4100c7);
}

.extra-credit-link {
    text-align: center;
    font-size: 14px;
}

.extra-credit-link a {
    color: #4A00E0;
    text-decoration: underline;
}

/* --- Daily Check-in Overlay (page-top popup) --- */
.daily-checkin-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.dc-card {
    width: min(920px, calc(100% - 32px));
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    position: relative;
    overflow: hidden;
}

.dc-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px; height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    color: #111;
    font-size: 22px;
    line-height: 36px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.dc-banner {
    position: relative;
    padding: 40px 28px 60px;
    background: linear-gradient(180deg, #ffd3b6, #ffe9dc);
}
.dc-banner::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -55px;
    height: 110px;
    background: radial-gradient(100% 60% at 50% 0%, #ffeddc 0%, transparent 60%);
    filter: blur(8px);
}
.dc-banner h2 {
    margin: 0;
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    color: #1f2430;
    line-height: 1.35;
}

.dc-coin { position: absolute; width: 28px; height: 28px; opacity: 0.9; }
.dc-coin.c1 { top: 26px; left: 38px; }
.dc-coin.c2 { top: 16px; right: 72px; }
.dc-coin.c3 { top: 88px; right: 140px; }
.dc-coin.c4 { top: 84px; left: 220px; }

.dc-content { padding: 22px 32px 28px; }

.dc-week-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 18px;
    margin-top: 6px;
    padding-bottom: 30px;
}

.dc-day-card {
    background: #f7f6f5;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    padding: 16px 12px;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    min-height: 120px;
}
.dc-label { color: #4b5563; font-weight: 600; }

.dc-circle { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.6); }
.dc-circle.check { background: #57d564; color: #fff; font-size: 28px; }
.dc-circle.coin {
    border: 1px solid #e6e6e6;
    position: relative;
    background-image: url('../image/pointbg.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}
.dc-circle.coin .plus {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #f59e0b;
}

.dc-hint { text-align: center; margin: 16px 0 10px; color: #6b7280; }
.dc-action-row { display: flex; justify-content: center; }
.dc-action-btn { width: 240px; height: 56px; border-radius: 999px; border: none; background: #e9eaf0; color: #9aa0a6; font-size: 18px; font-weight: 700; cursor: not-allowed; }
.dc-more { text-align: center; margin-top: 14px; }
.dc-more a { color: #6f5ae6; font-weight: 700; text-decoration: none; }

/* Right-side close button */
.dc-side-close-btn {
    position: absolute;
    top: 30px;
    right: 10px;
    transform: translateY(-50%);
    padding: 10px 16px;
    background: rgba(255,255,255,0.95);
    color: #1f2430;
    border: 1px solid #e6e6e6;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.dc-side-close-btn:hover { background: #f7f7f9; }

.dc-side-close-btn .dc-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
}

.invite-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.invite-card {
    width: min(720px, calc(100% - 32px));
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    position: relative;
    overflow: hidden;
}

.invite-banner {
    position: relative;
    padding: 36px 28px 20px;
    background: linear-gradient(180deg, #e9d5ff, #e6d3ff);
}
.invite-banner h2 {
    margin: 0;
    font-size: 34px;
    font-weight: 800;
    color: #141414;
}
.invite-banner .sparkles {
    margin-left: 8px;
    color: #8b5cf6;
}
.invite-subtitle {
    margin-top: 12px;
    font-size: 15px;
    color: #4b5563;
}
.invite-rules {
    margin-left: 6px;
    color: #6f5ae6;
    text-decoration: none;
    font-weight: 700;
}

.invite-content { padding: 22px 28px 28px; }

.invite-link-row {
    display: flex;
    gap: 12px;
    align-items: center;
}
.invite-link-row input {
    flex: 1;
    height: 48px;
    border-radius: 999px;
    border: 1px solid #e6e6e6;
    padding: 0 16px;
    font-size: 14px;
    color: #1f2430;
}
.invite-copy-btn {
    background: #7c3aed;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
}
.invite-copy-btn:hover { background: #6d28d9; }

.invite-side-close-btn {
    position: absolute;
    top: 16px;
    right: 12px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.95);
    color: #1f2430;
    border: 1px solid #e6e6e6;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.invite-side-close-btn:hover { background: #f7f7f9; }
