/* ===== AI Marketing Lab — MyPage Styles ===== */
/* Extends the main style.css design system */

/* ===== Login View ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 440px;
    padding: 48px 40px;
    position: relative;
    z-index: 2;
    animation: card-appear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes card-appear {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.login-logo img {
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.login-logo img[alt]:not([src$=".png"]),
.login-logo img:not([complete]) {
    display: none;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.2;
    color: var(--text-main);
    margin-bottom: 4px;
}

.login-header h1 span {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.2em;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 12px;
    letter-spacing: 0.06em;
}

/* Login Buttons */
.btn-login {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
}

.btn-google {
    background: #ffffff;
    color: #3c4043;
    border: 1.5px solid #dadce0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.btn-email {
    background: linear-gradient(135deg, #22d3ee, #a855f7, #f472b6) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
    font-size: 1rem;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    background-clip: padding-box !important;
    -webkit-background-clip: padding-box !important;
}

.btn-email:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

/* Divider */
.login-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.form-group input {
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    transition: all 0.2s ease;
    background: #fafbfc;
    color: var(--text-main);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
    background: #ffffff;
}

.form-group input::placeholder {
    color: #cbd5e1;
}

/* Error */
.login-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #dc2626;
    font-size: 0.85rem;
    text-align: center;
}

.login-help {
    margin-top: 24px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.login-help a {
    color: var(--color-purple);
    text-decoration: none;
    font-weight: 600;
}

.login-help a:hover {
    text-decoration: underline;
}

/* Background Shapes */
.login-bg-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.login-bg-shapes .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
}

.login-bg-shapes .shape-1 {
    width: 500px; height: 500px;
    background: var(--color-cyan);
    top: -200px; right: -100px;
    opacity: 0.15;
    animation: float 12s infinite alternate;
}

.login-bg-shapes .shape-2 {
    width: 400px; height: 400px;
    background: var(--color-purple);
    bottom: -150px; left: -100px;
    opacity: 0.12;
    animation: float 10s infinite alternate-reverse;
}

.login-bg-shapes .shape-3 {
    width: 300px; height: 300px;
    background: var(--color-pink);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.08;
    animation: float 14s infinite alternate;
}

/* ===== Dashboard View ===== */
.dashboard-main {
    padding-top: calc(var(--header-height) + 40px);
    min-height: 100vh;
    background: var(--bg-secondary);
}

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

.welcome-section h1 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 8px;
}

.welcome-sub {
    color: var(--text-muted);
    font-size: 1rem;
}

/* User Badge */
.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.btn-logout {
    padding: 6px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
}

.btn-logout:hover {
    border-color: #f87171;
    color: #f87171;
    background: #fef2f2;
}

.btn-back {
    padding: 6px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
}

.btn-back:hover {
    border-color: var(--color-purple);
    color: var(--color-purple);
}

/* Category Filter */
.category-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 8px 20px;
    border: 1.5px solid #e2e8f0;
    border-radius: 24px;
    background: white;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
}

.filter-btn:hover {
    border-color: var(--color-purple);
    color: var(--color-purple);
}

.filter-btn.active {
    background: var(--text-main);
    color: white;
    border-color: var(--text-main);
}

/* Course Grid */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding-bottom: 80px;
}

.course-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.course-card-thumb {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.course-card-thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.12;
}

.course-card-body {
    padding: 20px 24px 24px;
}

.course-card-category {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-purple);
    margin-bottom: 8px;
}

.course-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
    line-height: 1.5;
}

.course-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.course-card-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-progress {
    width: 60px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Loading */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    color: var(--text-muted);
    gap: 16px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--color-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Course View ===== */
.course-main {
    padding-top: calc(var(--header-height) + 24px);
    min-height: 100vh;
    background: #f8fafc;
}

.course-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    padding-bottom: 80px;
}

/* Player Area */
.player-area {
    min-width: 0;
}

.player-wrapper {
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16/9;
    position: relative;
}

.player-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.player-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    background: #1e293b;
    font-size: 1rem;
}

.lesson-info {
    padding: 24px 0;
}

.lesson-info h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.lesson-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Lesson Sidebar */
.lesson-sidebar {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    overflow: hidden;
    max-height: calc(100vh - var(--header-height) - 48px);
    position: sticky;
    top: calc(var(--header-height) + 24px);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.lesson-list {
    overflow-y: auto;
    flex: 1;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.lesson-item:hover {
    background: #f8fafc;
}

.lesson-item.active {
    background: rgba(168, 85, 247, 0.05);
    border-left: 3px solid var(--color-purple);
}

.lesson-item.completed .lesson-check {
    background: var(--color-green);
    color: white;
}

.lesson-check {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: all 0.2s;
}

.lesson-item-info {
    flex: 1;
    min-width: 0;
}

.lesson-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lesson-item-duration {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== Footer (shared) ===== */
.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--text-muted);
    margin: 0 10px;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--text-main);
}

/* ===== Responsive ===== */
@media (max-width: 968px) {
    .course-layout {
        grid-template-columns: 1fr;
    }

    .lesson-sidebar {
        position: static;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .login-card {
        margin: 16px;
        padding: 36px 28px;
    }

    .welcome-section h1 {
        font-size: 1.5rem;
    }

    .course-grid {
        grid-template-columns: 1fr;
    }

    .nav-right {
        gap: 8px;
    }

    .user-name {
        display: none;
    }

    .btn-back {
        font-size: 0.78rem;
        padding: 4px 10px;
    }
}
