/* components.css - Reusable components */

/* Card component */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 0.5rem;
    border: 3px solid var(--accent-pink);
    box-shadow: 
        0 0 15px rgba(192, 0, 192, 0.5),
        inset 0 0 0 2px var(--accent-gold),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.2), transparent);
    transition: left 0.6s ease-in-out;
}

.card:hover::before {
    left: 150%;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 0 25px rgba(192, 0, 192, 0.7),
        inset 0 0 0 2px var(--accent-gold),
        inset 0 0 30px rgba(255, 215, 0, 0.15);
    border-color: var(--accent-gold);
}

/* Card title styling */
.card-title-retro {
    font-family: 'VT323', monospace;
    font-size: 1.5rem;
    color: var(--accent-gold);
    text-shadow: 1px 1px 0px var(--accent-purple);
    margin-bottom: 0.5rem;
}

/* Button component */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    color: white;
    border: 2px solid var(--accent-gold);
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.5);
    border-color: var(--accent-gold);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.2));
    color: var(--accent-gold);
    border: 2px solid var(--accent-gold);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.3));
    transform: translateY(-2px);
}

/* Form components */
.form-input {
    background: rgba(13, 13, 43, 0.8);
    border: 2px solid var(--accent-purple);
    border-radius: 0.25rem;
    color: var(--primary-text);
    padding: 0.75rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
    outline: none;
}

.form-input::placeholder {
    color: rgba(0, 224, 240, 0.6);
}

/* Modal component */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(20, 10, 40, 0.95);
    z-index: 9999;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: var(--secondary-bg);
    border-radius: 1rem;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    max-width: 600px;
    width: 100%;
    padding: 2rem;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 1.75rem;
    color: var(--accent-gold);
    background: rgba(0, 0, 0, 0.3);
    border: none;
    cursor: pointer;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Loading component */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid var(--accent-purple);
    border-top: 4px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Filter/Search components */
.filter-container {
    background: rgba(13, 13, 43, 0.8);
    border: 2px solid var(--accent-purple);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 2rem;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.filter-tag {
    padding: 0.25rem 0.75rem;
    background: var(--accent-purple);
    color: white;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
}

/* Responsive utilities */
@media (max-width: 768px) {
    .modal {
        padding: 1rem;
    }
    
    .modal-content {
        padding: 1rem;
        border-radius: 0.5rem;
        max-height: 95vh;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border-width: 4px;
        border-color: var(--accent-gold);
    }
    
    .btn {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .card {
        transition: none;
    }
    
    .card::before {
        transition: none;
    }
    
    .btn {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* Semantic component improvements */
article.card {
    outline: none;
}

article.card:focus-within {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

/* Button state improvements */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Homepage juice box animation */
@keyframes subtle-pulse-glow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(192, 0, 192, 0.6);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(192, 0, 192, 0.9), 0 0 10px rgba(255, 221, 0, 0.5);
    }
}

.animate-pulse-subtle img {
    animation: subtle-pulse-glow 4s ease-in-out infinite;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.animate-pulse-subtle img:hover {
    transform: scale(1.1);
    animation-play-state: paused;
}