/**
 * Kindergarten Notifications Component
 * A colorful, child-friendly notification system for kindergarten websites
 */

/* Notifications container */
.kg-notifications-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    z-index: 1000;
}

/* Main card container */
.kg-main-card {
    background-color: #fffdeb;
    border: 3px solid #ff8a5b;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 6px 15px rgba(255, 138, 91, 0.3);
    transition: all 0.3s ease;
    overflow: hidden;
    background-image: linear-gradient(to bottom right, #fffdeb, #fff3c0);
    position: relative;
}

/* Decorative elements for kindergarten theme */
.kg-main-card::before {
    content: "";
    position: absolute;
    top: -15px;
    left: -15px;
    width: 40px;
    height: 40px;
    background-color: #52d1dc;
    border-radius: 50%;
    z-index: -1;
}

.kg-main-card::after {
    content: "";
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background-color: #ff5a5f;
    border-radius: 50%;
    z-index: -1;
}

/* Header for the main card */
.kg-main-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px dashed #8bd7d2;
    position: relative;
}

.kg-main-card-title {
    font-weight: bold;
    font-size: 22px;
    color: #ff5a5f;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    text-shadow: 1px 1px 0 #ffde7d;
    letter-spacing: 1px;
    position: relative;
    padding-left: 35px;
}

.kg-main-card-title::before {
    content: "✏️";
    position: absolute;
    left: 5px;
    font-size: 24px;
}

/* Toggle button for showing/hiding */
.kg-toggle-card {
    background: #52d1dc;
    border: 2px solid #41a7b3;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    padding: 5px 12px;
    font-weight: bold;
    transition: all 0.2s ease;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    box-shadow: 0 3px 0 #41a7b3;
}

.kg-toggle-card:hover {
    background: #41a7b3;
    transform: translateY(2px);
    box-shadow: 0 1px 0 #41a7b3;
}

/* Single notification/tile within main card */
.kg-notification {
    background-color: white;
    border-radius: 15px;
    padding: 12px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* Colorful variations for notifications */
.kg-notification:nth-child(3n+1) {
    border-left: 6px solid #ff8a5b;
    background: linear-gradient(to right, rgba(255, 138, 91, 0.1), white 20%);
}

.kg-notification:nth-child(3n+2) {
    border-left: 6px solid #8bd7d2;
    background: linear-gradient(to right, rgba(139, 215, 210, 0.1), white 20%);
}

.kg-notification:nth-child(3n+3) {
    border-left: 6px solid #ffde7d;
    background: linear-gradient(to right, rgba(255, 222, 125, 0.1), white 20%);
}

/* Add a playful shape to each notification */
.kg-notification::before {
    content: "";
    position: absolute;
    top: -2px;
    right: 15px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.kg-notification:nth-child(3n+1)::before {
    background-color: #ff8a5b;
}

.kg-notification:nth-child(3n+2)::before {
    background-color: #8bd7d2;
}

.kg-notification:nth-child(3n+3)::before {
    background-color: #ffde7d;
}

/* Content area for the notifications/tiles */
.kg-tiles-container {
    max-height: 300px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
    padding: 5px;
}

.kg-tiles-container.hidden {
    max-height: 0;
    overflow: hidden;
}

/* Scroll bar styling for tiles container */
.kg-tiles-container::-webkit-scrollbar {
    width: 8px;
}

.kg-tiles-container::-webkit-scrollbar-track {
    background: rgba(255, 222, 125, 0.2);
    border-radius: 10px;
}

.kg-tiles-container::-webkit-scrollbar-thumb {
    background: #ff8a5b;
    border-radius: 10px;
}

.kg-tiles-container::-webkit-scrollbar-thumb:hover {
    background: #ff5a5f;
}

/* Notification title */
.kg-notification-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    position: relative;
    padding-left: 28px;
}

.kg-notification:nth-child(3n+1) .kg-notification-title {
    color: #ff5a5f;
}

.kg-notification:nth-child(3n+2) .kg-notification-title {
    color: #41a7b3;
}

.kg-notification:nth-child(3n+3) .kg-notification-title {
    color: #ff8a5b;
}

/* Add fun icons to notification titles */
.kg-notification:nth-child(3n+1) .kg-notification-title::before {
    content: "🎨";
    position: absolute;
    left: 0;
    top: 0;
}

.kg-notification:nth-child(3n+2) .kg-notification-title::before {
    content: "🎭";
    position: absolute;
    left: 0;
    top: 0;
}

.kg-notification:nth-child(3n+3) .kg-notification-title::before {
    content: "📚";
    position: absolute;
    left: 0;
    top: 0;
}

/* Notification description */
.kg-notification-description {
    font-size: 14px;
    color: #555;
    font-family: 'Arial Rounded MT Bold', 'Helvetica Rounded', Arial, sans-serif;
    line-height: 1.4;
    padding-left: 28px;
}

/* Hide button */
.kg-hide-notification {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
    transform: scale(1);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

.kg-notification:nth-child(3n+1) .kg-hide-notification {
    background-color: #ff5a5f;
}

.kg-notification:nth-child(3n+2) .kg-hide-notification {
    background-color: #41a7b3;
}

.kg-notification:nth-child(3n+3) .kg-hide-notification {
    background-color: #ff8a5b;
}

.kg-hide-notification:hover {
    transform: scale(1.15);
}

/* Animation for showing notifications */
@keyframes slideIn {
    from {
        transform: translateX(100%) rotate(5deg);
        opacity: 0;
    }
    to {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
}

/* Animation for hiding notifications */
@keyframes slideOut {
    from {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
    to {
        transform: translateX(100%) rotate(-5deg);
        opacity: 0;
    }
}

/* Animation for bouncing effect */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Animation for notification title icons */
@keyframes wiggle {
    0%, 100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

/* Animation for showing a new notification tile */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kg-main-card {
    animation: slideIn 0.5s forwards, bounce 2s infinite 1s;
}

.notification-show {
    animation: fadeIn 0.3s forwards;
}

.notification-hide {
    animation: slideOut 0.5s forwards;
}

.kg-notification-title::before {
    animation: wiggle 3s infinite;
}

/* Button hover animations */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 3px 0 #41a7b3;
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 5px 0 #41a7b3;
    }
    100% {
        transform: scale(1);
        box-shadow: 0 3px 0 #41a7b3;
    }
}
