/* Styles for the Puthiya Payanangal children portal */

:root {
    --pp-sunrise: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    --pp-lilac: #b794f4;
    --pp-sea: #00b4d8;
    --pp-grass: #06d6a0;
}

.pp-body {
    background: #f7f2ff;
    font-family: 'Baloo 2', 'Inter', system-ui;
    min-height: 100vh;
}

.pp-hero {
    background: var(--pp-sunrise);
    padding: 2.5rem 0;
    color: #412234;
    position: relative;
    overflow: hidden;
}

.pp-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.pp-tagline {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0;
}

.pp-hero-illustration {
    max-height: 120px;
}

.pp-main {
    padding: 2rem 0 3rem;
}

.pp-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: 0 12px 30px rgba(115, 102, 255, 0.12);
    border: none;
}

.pp-level-lock {
    border: 2px dashed #cdb4f5;
    background: rgba(203, 189, 255, 0.22);
    border-radius: 16px;
    padding: 1rem;
}

.pp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 209, 102, 0.18);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-weight: 600;
    color: #ff9f1c;
}

.pp-task-card {
    border-radius: 16px;
    border: 1px solid #f0e6ff;
    background: #ffffff;
    padding: 1.25rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pp-task-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 28px rgba(17, 138, 178, 0.12);
}

.pp-task-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.pp-task-nav-btn {
    border: 1px solid #f0e6ff;
    border-radius: 14px;
    padding: 0.65rem 0.85rem;
    background: #ffffff;
    text-decoration: none;
    color: #3f2e71;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pp-task-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 18px rgba(63, 46, 113, 0.12);
}

.pp-task-nav-btn.is-current {
    border-color: #6c5ce7;
    box-shadow: 0 10px 16px rgba(108, 92, 231, 0.15);
}

.pp-task-nav-btn.todo {
    background: #fffdf5;
    border-color: #ffe8a3;
}

.pp-task-nav-btn.changes {
    background: #fff1f6;
    border-color: #ffb3cf;
}

.pp-task-nav-btn.review {
    background: #f0f7ff;
    border-color: #b6dcff;
}

.pp-task-nav-btn.complete {
    background: #effcf6;
    border-color: #9be0ba;
}

.pp-task-nav-code {
    font-weight: 700;
    font-size: 0.95rem;
}

.pp-task-nav-title {
    font-size: 0.85rem;
    color: #555260;
    line-height: 1.15;
}

.pp-footer {
    background: rgba(65, 34, 52, 0.04);
}

.pp-task-hero {
    background: #fffefd;
    border: 1px solid #f0e6ff;
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    box-shadow: 0 10px 20px rgba(40, 35, 70, 0.05);
}

.pp-task-hero-meta .btn {
    font-size: 0.85rem;
}

.pp-resource-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pp-resource-pill {
    border: 1px solid #e5deff;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    color: #4a3f91;
    text-decoration: none;
    background: #f8f6ff;
}

.pp-resource-pill:hover {
    background: #ece6ff;
}

.pp-task-nav-bar {
    background: #ffffff;
    border: 1px solid #f0e6ff;
    border-radius: 20px;
    padding: 1rem 1.25rem;
    box-shadow: 0 8px 18px rgba(40, 35, 70, 0.05);
}

.pp-task-chip-row {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
}

.pp-task-chip {
    border-radius: 999px;
    padding: 0.5rem 1rem;
    border: 2px solid;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.pp-task-chip.is-current {
    background: #5b21b6;
    color: #fff;
    border-color: #5b21b6;
    font-weight: 700;
}

.pp-task-chip.todo {
    background: #fef3c7;
    color: #92400e;
    border-color: #fbbf24;
}

.pp-task-chip.changes {
    background: #fecdd3;
    color: #881337;
    border-color: #fb7185;
}

.pp-task-chip.review {
    background: #bfdbfe;
    color: #1e3a8a;
    border-color: #3b82f6;
}

.pp-task-chip.complete {
    background: #bbf7d0;
    color: #14532d;
    border-color: #22c55e;
}

.pp-task-chip-code {
    font-weight: 700;
}

.pp-task-chip-title {
    white-space: nowrap;
}

.pp-next-steps li {
    display: flex;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.pp-step-index {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ede9ff;
    color: #4a3f91;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.pp-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.2rem 0.95rem;
}

.pp-status-pill--muted {
    background: #f1edff;
    color: #5946b2;
}

.pp-status-pill--draft {
    background: #fff4d8;
    color: #ad6a00;
}

.pp-status-pill--submitted {
    background: #e3f2ff;
    color: #005b99;
}

.pp-status-pill--changes {
    background: #ffe5ef;
    color: #b30045;
}

.pp-status-pill--complete {
    background: #e4f9f0;
    color: #0f8d5c;
}

.pp-mini-stat {
    border: 1px solid #f0e6ff;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    background: #fffefd;
    min-height: 100%;
}

.pp-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pp-timeline-item {
    display: flex;
    gap: 0.9rem;
    padding-bottom: 1.25rem;
}

.pp-timeline-item:last-child {
    padding-bottom: 0;
}

.pp-timeline-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #f1edff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #6c5ce7;
}

.pp-timeline-text {
    background: #f9f7ff;
    border-radius: 12px;
    padding: 0.75rem;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    word-break: break-word;
}

.pp-alert-grid .alert {
    border-radius: 16px;
    border: none;
    font-weight: 600;
}

/* Gamification & Interactive Elements */
.pp-progress-ring {
    width: 80px;
    height: 80px;
    position: relative;
}

.pp-progress-ring svg {
    transform: rotate(-90deg);
}

.pp-progress-ring-circle {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.pp-progress-ring-bg {
    stroke: #e5e7eb;
}

.pp-progress-ring-progress {
    stroke: #10b981;
    stroke-dasharray: 251.2;
    stroke-dashoffset: 0;
}

.pp-achievement-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-weight: 700;
    color: #92400e;
    animation: pulse 2s infinite;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pp-level-unlock {
    animation: unlockAnimation 0.8s ease-out;
}

@keyframes unlockAnimation {
    0% {
        opacity: 0;
        transform: scale(0.8) rotateY(90deg);
    }
    50% {
        transform: scale(1.1) rotateY(0deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

.pp-task-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #374151;
}

.pp-task-body h1,
.pp-task-body h2,
.pp-task-body h3,
.pp-task-body h4 {
    color: #1f2937;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.pp-task-body h1 { font-size: 2rem; }
.pp-task-body h2 { font-size: 1.75rem; }
.pp-task-body h3 { font-size: 1.5rem; }
.pp-task-body h4 { font-size: 1.25rem; }

.pp-task-body p {
    margin-bottom: 1rem;
}

.pp-task-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 1.5rem 0;
}

.pp-task-body ul,
.pp-task-body ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.pp-task-body li {
    margin-bottom: 0.5rem;
}

.pp-task-body blockquote {
    border-left: 4px solid #6c5ce7;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #4b5563;
    background: #f9fafb;
    padding: 1rem 1rem 1rem 1.5rem;
    border-radius: 8px;
}

.pp-task-body a {
    color: #6c5ce7;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s;
}

.pp-task-body a:hover {
    color: #5b21b6;
}

.pp-task-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pp-task-body table th,
.pp-task-body table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.pp-task-body table th {
    background: #f3f4f6;
    font-weight: 700;
    color: #1f2937;
}

.pp-task-body code {
    background: #f3f4f6;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #dc2626;
}

.pp-task-body pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.pp-task-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Rich content styling for chapters and experiments */
.rich-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #374151;
}

.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4,
.rich-content h5,
.rich-content h6 {
    color: #1f2937;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.rich-content h1 { font-size: 2rem; }
.rich-content h2 { font-size: 1.75rem; }
.rich-content h3 { font-size: 1.5rem; }
.rich-content h4 { font-size: 1.25rem; }
.rich-content h5 { font-size: 1.1rem; }
.rich-content h6 { font-size: 1rem; }

.rich-content p {
    margin-bottom: 1rem;
}

.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 1.5rem 0;
    display: block;
}

.rich-content ul,
.rich-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.rich-content li {
    margin-bottom: 0.5rem;
}

.rich-content blockquote {
    border-left: 4px solid #6c5ce7;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #4b5563;
    background: #f9fafb;
    padding: 1rem 1rem 1rem 1.5rem;
    border-radius: 8px;
}

.rich-content a {
    color: #6c5ce7;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s;
}

.rich-content a:hover {
    color: #5b21b6;
}

.rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.rich-content table th,
.rich-content table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.rich-content table th {
    background: #f3f4f6;
    font-weight: 700;
    color: #1f2937;
}

.rich-content code {
    background: #f3f4f6;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #dc2626;
}

.rich-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.rich-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

@media (max-width: 768px) {
    .rich-content {
        font-size: 1rem;
    }
    .rich-content h1 { font-size: 1.75rem; }
    .rich-content h2 { font-size: 1.5rem; }
    .rich-content h3 { font-size: 1.25rem; }
    .rich-content img {
        margin: 1rem 0;
    }
}

/* Interactive card hover effects */
.pp-card-interactive {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.pp-card-interactive:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(108, 92, 231, 0.15);
}

/* Streak counter animation */
.pp-streak-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-weight: 700;
    color: #92400e;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.pp-streak-counter .streak-icon {
    animation: flame 1.5s ease-in-out infinite;
}

@keyframes flame {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.1) rotate(-5deg);
    }
    75% {
        transform: scale(1.1) rotate(5deg);
    }
}

/* Progress bar enhancements */
.pp-progress-bar-container {
    background: #f3f4f6;
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
    position: relative;
}

.pp-progress-bar-fill {
    background: linear-gradient(90deg, #10b981 0%, #06d6a0 100%);
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.pp-progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Celebration animation */
.pp-celebration {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9999;
}

.pp-confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fbbf24;
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .pp-title {
        font-size: 2.1rem;
    }
    .pp-main {
        padding: 1.5rem 0 2.5rem;
    }
    .pp-task-card {
        height: 100%;
    }
    .pp-task-body {
        font-size: 1rem;
    }
    .pp-task-body h1 { font-size: 1.75rem; }
    .pp-task-body h2 { font-size: 1.5rem; }
    .pp-task-body h3 { font-size: 1.25rem; }
}

/* Notifications (PP navbar) */
.navbar .notification-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background-color: transparent;
    transition: background-color 0.2s ease;
}

.navbar .notification-trigger:hover {
    background-color: rgba(0, 180, 216, 0.12);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background-color: #dc3545;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}
