/* ============================================
   pages.css — Page-specific Layouts
   ============================================ */

/* ── Main Content (index: feature + sidebar) ── */
.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 30px 20px;
}

/* ── About Section ── */
.about-section {
    margin-bottom: 60px;
}

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

.about-header h2 {
    color: var(--text-heading);
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.about-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    align-items: start;
}

.about-video {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #000;
    box-shadow: var(--shadow-lg);
}

.about-video video {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* ── Features Section ── */
.features-section {
    margin-bottom: 40px;
}

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

.features-header h2 {
    color: var(--text-heading);
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.features-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ── Feature Card ── */
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.feature-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 8px 30px rgba(0, 188, 212, 0.12);
    transform: translateY(-4px);
}

.feature-video {
    width: 100%;
    background: #000;
    line-height: 0;
}

.feature-video video {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.feature-card-body {
    padding: 18px 20px 22px;
}

.feature-card-body h3 {
    color: var(--color-primary);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-card-body p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
}

/* ── Feature Content Grid (legacy) ── */
.feature-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* ── Sidebar ── */
.sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px;
    position: sticky;
    top: 100px;
}

.sidebar h3 {
    color: var(--color-primary);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 8px;
}

/* ── Login / Register Container ── */
.login-container {
    max-width: 520px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow-md);
}

.login-container h2 {
    color: var(--text-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}

.login-container form button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: var(--color-primary);
    color: var(--bg-body);
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition);
}

.login-container form button[type="submit"]:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 4px 16px rgba(0, 188, 212, 0.3);
}

/* ── Login Divider ── */
.login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    gap: 12px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.login-divider span {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ── Discord Login Button ── */
.btn-discord-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 28px;
    background: #5865F2;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
    box-sizing: border-box;
}

.btn-discord-login:hover {
    background: #4752C4;
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.35);
    transform: translateY(-1px);
    color: #fff;
}

.btn-discord-login .discord-icon {
    flex-shrink: 0;
}

/* ── Login Modal Links ── */
.modal-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 18px;
}

.modal-links a {
    color: var(--text-secondary);
    font-size: 0.88rem;
    text-decoration: none;
    transition: color var(--transition);
}

.modal-links a:hover {
    color: var(--color-primary);
}

/* ── Recover Page ── */
.recover-desc {
    color: var(--text-secondary);
    font-size: 0.92rem;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.6;
}

.recover-verified-info {
    background: rgba(0, 188, 212, 0.06);
    border: 1px solid rgba(0, 188, 212, 0.2);
    border-radius: var(--radius-sm);
    padding: 4px 16px;
    margin-bottom: 24px;
}

.recover-verified-info .info-row {
    border-bottom: none;
}

/* ── Settings Layout (2-column) ── */
.settings-layout {
    display: grid;
    grid-template-columns: 1fr 500px;
    gap: 24px;
    align-items: start;
}

.settings-message-wide {
    margin-bottom: 20px;
}

/* ── Left Panel (Account Info — always visible) ── */
.settings-left {
    min-width: 0;
}

.settings-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.settings-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    color: var(--color-primary);
    font-size: 1.05rem;
    font-weight: 600;
}

.settings-panel-header .tab-icon-svg {
    color: var(--color-primary);
}

.panel-title {
    flex: 1;
}

.settings-panel-body {
    padding: 20px 24px 24px;
}

/* ── Right Panel (Accordion Tabs) ── */
.settings-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-tabs {
    width: 520px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-message {
    width: 520px;
    margin: 0 auto 20px;
}

.settings-tab {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: border-color 0.3s;
}

.settings-tab.open {
    border-color: var(--color-primary);
}

.settings-tab-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-align: left;
}

.settings-tab-header:hover {
    background: rgba(0, 188, 212, 0.05);
    color: var(--color-primary);
}

.tab-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.tab-icon-svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.tab-icon-svg.discord-color {
    color: #5865F2;
}

.settings-tab-header:hover .tab-icon-svg {
    color: var(--color-primary);
}

.settings-tab-header:hover .tab-icon-svg.discord-color {
    color: #4752C4;
}

.settings-tab.open .tab-icon-svg {
    color: var(--color-primary);
}

.settings-tab.open .tab-icon-svg.discord-color {
    color: #5865F2;
}

.tab-icon-img {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    object-fit: contain;
}

.tab-title {
    flex: 1;
}

.tab-arrow {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: transform 0.3s;
    flex-shrink: 0;
}

.tab-arrow-svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.3s, color 0.2s;
}

.settings-tab.open .tab-arrow {
    transform: rotate(180deg);
    color: var(--color-primary);
}

.settings-tab.open .tab-arrow-svg {
    transform: rotate(180deg);
    color: var(--color-primary);
}

.settings-tab-body {
    display: none;
    padding: 20px 24px 24px;
    border-top: 1px solid var(--border-color);
}

.settings-tab.open .settings-tab-body {
    display: block;
}

.settings-tab-body form,
.settings-tab-body .discord-status,
.settings-tab-body .settings-desc,
.settings-tab-body .btn-primary,
.settings-tab-body .btn-discord-link {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.settings-tab-body form input[type="password"],
.settings-tab-body form input[type="text"],
.settings-tab-body form select.form-select {
    width: 100%;
}

/* ── Account Info Grid ── */
.account-info-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

.info-value {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    letter-spacing: 0.02em;
}

.info-value.highlight {
    color: var(--color-primary);
}

/* ── Login Logs Table ── */
.login-logs-section {
    margin-top: 8px;
}

.logs-title {
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.logs-table-wrap {
    overflow-x: visible;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    table-layout: auto;
}

.logs-table th {
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 0.8rem;
}

.logs-table td {
    color: var(--text-primary);
    padding: 7px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
}

.logs-table tbody tr:hover {
    background: rgba(0, 188, 212, 0.04);
}

.log-success {
    color: var(--color-primary);
    font-weight: 600;
}

.log-fail {
    color: var(--color-danger);
    font-weight: 600;
}

/* ── Form Select Dropdown ── */
select.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--bg-body);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 36px 10px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2390a4ae' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

select.form-select:hover {
    border-color: var(--color-primary);
}

select.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.15);
}

select.form-select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px;
}

/* ── Settings Container (내부 폼) ── */
.settings-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow-md);
}

.settings-container h2 {
    color: var(--text-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}

.settings-tab-body .form-group {
    margin-bottom: 8px;
}

.settings-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
    text-align: center;
}

.password-match-msg {
    font-size: 0.84rem;
    margin-top: 4px;
    margin-bottom: 8px;
    font-weight: 600;
    transition: color 0.2s;
}

.password-match-msg.match {
    color: var(--color-primary);
}

.password-match-msg.mismatch {
    color: var(--color-danger);
}

/* ── Discord Link Card ── */
.settings-discord {
    margin-top: 0;
}

.discord-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.discord-status.linked {
    background: rgba(88, 101, 242, 0.1);
    border: 1px solid rgba(88, 101, 242, 0.3);
}

.discord-status.not-linked {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
}

.discord-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.discord-label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.discord-status.linked .discord-label {
    color: #5865F2;
}

.discord-id {
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-family: monospace;
}

.discord-icon {
    font-size: 1.8rem;
    color: #5865F2;
}

.discord-icon-img {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    object-fit: contain;
}

.discord-status-icon {
    width: 28px;
    height: 21px;
    flex-shrink: 0;
}

.btn-discord-link {
    display: block;
    text-align: center;
    background: #5865F2 !important;
    border-color: #5865F2 !important;
}

.btn-discord-link:hover {
    background: #4752C4 !important;
}

.btn-discord-unlink {
    background: transparent !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-light) !important;
}

.btn-discord-unlink:hover {
    color: var(--color-danger) !important;
    border-color: var(--color-danger) !important;
    background: rgba(255, 82, 82, 0.08) !important;
}

/* ── Cash Charge Container ── */
.cash-charge-container {
    max-width: 520px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow-md);
}

.cash-charge-container h2 {
    color: var(--text-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

.cash-charge-container p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 10px;
}

.cash-charge-container strong {
    color: var(--text-heading);
}

/* ── Select Character ── */
.select-character {
    cursor: pointer;
}

/* ── Download + FAQ Container ── */
.download-faq-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 30px 20px;
}

.download-section {
    text-align: center;
    margin-bottom: 50px;
}

.download-section h2 {
    color: var(--text-heading);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.download-section p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 24px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ── FAQ Section ── */
.faq-section {
    max-width: 780px;
    margin: 0 auto;
}

.faq-section h2 {
    color: var(--text-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

.faq-item {
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    transition: background var(--transition), color var(--transition);
}

.faq-question:hover {
    background: var(--bg-card-hover);
    color: var(--color-primary);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    background: var(--bg-body);
    border-top: 1px solid var(--border-color);
}

.faq-answer.open {
    /* max-height is set dynamically by JavaScript */
    overflow: visible;
}

.faq-answer-inner,
.faq-answer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
    line-height: 1.6;
}

.faq-answer p {
    padding: 0 18px;
}

.faq-answer p:first-child {
    padding-top: 14px;
}

.faq-answer p:last-child {
    margin-bottom: 0;
    padding-bottom: 14px;
}

.faq-answer a {
    color: var(--color-primary);
    word-break: break-all;
}

/* ── Video Play Overlay ── */
.feature-video,
.about-video {
    position: relative;
    cursor: pointer;
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    opacity: 1;
    transition: opacity var(--transition), background var(--transition);
}

.feature-video:hover .video-play-overlay,
.about-video:hover .video-play-overlay {
    background: rgba(0, 0, 0, 0.2);
}

.play-icon {
    width: 64px;
    height: 64px;
    background: rgba(0, 188, 212, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 20px rgba(0, 188, 212, 0.4);
    padding-left: 4px; /* optical center for play triangle */
}

.feature-video:hover .play-icon,
.about-video:hover .play-icon {
    transform: scale(1.12);
    background: rgba(0, 188, 212, 1);
    box-shadow: 0 6px 30px rgba(0, 188, 212, 0.6);
}

/* ── Video Modal ── */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.video-modal.active {
    display: flex;
}

.video-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: modalFadeIn 0.3s ease;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 960px;
    z-index: 1;
    animation: modalScaleIn 0.3s ease;
}

.video-modal-content video {
    width: 100%;
    display: block;
    border-radius: var(--radius-md);
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(0, 188, 212, 0.15);
}

.video-modal-close {
    position: absolute;
    top: -44px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition), color var(--transition);
    opacity: 0.7;
}

.video-modal-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-primary);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
