/* Custom styles for Mtukati System with African-inspired design */
:root {
    --primary-color: #6B46C1;   /* Purple - strong, brand identity */
    --secondary-color: #FFFFFF; /* White - clean base */
    --accent-color: #22C55E;    /* Softer green (emerald-like) */
    --text-color: #1F2937;      /* Neutral dark gray for readability */
    --muted-color: #F3F4F6;     /* Light gray for subtle backgrounds */
    --warning-color: #F59E0B;   /* Warm golden yellow for alerts/highlights */
}

/* Base styles */
body {
    font-family: 'Ubuntu', sans-serif;
    background: var(--secondary-color);
    color: var(--text-color);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Smooth transitions for interactive elements */
button, a {
    transition: all 0.3s ease;
}

/* Utility classes */
.bg-primary { background: var(--primary-color); }
.text-primary { color: var(--primary-color); }
.bg-accent { background: var(--accent-color); }
.text-accent { color: var(--accent-color); }
.bg-secondary { background: var(--secondary-color); }
.text-secondary { color: var(---secondary-color); }
.bg-muted { background: var(--muted-color); }
.text-muted { color: var(--muted-color); }
.bg-warning { background: var(--warning-color); }
.text-warning { color: var(--warning-color); }

.gradient-text {
    color: var(--primary-color);
    font-weight: 700;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.glass-dark {
    background: rgba(107, 70, 193, 0.2); /* Subtle purple tint */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Card styles */
.card {
    background: var(--secondary-color);
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--accent-color);
}

.card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
}

.listing-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.listing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

/* Typography */
.heading-primary {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.heading-secondary {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    line-height: 1.3;
}

.text-body {
    font-family: 'Ubuntu', sans-serif;
    line-height: 1.6;
}

/* Button styles */
.btn-primary {
    background: var(--primary-color);
    border: none;
    color: var(--secondary-color);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: #5a3ca8; /* Slightly darker purple */
}

.btn-primary:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    transition: left 0.5s;
}

.btn-primary:hover:before {
    left: 100%;
}

.btn-secondary {
    background: var(--accent-color);
    border: none;
    color: var(--text-color);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover {
    background: #16a34a; /* Slightly darker green */
}

.btn-danger {
    background: var(--warning-color);
    border: none;
    color: var(--secondary-color);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-danger:hover {
    background: #d97706; /* Slightly darker yellow */
}

/* Form styles */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-left: 2.5rem;
    border: 1px solid var(--accent-color);
    border-radius: 0.75rem;
    background: var(--muted-color);
    font-size: 0.875rem;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.3);
}

.form-group .input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: var(--accent-color);
    transition: color 0.3s ease;
}

.form-group input:focus + .input-icon,
.form-group select:focus + .input-icon,
.form-group textarea:focus + .input-icon {
    color: var(--primary-color);
}

.form-group .error-message {
    color: var(--warning-color);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Navigation styles */
.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: scale(1.05);
}

.nav-menu-mobile {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    transition: all 0.3s ease;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    display: block;
}

@media (min-width: 640px) {
    .dropdown:hover .dropdown-menu,
    .dropdown:focus-within .dropdown-menu {
        display: block;
    }
}

@media (max-width: 639px) {
    .nav-menu-mobile {
        border: 1px solid var(--accent-color);
    }

    .nav-menu-mobile a {
        font-size: 1rem;
        font-weight: 500;
        transition: all 0.2s ease;
    }

    .nav-menu-mobile a:hover {
        transform: translateX(4px);
    }

    .dropdown-menu {
        transition: none;
    }
}

/* Decorative elements */
.decorative-adinkra {
    position: absolute;
    opacity: 0.6;
    animation: adinkra-pulse 10s ease-in-out infinite;
    fill: none;
    stroke: var(--accent-color);
}

/* Animations */
@keyframes adinkra-pulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.6; }
    50% { transform: scale(1.1) rotate(5deg); opacity: 0.8; }
}

.floating-animation {
    animation: floating 4s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

.slide-in {
    animation: slideIn 0.8s ease-out forwards;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 1s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Message animations */
.message-enter {
    animation: messageSlide 0.6s ease-out;
}

@keyframes messageSlide {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.progress-bar {
    height: 4px;
    background: var(--accent-color);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--primary-color);
    animation: progress 5s linear forwards;
}

@keyframes progress {
    from { width: 100%; }
    to { width: 0; }
}

/* Loading states */
.loading-shimmer {
    background: linear-gradient(90deg, var(--muted-color) 25%, var(--accent-color) 50%, var(--muted-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--muted-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
    border: 2px solid var(--muted-color);
}

::-webkit-scrollbar-thumb:hover {
    background: #5a3ca8;
}

/* Accessibility */
.focus-ring:focus {
    outline: 2px solid transparent;
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.5);
}

.text-balance {
    text-wrap: balance;
}

/* Responsive utilities */
@media (max-width: 640px) {
    .listing-card {
        padding: 1rem;
    }

    .listing-card img, .listing-card .h-40 {
        height: 10rem;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .text-5xl { font-size: 2.5rem; }
    .text-6xl { font-size: 3rem; }
    .text-7xl { font-size: 3.5rem; }
}

/* Print styles */
@media print {
    .no-print { display: none !important; }
    body { background: var(--secondary-color) !important; color: var(--text-color) !important; }
    .bg-primary, .bg-secondary, .bg-accent, .bg-muted, .bg-warning {
        background: var(--primary-color) !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    .shadow-lg, .shadow-xl, .shadow-2xl { box-shadow: none !important; }
    .rounded-lg, .rounded-xl, .rounded-2xl { border-radius: 0.375rem !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .glass-effect, .glass-dark {
        background: var(--secondary-color);
        border: 2px solid var(--primary-color);
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .auto-dark {
        background: var(--primary-color);
        color: var(--secondary-color);
    }
}

/* Ripple effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: var(--accent-color);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to { transform: scale(4); opacity: 0; }
}

.animate-in {
    animation-play-state: running;
}

/* Form-specific styles for login and register */
.form-container {
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem;
    background: var(--muted-color);
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--accent-color);
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header .underline {
    width: 5rem;
    height: 0.125rem;
    background: var(--primary-color);
    border-radius: 9999px;
    margin: 0.5rem auto 0;
}