/* Custom CSS for Kenya Onions Website */

:root {
    --primary-blue: #0d6efd;
    --primary-purple: #6610f2;
    --primary-indigo: #6f42c1;
    --success-green: #198754;
    --info-cyan: #0dcaf0;
    --warning-yellow: #ffc107;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}

/* Improve readability */
p, li {
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Enhanced color palette for better visual appeal */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-purple) 100%) !important;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card enhancements */
.card {
    border-radius: 12px;
    overflow: hidden;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: none;
    border-radius: 12px 12px 0 0 !important;
}

/* Hero section enhancements */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="2" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1.5" fill="white" opacity="0.08"/><circle cx="50" cy="10" r="1" fill="white" opacity="0.06"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: 800;
}

/* Card hover effects */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Navbar enhancements */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.7rem 1rem !important;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    border-radius: 5px;
}

/* Form styling */
.form-control:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-select:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Button enhancements */
.btn {
    font-weight: 500;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.5px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    border: none;
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(13, 110, 253, 0.4);
}

.btn-success {
    box-shadow: 0 4px 8px rgba(25, 135, 84, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(25, 135, 84, 0.4);
}

/* Badge styling */
.badge {
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
}

/* Table enhancements */
.table th {
    background-color: rgba(13, 110, 253, 0.1);
    font-weight: 600;
    border: none;
    color: var(--primary-blue);
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(13, 110, 253, 0.03);
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.08);
}

/* Alert enhancements */
.alert {
    border: none;
    border-radius: 12px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.1), rgba(25, 135, 84, 0.05));
    color: var(--success-green);
    border-left: 4px solid var(--success-green);
}

/* Footer styling */
footer {
    background-color: #2d3436 !important;
}

footer a {
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--warm-orange) !important;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
    }
    
    .btn-lg {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}

/* Animation for success messages */
@keyframes slideInFromTop {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert {
    animation: slideInFromTop 0.5s ease-out;
}

/* Improved link styling */
a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-purple);
    text-decoration: underline;
}

/* Card header enhancements */
.card-header {
    border-bottom: 2px solid rgba(40, 167, 69, 0.1);
    font-weight: 600;
}

/* Statistics cards */
.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning {
    border: none;
    border-radius: 10px;
}

/* Blog post content styling */
.article-content h3 {
    color: var(--primary-blue);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.article-content h4 {
    color: var(--primary-purple);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

/* Sticky sidebar */
@media (min-width: 992px) {
    .sticky-top {
        position: sticky;
        z-index: 1020;
    }
}

/* Loading animation for buttons */
.btn.loading {
    pointer-events: none;
    opacity: 0.6;
}

.btn.loading::after {
    content: "";
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    display: inline-block;
    animation: spin 1s linear infinite;
}

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

/* Improved spacing */
section {
    padding: 4rem 0;
}

@media (max-width: 768px) {
    section {
        padding: 2.5rem 0;
    }
}

/* Enhanced typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-weight: 700;
}

/* SEO-optimized text styling */
strong, b {
    color: var(--dark-green);
    font-weight: 600;
}

/* Breadcrumb styling */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 2rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--primary-green);
    content: ">";
    font-weight: bold;
}

/* Social share buttons */
.btn-outline-primary:hover {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-outline-info:hover {
    background-color: #17a2b8;
    border-color: #17a2b8;
}

/* Contact section enhancements */
#contact .card {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Pricing highlight */
.text-success.fw-bold {
    font-size: 1.2em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* Improved accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* Floating WhatsApp Button */
.floating-whatsapp {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999 !important;
    pointer-events: none;
}

.floating-whatsapp * {
    pointer-events: auto;
}

.whatsapp-btn {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #25d366 !important;
    border-radius: 50%;
    color: white !important;
    font-size: 28px;
    text-decoration: none !important;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.8) !important;
    transition: all 0.3s ease;
    animation: whatsappPulse 2s infinite, whatsappShake 3s infinite ease-in-out;
    border: 3px solid white;
}

.whatsapp-text {
    position: absolute;
    font-size: 24px;
    z-index: 2;
}

.whatsapp-btn:hover {
    background: linear-gradient(135deg, #20b358, #1da851);
    transform: scale(1.1);
    color: white;
    text-decoration: none;
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
}

.whatsapp-btn:focus {
    color: white;
    text-decoration: none;
}

.pulse-ring {
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 3px solid rgba(37, 211, 102, 0.4);
    border-radius: 50%;
    animation: whatsappRingPulse 2s infinite;
}

/* Pulsing animation for the button */
@keyframes whatsappPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
    }
}

/* Ring pulse animation */
@keyframes whatsappRingPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Shake/vibrate animation */
@keyframes whatsappShake {
    0%, 20%, 40%, 60%, 80%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
    15%, 35%, 55%, 75%, 95% {
        transform: translateX(2px);
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .floating-whatsapp {
        bottom: 15px;
        right: 15px;
    }
    
    .whatsapp-btn {
        width: 55px;
        height: 55px;
        font-size: 24px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .whatsapp-btn {
        animation: none;
    }
    
    .pulse-ring {
        animation: none;
    }
}

/* Highlighted Quote Button Styles */
.quote-button-highlight {
    position: relative;
    background: linear-gradient(135deg, #0d6efd, #198754, #0dcaf0) !important;
    background-size: 300% 300% !important;
    border: 3px solid #fff !important;
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.6), 0 0 30px rgba(25, 135, 84, 0.4) !important;
    animation: quotePulse 2s infinite, quoteGradient 3s ease infinite, quoteShake 4s infinite ease-in-out !important;
    font-weight: 700 !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3) !important;
    letter-spacing: 1px !important;
    overflow: hidden;
    color: white !important;
}

/* Override btn-light styles for quote button */
.btn-light.quote-button-highlight,
a.btn-light.quote-button-highlight,
.btn.btn-light.quote-button-highlight {
    background: linear-gradient(135deg, #0d6efd, #198754, #0dcaf0) !important;
    background-size: 300% 300% !important;
    border: 3px solid #fff !important;
    border-color: #fff !important;
    color: white !important;
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.6), 0 0 30px rgba(25, 135, 84, 0.4) !important;
    animation: quotePulse 2s infinite, quoteGradient 3s ease infinite, quoteShake 4s infinite ease-in-out !important;
    font-weight: 700 !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3) !important;
    letter-spacing: 1px !important;
    position: relative;
    overflow: hidden;
}

.btn-light.quote-button-highlight:hover,
a.btn-light.quote-button-highlight:hover,
.btn.btn-light.quote-button-highlight:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 12px 35px rgba(13, 110, 253, 0.8), 0 0 40px rgba(25, 135, 84, 0.6) !important;
    animation: quotePulse 1s infinite, quoteGradient 2s ease infinite, quoteShake 2s infinite ease-in-out !important;
    color: white !important;
    border-color: #fff !important;
}

/* Override btn-success styles for quote button */
.btn-success.quote-button-highlight {
    background: linear-gradient(135deg, #0d6efd, #198754, #0dcaf0) !important;
    border-color: #fff !important;
    color: white !important;
}

.quote-button-highlight::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #f9ca24);
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: quoteRing 3s linear infinite;
}

.quote-button-highlight:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 12px 35px rgba(13, 110, 253, 0.8), 0 0 40px rgba(25, 135, 84, 0.6) !important;
    animation: quotePulse 1s infinite, quoteGradient 2s ease infinite, quoteShake 2s infinite ease-in-out !important;
}

.quote-button-highlight:focus {
    outline: 3px solid #ffc107 !important;
    outline-offset: 3px !important;
}

/* Quote Button Animations */
@keyframes quotePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(13, 110, 253, 0.6), 0 0 30px rgba(25, 135, 84, 0.4);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 12px 35px rgba(13, 110, 253, 0.8), 0 0 40px rgba(25, 135, 84, 0.6);
    }
}

@keyframes quoteGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes quoteShake {
    0%, 20%, 40%, 60%, 80%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-1px) rotate(-0.5deg);
    }
    15%, 35%, 55%, 75%, 95% {
        transform: translateX(1px) rotate(0.5deg);
    }
}

@keyframes quoteRing {
    0% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 50% 0%;
    }
    50% {
        background-position: 100% 50%;
    }
    75% {
        background-position: 50% 100%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Mobile responsive adjustments for quote button */
@media (max-width: 768px) {
    .quote-button-highlight {
        animation: quotePulse 3s infinite, quoteGradient 4s ease infinite !important;
    }
}

/* Accessibility improvements for quote button */
@media (prefers-reduced-motion: reduce) {
    .quote-button-highlight {
        animation: none !important;
    }
    
    .quote-button-highlight::before {
        animation: none !important;
    }
}

/* Print styles */
@media print {
    .navbar, .btn, footer, .floating-whatsapp {
        display: none !important;
    }
    
    .container {
        max-width: 100% !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}
