/* GrantScope Africa - Custom Styles */

/* CSS Variables for Theme Colors */
:root {
    --primary-amber: #f59e0b;
    --primary-orange: #ea580c;
    --secondary-blue: #1e40af;
    --accent-green: #059669;
    --earth-brown: #92400e;
    --stone-light: #f5f5f4;
    --stone-dark: #1c1917;
    --gradient-primary: linear-gradient(135deg, var(--primary-amber), var(--primary-orange));
    --gradient-hero: linear-gradient(135deg, #92400e, #ea580c, #f59e0b);
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-card-hover: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 8px 12px -4px rgba(0, 0, 0, 0.1);
}

/* Global Styles */
* {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* Hero Section */
.hero-gradient {
    background: var(--gradient-hero);
    background-size: 300% 300%;
    animation: gradientShift 8s ease infinite;
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.1"><circle cx="30" cy="30" r="2"/></g></svg>') repeat;
    pointer-events: none;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* CTA Button */
.cta-button {
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(245, 158, 11, 0.4);
}

/* Filter Selects */
.filter-select {
    transition: all 0.3s ease;
    background-image: url('data:image/svg+xml,<svg fill="%23666" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1.5em;
    appearance: none;
}

.filter-select:focus {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.15);
}

/* Opportunity Cards */
.opportunity-card {
    box-shadow: var(--shadow-card);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(245, 158, 11, 0.1);
    position: relative;
    overflow: hidden;
}

.opportunity-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.opportunity-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(245, 158, 11, 0.3);
}

.opportunity-card:hover::before {
    transform: scaleX(1);
}

/* Text Clamp Utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

.animate-modal {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Live Indicator Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Hover Effects for Buttons */
button, .button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover, .button:hover {
    transform: translateY(-1px);
}

/* Form Focus States */
input:focus, textarea:focus, select:focus {
    outline: none;
    ring-width: 2px;
    ring-color: var(--primary-amber);
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.15);
}

/* Navigation Link Hover */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Loading Spinner */
.loading-spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid var(--primary-amber);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .hero-gradient h2 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-gradient p {
        font-size: 1.125rem;
    }
    
    .opportunity-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 640px) {
    .hero-gradient {
        padding: 3rem 0;
    }
    
    .hero-gradient h2 {
        font-size: 2rem;
    }
    
    .hero-gradient p {
        font-size: 1rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus visible for keyboard navigation */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-amber);
    outline-offset: 2px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--stone-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-amber);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-orange);
}

/* Print Styles */
@media print {
    .hero-gradient,
    nav,
    footer,
    #contact,
    .affiliate-block {
        display: none;
    }
    
    .opportunity-card {
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 1rem;
        page-break-inside: avoid;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .opportunity-card {
        border: 2px solid var(--stone-dark);
    }
    
    .hero-gradient {
        background: var(--stone-dark);
        color: white;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    :root {
        --stone-light: #1c1917;
        --stone-dark: #f5f5f4;
    }
    
    body {
        background-color: var(--stone-light);
        color: var(--stone-dark);
    }
    
    .opportunity-card {
        background-color: #292524;
        border-color: #44403c;
    }
}

/* Safari-specific fixes */
@supports (-webkit-appearance: none) {
    .filter-select {
        background-position: right 0.5rem center;
    }
}

/* Firefox-specific fixes */
@-moz-document url-prefix() {
    .filter-select {
        background-image: none;
        padding-right: 1rem;
    }
}