/* File: style.css */
/* Apple-inspired design: Modern, clean, with rounded icons, shadows, and smooth animations. */
/* Updated header for left/right alignment, smaller right text. */
/* Updated hover: Only highlight the icon image, not the whole container. Removed box-shadow on hover for container; kept on image. Applied scale only to image. */
/* Added clear separation: Header with bottom border/shadow, Main as flex-grow, Footer sticky at bottom with light background. */
/* Body as flex column with min-height 100vh for sticky footer. */
/* Removed modal styles since login is now inline in header. */
/* Added styles for inline login form: Flex row, smaller inputs, integrated error. */
/* Updated header: Full width strip like footer, no border-radius, no max-width/margin auto, increased vertical padding for thickness. */
/* Adjusted login form: Reduced input widths to prevent overflow and move elements left. Reduced grid gap for smaller vertical spacing, reduced max-width for tighter grid. */
/* Increased padding-right on header to push login/logout left by adding space on right. Increased gap in login-form for more space between fields. */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f2f2f7;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px 20px 20px; /* Increased right padding to push content left */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
}

.header-left {
    text-align: left;
}

h1 {
    font-size: 2.5em;
    color: #000;
    margin: 0;
}

.subtitle {
    font-size: 0.8em;
    color: #666;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-greeting {
    font-size: 0.8em;
    color: #666;
    margin: 0;
}

.logout, .login-btn {
    background-color: #007aff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.logout:hover, .login-btn:hover {
    background-color: #0056b3;
}

main.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px; /* Reduced gap for smaller vertical spacing */
    max-width: 600px; /* Reduced max-width for tighter grid */
    width: 100%;
    padding: 20px;
    margin: 0 auto;
    flex-grow: 1;
}

.app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #000;
    transition: transform 0.2s ease; /* Removed box-shadow transition here */
}

.app-icon img {
    width: 120px;
    height: 120px;
    border-radius: 26px; /* Apple icon radius */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Added shadow transition to image */
}

.app-icon span {
    margin-top: 8px;
    font-size: 0.9em;
    text-align: center;
}

.app-icon:hover img {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

footer {
    width: 100%;
    background-color: #ffffff;
    text-align: center;
    padding: 10px 0;
    font-size: 0.8em;
    color: #666;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
    margin-top: auto;
}

.login-form {
    display: flex;
    align-items: center;
    gap: 15px; /* Increased gap for more space between fields */
}

.login-form input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9em;
    transition: border-color 0.3s ease;
    width: 100px; /* Reduced width to prevent overflow and move elements left */
}

.login-form input:focus {
    border-color: #007aff;
    outline: none;
}

.header-right .error {
    color: red;
    font-size: 0.8em;
    margin: 0 0 0 10px; /* Inline error */
    white-space: nowrap;
}