/* Importing Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@700&family=Ubuntu&display=swap');

/* General Styles */
body {
    font-family: 'Ubuntu', sans-serif;
    margin: 0px;
    padding: 0px;
    
}

/* Header Styles */
header {
    width: 100%;
    background-color: #001871;
    color: white;
    padding: 10px 0;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    height: 75px;
    box-shadow: 0 6px 10px rgba(0,0,0,0.50); /* soft drop shadow */
}

header h1 {
    margin: 0;
    font-size: 42px;
    text-transform: uppercase;
}

header div {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

header img:first-child {
    position: absolute;
    left: 0;
    margin: 12px;
}

header img:last-child {
    position: absolute;
    right: 0;
    margin: 12px;
}

h1, h2{
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    
}
h3, h4, h5, h6 {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
}

/* Main Body Styles */
main {
    padding-left: 16px;
    padding-right: 16px;
    padding-top: 16px;
    display: flex;
    align-items: center;
    flex-direction: column;
    height: 100vh; /* Ensure it takes full viewport height */
    box-sizing: border-box; /* Include padding in height calculation */
}


/* Form layout helpers for the combined form */
#mainForm {
    max-width: 300px; /* match the visual width of the original single input */
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Style for primary input (full width of the form) */
#capIdInput {
    height: 50px;
    width: 100%;
    padding: 12px;
    font-size: 18px;
    border: 1px solid #ccc;
    border-radius: 12px;
    box-sizing: border-box; /* Ensure padding doesn't affect height */
}

/* Year input shares the row with the button and should grow to fill remaining space */
#yearJoinedInput {
    height: 50px;
    flex: 1 1 auto;
    min-width: 80px;
    padding: 12px;
    font-size: 18px;
    border: 1px solid #ccc;
    border-radius: 12px;
    box-sizing: border-box;
}

/* On very small screens allow the year input to scale to available space */
@media (max-width: 420px) {
    #yearJoinedInput {
        width: calc(100% - 60px); /* leave room for button; button is 50px + small gap */
    }
}

/* Style for the submit button */
#submitButton {
    height: 50px; /* Match the height of the input field */
    width: 50px; /* Make it a square button */
    background-color: #001871; 
    color: white;
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* allow absolute-positioned spinner to center */
    cursor: pointer;
}

#submitButton:hover {
    background-color: #003399; /* Slightly lighter shade on hover */
}

/* Style for response message */
#responseMessage {
    border-radius: 8px;
    padding: 10px; 
    margin-top: 12px;
    font-size: 18px;
}


#errorMessage {
    display: none;  /* Hidden by default */
    color: #c62828;
    background-color: #ffcccb;
    padding: 12px;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    margin: 12px;
}


#successMessage {
    display: none;  /* Hidden by default */
    color: #2e7d32;
    background-color: #c8e6c9;
    padding: 12px;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    margin: 12px;
}

/* Ensure proper scaling on mobile devices */
@media (max-width: 599px) {
    main {
    padding-top: 0px;
}

    header h1 {
        font-size: 28px;
        line-height: 1.0;
        margin-top: 6px;
        margin-bottom: 6px;
    }

    header img {
        margin: 8px 0;
        width: auto;
        max-height: 60%;
        max-width: 60%;
    }

}



@media (min-width: 600px) and (max-width: 910px) {
    main {
    padding-top: 0px;
}

    header h1 {
        font-size: 40px;
        line-height: 1.0;
        margin-top: 6px;
        margin-bottom: 6px;
    }
}


/* Ensure images scale properly */
img {
    max-width: 100%;
    height: auto;
}

/* Make the document fill the viewport */
html, body {
  height: 100%;
  margin: 0;
}

/* Make the page a column flex container */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* fallback for most browsers */
}

/* Let main expand to fill available space */
main {
  flex: 1 0 auto; /* allow growth; prevents footer overlap */
}



/* Footer: allow wrapping, avoid forcing wider-than-viewport layout */
footer {
  text-align: center;
  padding: 10px;
  background-color: #dcdcdc;
  margin: 0;               /* ensure no additional horizontal offset */
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;  /* break long words / emails */
  box-sizing: border-box;
}


/* Base */
html, body {
  height: 100%;
  margin: 0;
}

/* Page column layout */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header stays natural size */
header {
  flex: 0 0 auto;
}

/* Main fills remaining space but can scroll internally if its content is tall */
main {
  flex: 1 1 auto;
  overflow: auto;            /* internal scrolling only when needed */
  box-sizing: border-box;    /* ensure padding doesn't add extra height */
}

/* Announcement banner above header */
#announcement {
    background-color: #fff4c2; 
    color: #222;
    padding: 8px 16px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.55);
    position: relative;
    z-index: 10;
}
@media (max-width: 480px) {
#announcement { 
    font-size: 0.9rem; 
}
}


/* spinner and button loading styles */
button#submitButton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
button#submitButton[disabled] { opacity: .9; cursor: not-allowed; }

.spinner {
    display: none;
    width: 26px; 
    height: 26px;
    border: 3px solid rgba(0,0,0,0.00); /* sets spinner background (non-spinny part) */
    border-top-color: rgba(255, 255, 255, 0.9);  /* sets the color of the spinny part1 */
    border-radius: 50%;
    box-sizing: border-box;
    transform: translate(-50%, -50%) rotate(0deg);
    animation: spin 0.9s linear infinite;
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    pointer-events: none;
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* while loading hide the arrow image and show spinner */
button#submitButton.loading img { visibility: hidden; }
button#submitButton.loading .spinner { display: block; }