/* =========================================
   Base Styles (Desktop First Approach)
   ========================================= */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Modern, readable font stack */
    background-color: #f0f2f5; /* Neutral background for contrast */
    margin: 0;
    padding: 20px; /* Default padding for desktop layout */
}

.container {
    max-width: 1000px; /* Restricts content width for readability */
    margin: 0 auto; /* Centers content horizontally */
    background: white;
    padding: 25px;
    border-radius: 10px; /* Rounded corners for modern look */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* Subtle shadow for depth */
}

header {
    margin-bottom: 25px; /* Spacing below header */
}

h1 {
    color: #333;
    border-bottom: 3px solid #ffcc00; /* Engineering yellow accent */
    display: inline-block;
    padding-bottom: 5px;
    margin-top: 0;
}

/* =========================================
   Search Box Styling
   ========================================= */
.search-box input {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    box-sizing: border-box; /* Ensures padding does not exceed width */
    transition: border-color 0.3s; /* Smooth focus effect */
}

.search-box input:focus {
    border-color: #ffcc00; /* Highlight border on focus */
    outline: none;
}

/* =========================================
   Table Styles (Core Dashboard Component)
   ========================================= */
/* Wrapper ensures horizontal scrolling on mobile without breaking layout */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    border: 1px solid #eee; /* Subtle border to define scroll area */
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Minimum width to trigger horizontal scroll if needed */
}

th {
    background-color: #2c3e50; /* Dark engineering blue */
    color: white;
    text-align: left;
    padding: 15px;
    white-space: nowrap; /* Prevents header text wrapping */
}

td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    font-size: 15px;
    vertical-align: middle;
}

tr:hover {
    background-color: #f8f9fa; /* Hover effect for better UX */
}

/* First column styling (Checklist Item column) */
td:first-child {
    font-weight: 600;
    color: #2c3e50;
    min-width: 150px; /* Prevents item names from being too compressed */
}

/* =========================================
   Status Logic (Engineering Color Code)
   ========================================= */
/* Common badge styling */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px; /* Pill-shaped badge */
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap; /* Prevents line breaks in long statuses */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Status variations */
.status-ok {
    color: #155724;
    background-color: #d4edda; /* Soft green */
    border: 1px solid #c3e6cb;
}

.status-pendente {
    color: #721c24;
    background-color: #f8d7da; /* Soft red */
    border: 1px solid #f5c6cb;
}

.status-andamento {
    color: #856404;
    background-color: #fff3cd; /* Soft yellow */
    border: 1px solid #ffeeba;
}

/* =========================================
   Responsive Design (Media Queries)
   ========================================= */

/* Tablets and large phones (up to 768px) */
@media screen and (max-width: 768px) {
    body {
        padding: 10px; /* Reduce outer spacing */
    }

    .container {
        padding: 15px; /* Reduce inner spacing */
    }

    h1 {
        font-size: 1.8rem; /* Slightly smaller heading */
    }

    th, td {
        padding: 10px 8px;
        font-size: 14px; /* Slightly smaller text */
    }

    .status-badge {
        padding: 4px 8px; /* Compact badges */
        font-size: 11px;
    }
}

/* Small phones (up to 480px) - App-like layout */
@media screen and (max-width: 480px) {
    body {
        padding: 0; /* Remove all padding */
        background-color: white; /* Blend background with container */
    }

    .container {
        box-shadow: none; /* Flat design for mobile */
        border-radius: 0;
        padding: 15px 10px;
        margin-top: 0;
    }

    header {
        text-align: center; /* Center title on mobile */
        margin-bottom: 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    /* Important for iOS: 16px prevents auto-zoom on input focus */
    .search-box input {
        font-size: 16px; 
        padding: 12px;
    }

    th, td {
        padding: 8px 5px;
        font-size: 13px;
    }
    
    td:first-child {
        min-width: 120px; /* Slightly smaller first column */
        font-size: 13px;
    }
}
