/* -----------------------------------------
   CORPORATE FITNESS THEME
------------------------------------------*/
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Page container */
#app {
    max-width: 900px;
    margin: 30px auto;
    padding: 20px;
}

/* -----------------------------------------
   HEADINGS
------------------------------------------*/
h1 {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    text-align: center;
    color: #0066cc;
    margin-bottom: 25px;
    letter-spacing: -0.5px;
}

/* -----------------------------------------
   INFO PANEL
------------------------------------------*/
#infoPanel {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.label {
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #666;
    font-weight: 500;
}

.value {
    color: #0066cc;
    font-weight: 600;
}

/* -----------------------------------------
   SELECT DROPDOWNS
------------------------------------------*/
select {
    padding: 10px 14px;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #ffffff;
    color: #333;
    transition: 0.2s;
    font-family: 'Segoe UI', Arial, sans-serif;
}

select:hover {
    border-color: #0066cc;
}

select:focus {
    border-color: #0066cc;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* -----------------------------------------
   BUTTONS
------------------------------------------*/
button {
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #0066cc;
    border: 2px solid #0066cc;
    color: #ffffff;
    margin: 10px 0;
    font-weight: 500;
    transition: 0.2s;
}

button:hover {
    background: #0052a3;
    border-color: #0052a3;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

button:active {
    transform: scale(0.98);
}

/* -----------------------------------------
   VIDEO WRAPPER
------------------------------------------*/
#videoWrapper {
    position: relative;
    width: 640px;
    height: 480px;
    margin: 25px auto;
    background: #000;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#video, #canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mirror webcam */
#video {
    transform: scaleX(-1);
}

/* -----------------------------------------
   RESPONSIVE - GLOBAL STYLES
------------------------------------------*/

/* Common responsive container */
.page-wrap {
    max-width: 700px;
    width: 100%;
    margin: 20px auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Responsive typography */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    body {
        font-size: 0.95rem;
    }
}

/* Responsive containers and cards */
@media (max-width: 768px) {
    #app {
        max-width: 100%;
        margin: 10px auto;
        padding: 10px;
    }
    
    .page-wrap {
        max-width: 100%;
        padding: 15px;
        margin: 10px auto;
    }
    
    #infoPanel {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .info-row {
        flex-direction: column;
        gap: 5px;
        padding: 10px 0;
    }
}

/* Responsive forms */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        width: 100%;
        box-sizing: border-box;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    label {
        display: block;
        margin-bottom: 8px;
    }
    
    form section label {
        margin-bottom: 15px;
    }
}

/* Responsive buttons */
@media (max-width: 768px) {
    button {
        width: 100%;
        padding: 12px 20px;
        font-size: 1rem;
        margin: 8px 0;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group button {
        width: 100%;
    }
}

/* Responsive video/webcam */
@media (max-width: 768px) {
    #videoWrapper {
        width: 100%;
        max-width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
        margin: 15px auto;
    }
}

/* Responsive cards and boxes */
@media (max-width: 768px) {
    section,
    .meal-group,
    form,
    .login-box,
    .description-card {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .info-box {
        padding: 15px;
        margin-bottom: 20px;
    }
}

/* Responsive flex containers */
@media (max-width: 768px) {
    .description-cards {
        gap: 15px;
    }
    
    .description-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    
    .description-card-icon {
        width: 80px;
        height: 80px;
        margin-left: 0;
        margin-top: 15px;
    }
}

/* Responsive tables */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table thead {
        display: none;
    }
    
    table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 10px;
    }
    
    table tbody td {
        display: block;
        text-align: right;
        padding: 8px;
        border: none;
    }
    
    table tbody td:before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        color: #666;
    }
}

/* Responsive modals */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 20px;
        margin: 10px;
    }
    
    .modal-overlay {
        padding: 10px;
    }
}

/* Responsive images */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }
    
    .logo-img {
        max-width: 150px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .page-wrap {
        padding: 10px;
    }
    
    section,
    .meal-group,
    form,
    .login-box {
        padding: 12px;
    }
    
    button {
        padding: 14px 20px;
        font-size: 1rem;
    }
}
