import React from 'react';
import './HomeView.css';

function HomeView({ onScanClick, onSearchClick }) {
  return (
    <div className="home-container">
      <header className="home-header">
        <h1 className="home-logo">💊 FarmaFinder</h1>
        <p className="home-subtitle">Find your medicine at nearby pharmacies quickly and easily.</p>
      </header>

      <div className="home-grid">
        <button className="home-card scan-card" onClick={onScanClick} aria-label="Scan TSI Card">
          <div className="card-badge">Fast Access</div>
          <div className="card-icon-container">
            <span className="card-icon">📷</span>
            <div className="pulse-ring"></div>
            <div className="pulse-ring-outer"></div>
          </div>
          <div className="card-content">
            <h3>Scan TSI Card</h3>
            <p>Scan your health card (Tarjeta Sanitaria Individual) barcode or QR code with your camera to instantly view your active prescriptions.</p>
          </div>
          <div className="card-action">
            <span>Scan now</span>
            <span className="action-arrow">→</span>
          </div>
        </button>

        <button className="home-card search-card" onClick={onSearchClick} aria-label="Manual Search">
          <div className="card-icon-container">
            <span className="card-icon">🔍</span>
          </div>
          <div className="card-content">
            <h3>Manual Search</h3>
            <p>Search for a specific medicine by typing its name, active ingredient, or register number to check availability in real-time.</p>
          </div>
          <div className="card-action">
            <span>Search catalogue</span>
            <span className="action-arrow">→</span>
          </div>
        </button>
      </div>

      <footer className="home-footer">
        <p>🔒 Your medical and personal data is secure. FarmaFinder complies with data protection regulations and does not store sensitive card information.</p>
      </footer>
    </div>
  );
}

export default HomeView;
