/* ===================================
   CSS Variables for Theme Management
   =================================== */
:root {
    /* Light Theme Colors */
    --primary-color: #2563eb;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    --transition: all 0.3s ease;
}

/* Dark Theme */
body.dark-mode {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    
    --border-color: #374151;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.3);
}

/* ===================================
   Global Styles
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* ===================================
   Header & Navigation
   =================================== */
header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.navbar {
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
    background-color: var(--bg-secondary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.mobile-menu-toggle {
    display: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
}

.mobile-menu {
    display: none;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.mobile-menu a {
    display: block;
    padding: 0.75rem 20px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.mobile-menu a:hover {
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
}

.mobile-menu.active {
    display: block;
}

/* ===================================
   Hero Section
   =================================== */
.hero {
    background: var(--gradient-1);
    color: white;
    padding: 4rem 0 3rem;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.hero-description {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
    line-height: 1.8;
}

/* ===================================
   AdSense Container
   =================================== */
.adsense-container {
    padding: 2rem 0;
    background-color: var(--bg-secondary);
}

.adsense-placeholder {
    background-color: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-tertiary);
    font-style: italic;
}

/* ===================================
   Tool Section
   =================================== */
.tool-section {
    padding: 4rem 0;
}

.tool-container {
    background-color: var(--bg-secondary);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
}

.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-header h2 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.tool-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.generate-button-container {
    text-align: center;
    margin: 2rem 0;
}

.generate-btn {
    background: var(--gradient-1);
    color: white;
    border: none;
    padding: 1.2rem 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.generate-btn:active {
    transform: translateY(-1px);
}

.generate-btn i {
    font-size: 1.3rem;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ===================================
   Animal Result Card
   =================================== */
.animal-result {
    margin-top: 2rem;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animal-card {
    background-color: var(--bg-primary);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.animal-image-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background-color: var(--bg-tertiary);
}

.animal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.animal-category-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-color);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
}

body.dark-mode .animal-category-badge {
    background: rgba(31, 41, 55, 0.95);
    color: var(--secondary-color);
}

.animal-info {
    padding: 2.5rem;
}

.animal-name {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.animal-scientific {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 2rem;
}

.animal-details {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    transition: var(--transition);
}

.detail-item:hover {
    background-color: var(--bg-tertiary);
    transform: translateX(5px);
}

.detail-item i {
    font-size: 1.3rem;
    color: var(--primary-color);
    min-width: 24px;
    margin-top: 2px;
}

.detail-item strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.detail-item span {
    color: var(--text-secondary);
}

.status-badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-badge.least-concern {
    background-color: #10b981;
    color: white;
}

.status-badge.near-threatened {
    background-color: #f59e0b;
    color: white;
}

.status-badge.vulnerable,
.status-badge.endangered {
    background-color: #ef4444;
    color: white;
}

.status-badge.critically-endangered {
    background-color: #991b1b;
    color: white;
}

.animal-facts {
    background: var(--gradient-3);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    color: white;
}

.animal-facts h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.animal-facts ul {
    list-style: none;
}

.animal-facts li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.7;
}

.animal-facts li::before {
    content: "•";
    position: absolute;
    left: 0;
    font-size: 1.5rem;
    font-weight: bold;
}

.animal-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* ===================================
   Features Section
   =================================== */
.features-section {
    padding: 4rem 0;
    background-color: var(--bg-secondary);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background-color: var(--bg-primary);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient-1);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1.5rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===================================
   SEO Content Section
   =================================== */
.seo-content {
    padding: 4rem 0;
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.content-wrapper h2 {
    font-size: 2.2rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.content-wrapper h3 {
    font-size: 1.7rem;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content-wrapper p {
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 1.5rem;
}

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

.content-wrapper li {
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 0.75rem;
    list-style: inherit;
}

.content-wrapper strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ===================================
   Footer
   =================================== */
.footer {
    background-color: var(--bg-secondary);
    padding: 3rem 0 1rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-section h3 {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.footer-section ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-section a {
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 45px;
    height: 45px;
    background-color: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* ===================================
   Contact Page Styles
   =================================== */
.contact-section {
    padding: 4rem 0;
}

.contact-header {
    text-align: center;
    margin-bottom: 3rem;
}

.contact-header h1 {
    font-size: 3rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.contact-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.contact-card {
    background-color: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.contact-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-1);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
}

.contact-card h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.contact-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.contact-link {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
}

.contact-link:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.contact-info-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.5rem;
    word-break: break-all;
}

/* ===================================
   Page Content Styles
   =================================== */
.page-section {
    padding: 4rem 0;
    min-height: 60vh;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 0;
    background: var(--gradient-1);
    color: white;
    border-radius: 20px;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.2rem;
    opacity: 0.95;
}

.page-content {
    max-width: 900px;
    margin: 0 auto;
    background-color: var(--bg-secondary);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.page-content h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.page-content h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.page-content p {
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 1.5rem;
}

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

.page-content li {
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 0.75rem;
    list-style: inherit;
}

.page-content strong {
    color: var(--text-primary);
}

.page-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.page-content a:hover {
    color: #1d4ed8;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 968px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .tool-container {
        padding: 2rem 1.5rem;
    }
    
    .tool-header h2 {
        font-size: 2rem;
    }
    
    .generate-btn {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .animal-name {
        font-size: 2rem;
    }
    
    .animal-info {
        padding: 1.5rem;
    }
    
    .animal-image-container {
        height: 300px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .page-content {
        padding: 2rem 1.5rem;
    }
    
    .page-header h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 2rem 0 1.5rem;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .logo span {
        font-size: 0.9rem;
    }
    
    .tool-header h2 {
        font-size: 1.7rem;
    }
    
    .animal-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}