/*css file for base browser configuration*/

/*count padding and borders inside an element's width*/
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
    scrollbar-gutter: stable;
}

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: var(--font-size-base);
	line-height: var(--line-height);
    background: var(--color-bg);
	color: var(--color-text);
}


h1, 
h2 {
	margin: 0 0 var(--space-2);
	line-height: 1.2;
}

h1 {font-size: var(--font-size-title);}

h2 {font-size: var(--font-size-large);}

p {margin: 0 0 var(--space-2);}


h1, h2, h3 {
    font-family: var(--font-heading);
}

button {
    font-family: var(--font-button);
}


img{
	max-width: 100%;
	height: auto;
}



/*makes hidden attribute always win. 
makes help tab and file input stay hidden even 
after layout out rules added*/

[hidden]{display: none !important;}

/*buttons*/
button{
	font: inherit;
	min-height: var(--touch-target);
	min-width: var(--touch-target);
	padding: var(--space-2) var(--space-3);
	color:var(--color-text);
	background:var(--color-surface);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius);
	cursor: pointer;
}

/* spacing between the search and reset buttons */
#search-results button + button {
    margin-left: var(--space-2);
}


button:hover:not(:disabled) {
	border-color: var(--color-accent);
	color: var(--color-accent);
}


button:disabled {
	background: var(--color-disabled-bg);
	color: var(--color-disabled-text);
	cursor: not-allowed;
}

/*visible keyboard accessability*/
:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 2px;
}



/* The dark bar behind the tabs,
colors are defined right here
with a darker set for dark mode. */
  /* The bar across the top: the title on the left, the tabs on the right.
     The colors are defined here, with a darker set for dark mode. */
  #app-header {
      --tabbar-bg: #410f07; /*bg*/
      --tab-bg: #942310; /*buttons*/
      --tab-hover-bg: #EF7F6B;
      --tab-text: #d8d8d8;

      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      align-items: flex-end;      /* the tabs sit on the bottom edge of the bar */
      gap: 4px 24px;
      padding: 10px 20px 0;
      background: var(--tabbar-bg);
  }

  #app-header h1 {
      margin: 0;
      padding-bottom: 6px;
      align-self: center;
      color: var(--tab-text);
      line-height: 1;
  }

  #tabs {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      align-items: flex-end;
      gap: 4px;
  }

@media (prefers-color-scheme: dark) {
    #app-header {
        --tabbar-bg: #0D1B68; /*bg*/
        --tab-bg: #050F47; /*buttons*/
        --tab-hover-bg: #2e2e2e;
    }
}

/* every tab will have rounded on top only and no bottom edge */
#tabs button[role="tab"] {
    font-size: 0.9rem;
    padding: var(--space-1) var(--space-3);
    background: var(--tab-bg);
    color: var(--tab-text);
    border: var(--border-width) solid rgba(255, 255, 255, 0.12);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
}

@media (pointer: fine) {
    #tabs button[role="tab"] {
        min-height: 34px;
    }
}

/* hovering over a tab that isnt selected */
#tabs button[role="tab"]:not([aria-selected="true"]):hover {
    background: var(--tab-hover-bg);
    color: #ffffff;
}

/* selected tab will have same color as the page
so it flows into the content */
#tabs button[role="tab"][aria-selected="true"] {
    background: var(--color-bg);
    color: var(--color-text);
    font-weight: bold;
    border-color: var(--color-bg);
    border-top: 3px solid var(--color-accent);
}


/* Here I am keeping both sections equal without making them too large */
#workspace-columns {
    display: grid;
    grid-template-columns: minmax(0, 600px) minmax(0, 600px);
    justify-content: space-between;
    align-items: start;
    gap: 80px;
    max-width: 1500px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 30px;
    position: relative;
}

/* Here I am keeping both sections inside their columns */
#viewport,
#results-column {
    width: 100%;
    min-width: 0;
}

/* Here I am keeping the mannequin and upload boxes square */
#canvas-mount iframe,
#results-column iframe {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    max-width: none;
    border: none;
}


/* Reset Pose sits in the top-right corner of the mannequin's box */
#canvas-mount {
    position: relative;
}

#reset-pose-button {
    position: absolute;
    bottom: var(--space-2);
    left: var(--space-2);
    z-index: 1;
}


/*adding the same rounded edges as the sketch box*/
#canvas-mount iframe { 
    box-sizing: border-box;
    border: 1px solid var(--color-border);
    border-radius: 10px;
}

/* Here I am keeping OR centered between both sections */
#choice-or {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
    font-weight: bold;
    color: var(--color-text);
}

/* Here I am allowing the whole webpage to scroll for future gallery images */
html,
body {
    min-height: 100%;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Here I am giving the reference gallery room to grow downward */
#search-results {
    width: 100%;
    padding: 30px 40px 60px;
    text-align: center;
}

#results-gallery {
    width: 100%;
    margin-top: 30px;
}

/* Here I am centering each gallery section notice */
.gallery-section-notice {
    grid-column: 1 / -1;
    flex: 0 0 100%;
    width: 100%;
    text-align: center;
    margin: var(--space-2) 0;
}


/* Here I am keeping the layout usable on smaller screens */
@media (max-width: 1150px) {
    #workspace-columns {
        grid-template-columns: minmax(0, 600px);
        justify-content: center;
        gap: 30px;
    }

    #choice-or {
        position: static;
        transform: none;
        text-align: center;
        grid-row: 2;
    }
}


/* INFO PANELS: Help, About, Terms & Legal, Copyright.
   Deleted the older .info-panel rules first so they don't conflict. */

.info-panel {
    max-width: 760px;
    margin-inline: auto;
    padding: var(--space-4) var(--space-3) var(--space-5);
    text-align: left;              /* long text reads better left-aligned */
}

#panel-about {
    max-width: 1000px;
}

.info-panel h2 {
    text-align: center;
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-accent);
}

.info-panel h3 {
    margin: var(--space-4) 0 var(--space-1);
    color: var(--color-accent);
}

.info-panel p {
    line-height: 1.7;
}

.info-panel ul {
    padding-left: var(--space-4);
    line-height: 1.7;
}

.info-panel li {
    margin-bottom: var(--space-2);
}

/* Small centered line under the Terms title */
.effective-date {
    text-align: center;
    color: var(--color-text-muted);
    font-size: var(--font-size-small);
}

/* Highlighted sentence on the Copyright tab */
.callout {
    padding: var(--space-2) var(--space-3);
    background: var(--color-surface);
    border-left: 6px solid var(--color-accent);
    border-radius: var(--radius);
    font-weight: bold;
}


/* About tab: three team member cards side by side */
.team {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.member {
    display: flex;
    flex-direction: column;     /* heading, then photo, then text */
    align-items: center;
    text-align: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--color-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease; /*make the hover slow*/

}

.member h3 {
    margin: 0;
}

.member img {
    flex: none;
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius);; /*rounded square image*/
}

.member p {
    margin: 0;
}

/* Stack the cards on narrow screens so they don't get cramped */
@media (max-width: 700px) {
    .team {
        grid-template-columns: 1fr;
    }
}


/* The card lifts up slightly when the cursor is over it */
.member:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--color-text) 25%, transparent);
}

/* Respect people who turned off animations in their system settings */
@media (prefers-reduced-motion: reduce) {
    .member {
        transition: none;
    }
    .member:hover {
        transform: none;
    }
}

/* BEGINNING OF REFERENCE IMAGE GALLERY */
#gallery-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;   /* centres every row, including a shorter last row */
    align-items: flex-start;
    gap: var(--space-3);
}

/* the "no results" message and the accuracy warnings take a full row */
#gallery-grid > p {
    flex: 0 0 100%;
    text-align: center;
}

.gallery-item {
    margin: 0;
    width: 190px;
}

.gallery-thumb {
    display: block;
    width: 100%;
    padding: 0;
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    overflow: hidden;
    cursor: pointer;
}

.gallery-thumb:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

.gallery-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}


#image-viewer img {
    max-width: 90vw;
    max-height: 80vh;
}
/* END OF REFERENCE IMAGE GALLERY */

/* CURSORS: light mode first, then dark mode.
   The two numbers after each filename are the "hot spot", the exact pixel that
   does the clicking (the tip of the arrow or the fingertip). */
html {
    cursor: url("../assets/cursors/arrow-light.png") 10 7, auto;
}

a,
button:not(:disabled),
[role="tab"],
.gallery-thumb,
label,
select,
input[type="file"] {
    cursor: url("../assets/cursors/arrow-click-light.png") 16 3, pointer;
}

button:disabled {
    cursor: url("../assets/cursors/arrow-light.png") 10 7, not-allowed;
}

@media (prefers-color-scheme: dark) {
    html {
        cursor: url("../assets/cursors/arrow-dark.png") 10 7, auto;
    }

    a,
    button:not(:disabled),
    [role="tab"],
    .gallery-thumb,
    label,
    select,
    input[type="file"] {
        cursor: url("../assets/cursors/arrow-click-dark.png") 16 3, pointer;
    }

    button:disabled {
        cursor: url("../assets/cursors/arrow-dark.png") 10 7, not-allowed;
    }
}


/* No WebGL: the 3D mannequin is hidden and the sketch upload stands alone */
.no-webgl #viewport,
.no-webgl #choice-or {
    display: none;
}

.no-webgl #workspace-columns {
    grid-template-columns: minmax(0, 600px);
    justify-content: center;
}

#webgl-notice {
    text-align: center;
    max-width: 700px;
    margin: var(--space-2) auto;
}