/**
 * EmbedPress Milestone Notification Styles
 * Animated notification from bottom right
 */

// Variables
$milestone-primary: #7c3aed;
$milestone-text-dark: #1f2937;
$milestone-text-light: #6b7280;
$milestone-border: #e5e7eb;
$milestone-bg-light: #f9fafb;
$milestone-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);

// Milestone level colors
$milestone-colors: (
    "1k": #7c3aed,
    // Purple - First milestone
    "5k": #3b82f6,
    // Blue - Growing
    "10k": #10b981,
    // Green - Success
    "20k": #f59e0b,
    // Orange - Hot
    "50k": #ef4444 // Red - Fire
);

// Overlay
.milestone-overlay {
    // position: fixed;
    // top: 0;
    // left: 0;
    // right: 0;
    // bottom: 0;
    // background: rgba(0, 0, 0, 0);
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
    // pointer-events: none;

    &--visible {
        opacity: 1;
        // pointer-events: all;
    }
}

// Main notification container
.milestone-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 440px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0px -8px 16px 0px #7c70b21a;
    overflow: hidden;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.5s ease-out;
    z-index: 1000000;
    font-family: "DM Sans", sans-serif;

    &--visible {
        transform: translateY(0);
        opacity: 1;
    }

    @media (max-width: 768px) {
        bottom: 10px;
        right: 10px;
        width: 340px;
    }

    @media (max-width: 400px) {
        right: 10px;
        left: 10px;
        width: auto;
    }
}

// Header
.milestone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb;
    margin: 0 18px;
    padding-bottom: 12px;
}

.milestone-title {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    line-height: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.milestone-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s ease;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;

    &:hover {
        background: $milestone-bg-light;
        color: $milestone-text-dark;
    }

    &:focus {
        outline: none;
    }

    svg {
        width: 12px;
        height: 12px;
    }
}

// Content
.milestone-content {
    padding: 16px;
}

// Achievement section
.milestone-achievement {
    margin-bottom: 16px;
}

.milestone-achievement-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 500;
    color: #707070;
    line-height: 1.5;
    font-family: "DM Sans", sans-serif;

    strong {
        font-weight: 700;
        color: #25396F;
    }

    @media (max-width: 480px) {
        font-size: 14px;
    }
}

.milestone-highlight {
    font-weight: 700;
    color: $milestone-text-dark;
}

.milestone-achievement-subtitle {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: $milestone-text-light;
    line-height: 1.5;

    strong {
        font-weight: 600;
        color: $milestone-text-dark;
    }
}

.milestone-link {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: $milestone-primary;
    text-decoration: none;
    transition: all 0.2s ease;

    &:hover {
        color: darken($milestone-primary, 10%);
        text-decoration: underline;
    }

    &:focus {
        outline: none;
    }
}

// Stats section
.milestone-stats {
    background: #6b7280;
    border-radius: 8px;
    padding: 20px 16px 16px;
    position: relative;
    overflow: hidden;
}

.milestone-stats-inner-wrapper {
    background: #ffffff;
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
}

.milestone-stats-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    background: #ffffff;
    /* border-radius: 6px; */
    border-bottom: 1px solid #e8eefa;
    padding-bottom: 6px;
    @media (max-width: 640px) {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
    }

    @media (max-width: 400px) {
        grid-template-columns: 1fr;
    }
}

// Stat card
.milestone-stat-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 4px;
    text-align: left;
    transition: all 0.2s ease;
    position: relative;

    // Add vertical divider between cards (except last one)
    // &:not(:last-child)::after {
    //     content: "";
    //     position: absolute;
    //     right: 0;
    //     top: 50%;
    //     transform: translateY(-50%);
    //     width: 1px;
    //     height: 40px;
    //     background: #e5e7eb;

    //     @media (max-width: 640px) {
    //         display: none;
    //     }
    // }

    @media (max-width: 640px) {
        // Add bottom border for 2-column layout
        &:nth-child(1),
        &:nth-child(2) {
            border-bottom: 1px solid #e5e7eb;
            padding-bottom: 12px;
            margin-bottom: 4px;
        }
    }

    @media (max-width: 400px) {
        // Add bottom border for all except last in 1-column layout
        &:not(:last-child) {
            border-bottom: 1px solid #e5e7eb;
            padding-bottom: 12px;
            margin-bottom: 4px;
        }
    }
}

.milestone-stat-label {
    font-size: 10px;
    font-weight: 500;
    color: #25396f;
    margin-bottom: 6px;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.3;
}

.milestone-stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #5b4e96;
    line-height: 1;

    @media (max-width: 480px) {
        font-size: 20px;
    }
}

// CTA Button (now a link)
.milestone-cta {
    display: inline-block;
    padding: 10px 16px;
    background: #7152ff;
    color: #ffffff !important;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    text-decoration: none;
    text-align: center;

    &:hover {
        background: darken($milestone-primary, 5%);
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
        color: #ffffff !important;
        text-decoration: none;
    }

    &:active {
        transform: translateY(0);
    }

    &:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba($milestone-primary, 0.3);
        color: #ffffff !important;
    }

    &:visited {
        color: #ffffff !important;
    }
}

// Animation keyframes
@keyframes slideUpSmooth {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDownSmooth {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}
