/* --- Base --- */
* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, sans-serif; background: #f4f4f5; margin: 0; padding: 0; }

/* --- Header --- */
header { background: white; padding: 12px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 20px; }
.header-content { display: flex; align-items: center; justify-content: space-between; max-width: 960px; margin: 0 auto; flex-wrap: wrap; gap: 10px; }
.header-content h1 { font-size: 1.25rem; margin: 0; color: #1a1a1a; }
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.user-name { font-size: 0.875rem; color: #555; }
.logout-btn { font-size: 0.8rem; color: #dc3545; text-decoration: none; padding: 5px 12px; border: 1px solid #dc3545; border-radius: 6px; transition: background 0.2s, color 0.2s; }
.logout-btn:hover { background: #dc3545; color: white; }

/* --- Main Content --- */
main { max-width: 960px; margin: 0 auto; padding: 0 20px 40px; }

/* --- Flash Messages --- */
.flash-messages { background: #fff3cd; border: 1px solid #ffc107; border-radius: 8px; padding: 10px 16px; margin-bottom: 16px; }
.flash-msg { margin: 4px 0; color: #856404; font-size: 0.9rem; }

/* --- Cards Grid --- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; margin-top: 20px; }
.card { background: white; padding: 10px; border-radius: 12px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); text-align: center; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.card:hover, .card:focus-visible { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); outline: none; }
.card img { max-width: 100%; height: 100px; object-fit: cover; border-radius: 8px; }
.card h3 { margin: 8px 0 0; font-size: 0.9rem; color: #333; }

/* --- Forms --- */
form { background: white; padding: 20px; border-radius: 12px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
label { display: block; font-size: 0.85rem; font-weight: 600; color: #444; margin-top: 10px; margin-bottom: 4px; }
input, button { padding: 10px; margin: 5px 0; width: 100%; box-sizing: border-box; }
input[type="text"], input[type="file"] { border: 1px solid #ddd; border-radius: 6px; font-size: 0.95rem; }
input[type="text"]:focus { outline: none; border-color: #007bff; box-shadow: 0 0 0 3px rgba(0,123,255,0.15); }
button { background: #007bff; color: white; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 0.95rem; transition: background 0.2s; }
button:hover { background: #0056b3; }
button:disabled { background: #aaa; cursor: not-allowed; }
h2 { color: #1a1a1a; font-size: 1.1rem; margin-bottom: 4px; }

/* --- Fullscreen Overlay --- */
#fullscreen-overlay { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: white; z-index: 1000; justify-content: center; align-items: center; flex-direction: column; }
#fullscreen-overlay img { max-width: 95vw; max-height: 80vh; object-fit: contain; }
.close-btn { position: absolute; top: 20px; right: 20px; padding: 10px 20px; background: #dc3545; color: white; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; width: auto; }
.close-btn:hover { background: #b02a37; }

/* --- Login Page --- */
.login-page { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-container { width: 100%; max-width: 420px; }
.login-card { background: white; border-radius: 16px; padding: 40px 32px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); text-align: center; }
.login-icon { margin-bottom: 16px; }
.login-header h1 { font-size: 1.5rem; color: #1a1a1a; margin: 0 0 8px; }
.login-subtitle { color: #666; font-size: 0.95rem; margin: 0 0 28px; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 12px 20px; border: 1px solid #ddd; border-radius: 8px; background: white; font-size: 1rem; font-weight: 500; color: #333; text-decoration: none; cursor: pointer; transition: background 0.2s, box-shadow 0.2s; }
.google-btn:hover { background: #f8f9fa; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.login-footer { font-size: 0.8rem; color: #999; margin: 24px 0 0; }

/* --- Screen reader only --- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* --- Responsive --- */
@media (max-width: 480px) {
    .login-card { padding: 28px 20px; }
    .header-content { flex-direction: column; align-items: flex-start; }
    .user-menu { width: 100%; justify-content: flex-end; }
}
