/**
 * Yard Alert CSS
 * Simple, accessible styles for the alert banner
 * Easy to override with CSS custom properties and low specificity
 */

/* CSS Custom Properties for easy theming */
.yard-alert-container {
    --alert-bg-color: #2563eb;
    --alert-text-color: #ffffff;
    --alert-padding: 12px 20px;
    --alert-gap: 20px;
    --alert-border-radius: 4px;
    --alert-font-size: 14px;
    --alert-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --alert-z-index: 999999;
    --alert-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --alert-transition: 0.2s ease;
}

/* Main container */
.yard-alert-container {
    position: relative;
    width: 100%;
    background: var(--alert-bg-color);
    color: var(--alert-text-color);
    font-family: var(--alert-font-family);
    font-size: var(--alert-font-size);
    line-height: 1.5;
    z-index: var(--alert-z-index);
    box-shadow: var(--alert-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Content wrapper */
.yard-alert-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    padding: var(--alert-padding);
    gap: var(--alert-gap);
    width: 100%;
}

/* Message content */
.yard-alert-message {
    flex: 1;
    margin: 0;
}

.yard-alert-message p {
    margin: 0;
}

.yard-alert-message a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.yard-alert-message a:hover,
.yard-alert-message a:focus {
    text-decoration: none;
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
    border-radius: 2px;
}

.yard-alert-message strong,
.yard-alert-message b {
    font-weight: 600;
}

.yard-alert-message em,
.yard-alert-message i {
    font-style: italic;
}

/* Close button */
.yard-alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    margin: -4px 0;
    border-radius: var(--alert-border-radius);
    transition: background-color var(--alert-transition);
    flex-shrink: 0;
}

.yard-alert-close:hover,
.yard-alert-close:focus {
    background-color: rgba(255, 255, 255, 0.1);
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.yard-alert-close:active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Animation for smooth removal */
.yard-alert-container.yard-alert-dismissing {
    animation: yard-alert-slideUp 0.3s ease-out forwards;
}



@keyframes yard-alert-slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
        max-height: 100px;
    }
    to {
        opacity: 0;
        transform: translateY(-100%);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .yard-alert-content {
        gap: .75rem;
    }
    
    .yard-alert-message {
        font-size: 1rem;
    }
    
    .yard-alert-close {
        padding: .25rem .4rem;
    }
}

@media (max-width: 480px) {
    .yard-alert-content {
        align-items: center;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .yard-alert-close {
      
        margin-top: -4px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .yard-alert-container {
        border: 2px solid;
    }
    
    .yard-alert-close:focus {
        outline-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .yard-alert-container.yard-alert-dismissing {
        animation: none;
        display: none;
    }
    
    .yard-alert-close {
        transition: none;
    }
}

/* Print styles */
@media print {
    .yard-alert-container {
        display: none;
    }
}
