/**
 * Nk Alert - Front-end Styles
 */

.nkalert-box {
    margin: 20px 0;
    transition: all 0.3s ease;
}

.nkalert-box:hover {
    box-shadow: 0 4px 15px rgba(237, 44, 44, 0.1);
}

/* Header */
.nkalert-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.nkalert-bell {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: bellRing 2s ease-in-out infinite;
}

.nkalert-bell svg {
    width: 22px;
    height: 22px;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    10% { transform: rotate(15deg); }
    20% { transform: rotate(-15deg); }
    30% { transform: rotate(10deg); }
    40% { transform: rotate(-10deg); }
    50% { transform: rotate(0); }
}

.nkalert-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

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

.nkalert-input-group {
    position: relative;
}

.nkalert-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.nkalert-input:focus {
    outline: none;
    border-color: #ED2C2C;
    box-shadow: 0 0 0 3px rgba(237, 44, 44, 0.1);
}

.nkalert-input::placeholder {
    color: #999;
}

/* Email display for logged users */
.nkalert-email-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
}

.nkalert-email-icon {
    color: #666;
    display: flex;
}

/* Consent checkbox */
.nkalert-consent {
    margin-top: 4px;
}

.nkalert-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.nkalert-checkbox input {
    display: none;
}

.nkalert-checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.nkalert-checkbox input:checked + .nkalert-checkmark {
    background: #ED2C2C;
    border-color: #ED2C2C;
}

.nkalert-checkbox input:checked + .nkalert-checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.nkalert-consent-text {
    flex: 1;
}

/* Submit button */
.nkalert-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nkalert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 44, 44, 0.3);
}

.nkalert-btn:active {
    transform: translateY(0);
}

.nkalert-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.nkalert-spinner {
    animation: rotate 1s linear infinite;
}

.nkalert-spinner .path {
    stroke: currentColor;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Subscribers count */
.nkalert-count {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 12px 0 0 0;
    font-size: 12px;
    color: #888;
}

/* Login required message */
.nkalert-login-required {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.nkalert-login-required a {
    color: #ED2C2C;
    font-weight: 600;
    text-decoration: none;
}

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

/* Success state */
.nkalert-success,
.nkalert-subscribed {
    text-align: center;
    padding: 20px;
}

.nkalert-icon {
    margin-bottom: 12px;
}

.nkalert-icon.success svg,
.nkalert-subscribed .nkalert-icon svg {
    color: #28a745;
}

.nkalert-success-message,
.nkalert-subscribed .nkalert-message {
    margin: 0;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* Error state */
.nkalert-error {
    text-align: center;
    padding: 10px;
}

.nkalert-icon.error svg {
    color: #dc3545;
}

.nkalert-error-message {
    margin: 0;
    font-size: 14px;
    color: #dc3545;
}

/* Animations */
.nkalert-success,
.nkalert-error {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive */
@media (max-width: 767px) {
    .nkalert-box {
        padding: 16px;
        margin: 15px 0;
    }

    .nkalert-header {
        gap: 10px;
    }

    .nkalert-bell {
        width: 38px;
        height: 38px;
    }

    .nkalert-bell svg {
        width: 18px;
        height: 18px;
    }

    .nkalert-title {
        font-size: 14px;
    }

    .nkalert-input {
        padding: 10px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .nkalert-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .nkalert-checkbox {
        font-size: 12px;
    }
}

/* Dark mode support - uses inline styles from module config */
@media (prefers-color-scheme: dark) {
    .nkalert-title {
        color: #fff;
    }

    .nkalert-input {
        background: #333;
        color: #fff;
    }

    .nkalert-email-display {
        background: #333;
        color: #fff;
    }

    .nkalert-checkbox {
        color: #ccc;
    }

    .nkalert-success-message,
    .nkalert-subscribed .nkalert-message {
        color: #fff;
    }

    .nkalert-login-required {
        color: #ccc;
    }
}
