/* ========================================
   Philippine Cockfighting Evolution Website
   Responsive, Accessible, SEO-friendly CSS
   ======================================== */

/* ========== ROOT & VARIABLES ========== */
:root {
    --primary-color: #8B0000;
    --primary-dark: #6B0000;
    --primary-light: #A52A2A;
    --secondary-color: #F4A460;
    --accent-color: #FFD700;
    --text-dark: #1a1a1a;
    --text-light: #4a4a4a;
    --bg-light: #f8f8f8;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --success-color: #27ae60;
    --warning-color: #e67e22;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --transition: all 0.3s ease;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* ========== RESET & GLOBAL STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    overflow-x: hidden;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin: 1.5em 0 0.5em 0;
    line-height: 1.3;
    color: var(--text-dark);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    color: var(--primary-color);
}

h3 {
    font-size: 1.5rem;
    color: var(--primary-dark);
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.1rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin: 1em 0;
    font-size: 1rem;
}

strong {
    font-weight: 700;
    color: var(--primary-dark);
}

em {
    font-style: italic;
    color: var(--primary-color);
}

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

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

a:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* ========== LISTS ========== */
ul, ol {
    margin: 1em 0;
    padding-left: 2em;
}

ul li, ol li {
    margin: 0.5em 0;
    line-height: 1.8;
}

ul.feature-list {
    list-style: none;
    padding-left: 0;
}

ul.feature-list li {
    margin: 0.8em 0;
    padding-left: 1.5em;
    position: relative;
}

ul.feature-list li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* ========== BANNER ========== */
.banner {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.banner-link {
    display: block;
    width: 100%;
    height: auto;
    overflow: hidden;
}

.banner-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 80px;
    object-fit: cover;
    transition: var(--transition);
}

.banner-link:hover .banner-image {
    opacity: 0.9;
    transform: scale(1.02);
}

/* ========== NAVIGATION ========== */
.navbar {
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 80px;
    z-index: 99;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom-color: var(--secondary-color);
}

.nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    user-select: none;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    margin: 4px 0;
    transition: var(--transition);
    border-radius: 2px;
}

/* ========== MAIN CONTENT ========== */
main {
    flex: 1;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--primary-light);
}

.page-header h2 {
    color: var(--primary-color);
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    margin: 0.5rem 0 0 0;
}

article section {
    margin: 2.5rem 0;
    padding: 1.5rem 0;
}

/* ========== HERO SECTION ========== */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--bg-white);
    padding: 4rem 2rem;
    text-align: center;
}

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

.hero h2 {
    color: var(--accent-color);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin: 0;
    opacity: 0.95;
}

/* ========== IMAGE STYLES ========== */
.featured-image {
    margin: 2rem 0;
    text-align: center;
}

.content-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.content-image:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ========== CARDS ========== */
.overview-cards {
    margin: 3rem 0;
}

.overview-cards h3 {
    text-align: center;
    margin-bottom: 2rem;
}

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

.card {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border-top: 4px solid var(--primary-color);
    display: flex;
    flex-direction: column;
}

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

.card h4 {
    color: var(--primary-color);
    margin-top: 0;
}

.card p {
    flex-grow: 1;
    color: var(--text-light);
    font-size: 0.95rem;
}

.card-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-color);
    font-weight: 600;
    transition: var(--transition);
}

.card-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ========== INFOGRAPHIC PAGE ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    text-align: center;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.stat-value {
    display: block;
    font-size: 2.3rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1.1;
}

.stat-label {
    display: block;
    margin-top: 0.75rem;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.farm-card {
    border-top-width: 5px;
}

.farm-card h4 {
    margin-bottom: 0.35rem;
}

.farm-location {
    margin: 0 0 0.75rem 0;
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 600;
}

.infographic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.chart-panel {
    margin: 0;
}

.chart-panel h3,
.chart-panel h4 {
    margin-top: 0;
}

.chart-container {
    position: relative;
    width: 100%;
    min-height: 320px;
    height: 360px;
}

.chart-container.chart-container-wide {
    min-height: 340px;
    height: 380px;
}

.lifecycle-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.lifecycle-step {
    position: relative;
    padding-top: 1.25rem;
}

.lifecycle-step::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 56px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 999px;
}

.lifecycle-step h4 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.lifecycle-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: var(--primary-color);
    color: var(--bg-white);
    font-weight: 700;
}

.infographic-note {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ========== INFO BOXES ========== */
.info-box {
    background: #f0f7ff;
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 4px;
    margin: 1.5rem 0;
}

.info-box h4 {
    color: var(--primary-dark);
    margin-top: 0;
}

.highlight-box {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.05) 0%, rgba(245, 165, 96, 0.05) 100%);
    border: 2px solid var(--secondary-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.stat-box {
    background: var(--accent-color);
    color: var(--primary-dark);
    padding: 1.5rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-weight: 600;
}

.stat-box p {
    margin: 0.5rem 0;
}

/* ========== TABLES ========== */
.table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    border-radius: 6px;
    overflow: hidden;
}

th {
    background: var(--primary-color);
    color: var(--bg-white);
    padding: 1rem;
    text-align: left;
    font-weight: 700;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

tr:last-child td {
    border-bottom: none;
}

tr:nth-child(even) {
    background: rgba(139, 0, 0, 0.02);
}

tr:hover {
    background: rgba(139, 0, 0, 0.05);
}

/* ========== NAVIGATION LINKS ========== */
.section-nav {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 6px;
    margin: 2rem 0;
}

.section-nav p {
    margin: 0 0 1rem 0;
    font-weight: 600;
    color: var(--primary-color);
}

.section-nav ul {
    margin: 0;
    padding-left: 1.5em;
}

.section-nav a {
    display: block;
    padding: 0.5rem 0;
    transition: var(--transition);
}

.section-nav a:hover {
    color: var(--primary-dark);
    padding-left: 0.5rem;
}

/* ========== FOOTER ========== */
footer {
    background: var(--primary-dark);
    color: var(--bg-white);
    margin-top: 3rem;
    padding-top: 3rem;
}

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

.footer-section h5 {
    color: var(--accent-color);
    margin-top: 0;
    margin-bottom: 1rem;
}

.footer-section p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
}

.footer-section ul {
    list-style: none;
    padding-left: 0;
}

.footer-section li {
    margin: 0.5rem 0;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    background: var(--primary-color);
    margin-top: 2rem;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    /* Navigation */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 180px;
        flex-direction: column;
        background-color: var(--bg-white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-md);
        padding: 2rem 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 0;
    }

    .nav-link {
        padding: 1rem;
        border-bottom: none;
        border-left: 4px solid transparent;
        transition: var(--transition);
    }

    .nav-link:hover,
    .nav-link.active {
        border-left-color: var(--primary-color);
        border-bottom: none;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-8px, 8px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(45deg) translate(-8px, -8px);
    }

    /* Typography */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Container */
    .container {
        padding: 1.5rem;
    }

    .page-header {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }

    /* Hero */
    .hero {
        padding: 2rem 1rem;
    }

    .hero h2 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1rem;
    }

    /* Cards */
    .cards-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid,
    .infographic-grid,
    .lifecycle-grid {
        grid-template-columns: 1fr;
    }

    .chart-container,
    .chart-container.chart-container-wide {
        min-height: 280px;
        height: 320px;
    }

    /* Navigation logo */
    .nav-logo h1 {
        font-size: 1.1rem;
    }

    .nav-container {
        padding: 1rem;
    }

    /* Table */
    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .container {
        padding: 1rem;
    }

    .port-header {
        margin-bottom: 1.5rem;
    }

    .cards-grid {
        gap: 1rem;
    }

    .card {
        padding: 1rem;
    }

    .stat-card {
        min-height: 150px;
    }

    .stat-value {
        font-size: 2rem;
    }

    .hero {
        padding: 1.5rem 1rem;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .nav-container {
        padding: 0.75rem 1rem;
    }

    .nav-logo h1 {
        font-size: 0.9rem;
    }

    section {
        margin: 1.5rem 0;
        padding: 1rem 0;
    }
}

/* ========== ACCESSIBILITY FOCUS STATES ========== */
button:focus,
a:focus,
input:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* ========== PRINT STYLES ========== */
@media print {
    .banner,
    .navbar,
    .hamburger,
    .section-nav,
    footer {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    a {
        color: inherit;
    }

    article {
        page-break-inside: avoid;
    }

    h2, h3, h4 {
        page-break-after: avoid;
    }
}

/* ========== PREFERS-REDUCED-MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========== DARK MODE SUPPORT ========== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #e0e0e0;
        --text-light: #b0b0b0;
        --bg-light: #1a1a1a;
        --bg-white: #2d2d2d;
        --border-color: #444;
    }

    .banner-image {
        opacity: 0.9;
    }

    .navbar {
        background: var(--text-dark);
        color: var(--bg-white);
    }

    .nav-link {
        color: var(--text-dark);
    }

    .card {
        background: var(--bg-white);
        color: var(--text-dark);
    }

    .info-box {
        background: rgba(255, 255, 255, 0.05);
    }

    .highlight-box {
        background: rgba(255, 255, 255, 0.05);
    }

    table {
        background: var(--bg-white);
    }

    .nav-menu {
        background-color: var(--bg-white);
    }
}

/* ========== CONTACT FORM STYLES ========== */
.contact-section {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    margin: 2rem 0;
}

.contact-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.form-control:invalid:not(:placeholder-shown) {
    border-color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.05);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.form-help {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.form-error {
    display: block;
    font-size: 0.85rem;
    color: #e74c3c;
    margin-top: 0.25rem;
    min-height: 1.2em;
}

.form-error.show {
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    margin: 1.5rem 0;
}

.form-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    margin-top: 0.25rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label {
    display: inline;
    margin: 0;
    font-weight: normal;
    cursor: pointer;
    line-height: 1.5;
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: underline;
}

.checkbox-label a:hover {
    color: var(--primary-dark);
}

/* Form Buttons */
button[type="submit"],
button[type="reset"] {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
}

.btn-submit {
    background: var(--primary-color);
    color: white;
    margin-right: 1rem;
}

.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-reset {
    background: var(--border-color);
    color: var(--text-dark);
    border: 1px solid var(--text-dark);
}

.btn-reset:hover {
    background: var(--bg-light);
    transform: translateY(-2px);
}

/* Form Status Messages */
.form-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
    display: none;
}

.form-status.show {
    display: block;
    animation: slideIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-status.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Contact Information Section */
.contact-info {
    margin: 3rem 0;
}

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

.contact-item {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.contact-item h4 {
    color: var(--primary-color);
    margin-top: 0;
}

.contact-item p {
    margin: 0.5rem 0;
    color: var(--text-light);
}

.contact-item a {
    color: var(--primary-color);
    font-weight: 600;
}

/* FAQ Section */
.faq-section {
    background: #f9f9f9;
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.faq-item {
    margin: 1.5rem 0;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.faq-item p {
    margin: 0;
    color: var(--text-light);
}

.faq-item a {
    color: var(--primary-color);
}

/* Mobile Responsive Forms */
@media (max-width: 768px) {
    .contact-form {
        max-width: 100%;
    }

    .btn-submit {
        margin-right: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .checkbox-group {
        align-items: center;
    }

    .form-checkbox {
        margin-right: 0.5rem;
        margin-top: 0;
    }

    .contact-details {
        grid-template-columns: 1fr;
    }

    .faq-section {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .contact-section {
        padding: 1rem;
    }

    button[type="submit"],
    button[type="reset"] {
        width: 100%;
        padding: 0.75rem 1rem;
        margin-bottom: 0.5rem;
    }

    .btn-submit {
        margin-right: 0;
    }

    label {
        font-size: 0.95rem;
    }

    .form-control {
        font-size: 16px;
    }
}
