/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}

/* ### */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-family: "Roboto", sans-serif;
}

body {
    background: rgb(250, 250, 250);
    padding: 1.5rem 1rem;
}

main {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

h1 {
    font-size: 1.75em;
    font-weight: 500;
    margin: 0 0 1rem 0;
    text-align: center;
    color: #1a1a1a;
}

h2 {
    font-size: 1.5em;
    text-align: center;
    margin: 0 0 1rem 0;
}

sub {
    display: block;
    font-size: 0.7em;
    color: #888;
    line-height: 1.4;
    text-align: center;
    order: 10;
}

section {
    border: 1px solid #e0e0e0;
    border-radius: 0.4em;
    padding: 0.75em;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

section > div {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

section > div input {
    flex-grow: 1;
    min-width: 0;
}

section img {
    height: 1rem;
    cursor: pointer;
    flex-shrink: 0;
}

.free-rooms-button {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    padding: 0.85em 1em;
    border-radius: 0.5em;
    border: none;
    font-size: 0.875em;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.free-rooms-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.free-rooms-button:active {
    transform: translateY(0);
}

section ul.rooms {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: 100%;
    margin: 0;
    padding: 0.75rem 0 0 0;
    border-top: 1px solid #e0e0e0;
}

section ul.rooms li {
    padding: 0.7em 1em;
    font-size: 0.9em;
}

input {
    border: none;
    flex-grow: 1;
    font-size: 0.9em;
    font-weight: 400;
    color: #333;
    background: rgb(250, 250, 250)
}

input:focus {
    outline: none;
    border-color: #666;
}

ul {
    list-style: none;
}

/* Main buildings - bordered cards */
ul.main > li {
    padding: 1rem;
    margin-bottom: 0.7rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 400;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background: white;
    transition: border-color 0.15s ease;
}

ul.main > li:hover {
    border-color: #c0c0c0;
}

ul.main > li span {
    flex-grow: 1;
}

ul.main > li > img {
    height: 0.9rem;
    transform: rotateZ(90deg);
    transition: transform 0.1s linear;
    transform-origin: 50% 47%;
}

ul.main > li:has(ul.open) > img {
    transform: rotateZ(270deg);
    transition: transform 0.1s linear;
}

/* Levels - subtle background */
ul.levels {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
}

ul.levels.open {
    display: flex;
    margin-top: 1em;
}

ul.levels > li {
    padding: 0.85rem 1rem;
    border-radius: 0.4rem;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 400;
    border: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

ul.levels > li > img {
    align-self: flex-end;
    height: 1rem;
    transition: transform 0.1s linear;
}

ul.levels > li:has(ul.open) > img {
    transform: rotateZ(180deg);
    transition: transform 0.1s linear;
}

ul.levels > li:hover {
    background: #fafafa;
}

/* Rooms - minimal, clean list */
ul.rooms {
    display: none;
    width: 100%;
}

ul.rooms.open {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.85em;
}

ul.rooms > li {
    padding: 0.7rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 400;
    color: #2c2c2c;
    border-left: 1px solid #f0f0f0;
    border-radius: 0.25em;
}

ul.rooms > li:hover {
    background: #f8f8f8;
    border-left-color: #4a90e2;
    border-left-width: 2px;
}

/* Free Rooms Overlay */
.free-rooms-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1em;
    z-index: 1000;
}

.free-rooms-content {
    background: white;
    border-radius: 0.5em;
    padding: 1.5em;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.free-rooms-overlay h2 {
    font-size: 1.25em;
    font-weight: 500;
    margin-bottom: 1rem;
}

.current-hour {
    font-size: 0.9375em;
    color: #333;
    margin-bottom: 0.5em;
}

.current-hour strong {
    font-weight: 600;
    color: #4a90e2;
    font-size: 1.2em;
}

.free-rooms-overlay .explanation {
    font-size: 0.75em;
    color: #888;
    margin-bottom: 1.5em;
}

.close-icon {
    position: absolute;
    top: 1.5em;
    right: 1.5em;
    height: 1.2em;
    cursor: pointer;
    opacity: 0.6;
}

.close-icon:hover {
    opacity: 1;
}

.free-buildings > li {
    margin-bottom: 1.5em;
}

.free-buildings > li:last-child {
    margin-bottom: 0;
}

.building-name {
    font-size: 0.9375em;
    font-weight: 500;
    margin-bottom: 0.75em;
    color: #1a1a1a;
}

.free-levels > li {
    margin-bottom: 1em;
}

.free-levels > li:last-child {
    margin-bottom: 0;
}

.level-name {
    font-size: 0.8125em;
    font-weight: 400;
    color: #666;
    margin-bottom: 0.5em;
    padding-left: 0.5em;
}

.free-rooms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    padding-left: 0.5em;
}

.room-item {
    background: #f8f8f8;
    padding: 0.5em 0.75em;
    border-radius: 0.3em;
    font-size: 0.8125em;
    display: flex;
    align-items: center;
    gap: 0.5em;
    cursor: pointer;
    border-left: 2px solid transparent;
}

.room-item:hover {
    background: #f0f0f0;
    border-left-color: #4a90e2;
}

.room-code {
    font-weight: 400;
    color: #1a1a1a;
}

.room-hours {
    font-size: 0.875em;
    color: #4a90e2;
    font-weight: 500;
}
/* Room Viewer Overlay */
.room-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 2000;
    overflow-y: auto;
    padding: 2em;
}

.room-viewer h2 {
    font-size: 2em;
    font-weight: 500;
    margin-bottom: 0.25em;
    text-align: center;
    color: #2E5AAB;
}

.room-viewer .close-icon {
    position: fixed;
    top: 2em;
    right: 2em;
    height: 1.5em;
    cursor: pointer;
    opacity: 0.6;
}

.room-viewer .close-icon:hover {
    opacity: 1;
}

.room-viewer > p {
    text-align: center;
    font-size: 0.9375em;
    color: #666;
    margin-bottom: 2em;
}

.room-viewer > ul {
    max-width: 500px;
    margin: 0 auto;
}

.schedule-row {
    display: flex;
    align-items: center;
    padding: 1em 1.25em;
    border-bottom: 1px solid #f0f0f0;
    gap: 1.5em;
}

.schedule-row:last-of-type {
    border-bottom: none;
}

.schedule-row:hover {
    background: #fafafa;
}

.schedule-row .hour {
    font-size: 0.9375em;
    font-weight: 500;
    color: #1a1a1a;
    min-width: 2.5em;
}

.schedule-row .class {
    font-size: 0.875em;
    color: #666;
    min-width: 4em;
}

.schedule-row .subject {
    font-size: 0.9375em;
    color: #1a1a1a;
    flex-grow: 1;
}

.schedule-row .teacher {
    font-size: 0.875em;
    color: #666;
    text-align: right;
}
