/* Clean and Minimal CSS for Interactive Timetable */

:root {
    --primary-color: #1e1e1e;
    /* 60% of the page color */
    --secondary-color: #0e0e0e;
    /* 30% of the page color */
    --background-color: #E1E5E6;
    /* 10% additional color */
    --text-color: #191919;
    --border-color: #d1d8e0;
    --hover-color: #ff6b6b;
}

html {
    scrollbar-width: thin;
    /* Options: auto, thin, none */
    scrollbar-color: #1e1e1e #e8e5e1;
    /* thumb color | track color */
}

body {
    font-family: "Roboto Mono", monospace;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    background-color: #e8e5e1;
    background-image:
        radial-gradient(circle, #d0d0d0 1px, transparent 2px);
    background-size: 25px 25px;
    background-position: 0 0;
    color: var(--text-color);
    margin: 0;
    margin-top: 10px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    text-align: center;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 2em;
    text-align: center;
    font-weight: 600;
}

.input-group {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    gap: 1px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-bottom: 15px;
    margin-top: 70px;
    margin-left: 10px;
}

.generate-btn {
    background-color: #1e1e1e;
    --hover-bg: #e9d44e;
    --hover-text: #000;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 40px;
    margin-left: 5px;
    cursor: pointer;
    font-family: "roboto mono", monospace;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 1.1em;
    outline: none;
    transition: 0.2s all ease-in-out;
}

.generate-btn:hover {
    color: var(--hover-text);
    transform: translate(-0.25rem, -0.25rem);
    background: var(--hover-bg);
    box-shadow: 0.25rem 0.25rem var(--primary-color);
}

.generate-btn:active {
    transform: translate(0);
    box-shadow: none;
}

.quantity-form {
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.quantity-label {
    display: block;
    margin-bottom: 5px;
    font-family: "roboto mono", monospace;
    font-size: 1.1rem;
    font-weight: 500;
    color: #1e1e1e;
    /* Adjusted for your dark theme */
}

.i-font {
    font-family: 'roboto mono', monospace;
    font-weight: 500;
    padding-bottom: -20px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    width: 128px;
    /* Equivalent to 8rem */
}

.btn {
    background-color: #1e1e1e;
    /* gray-700 */
    color: white;
    padding: 12px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.btn:hover {
    background-color: #333333;
    /* Slightly lighter gray on hover */
}

.btn-left {
    border-radius: 8px 0 0 8px;
}

.btn-right {
    border-radius: 0 8px 8px 0;
}

.quantity-input {
    width: 60px;
    height: 20px;
    background-color: #1e1e1e;
    color: white;
    text-align: center;
    outline: none;
    padding: 6px;
    border-radius: 4px;
    font-size: 1.25em;
    border: 1px solid #e8e5e1;
}

/* Removes arrows from number input */
.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--primary-color);
    box-shadow: rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px;
    color: white;
    border-radius: 8px;
    margin-bottom: 15px;
}

.top-bar a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.top-bar a:hover {
    text-decoration: underline;
}

.top-bar #top-link {
    font-size: 1.2rem;
}

/* Form Styles */

.form-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.input-group label {
    margin-right: 8px;
    font-size: 1.25em;
    white-space: nowrap;
}

/*input[type="number"],
input[type="text"] {
    padding: 6px;
    border-radius: 4px;
    font-size: 1.25em;
    border: 1px solid #e8e5e1;
}
*/
button {
    cursor: pointer;
    font-optical-sizing: auto;
}

.color-control {
    display: flex;
    margin-bottom: -20px;
    margin-left: 10px;
}

.color-picker {
    display: flex;
    flex-wrap: wrap;
    margin-left: 9px;
    margin-right: 9px;
    justify-content: center;
    margin-bottom: 15px;
    margin-top: 16px;
}

.color-container {
    display: block;
    justify-content: space-around;
    margin-left: 10px;
    margin-top: 2px;
    width: fit-content;
    height: fit-content;
    background-color: #94949433;
    border-radius: 200px;
    /*filter: blur(3px);*/
}

.color-option {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    margin-left: 5px;
    margin-right: 5px;
    margin-top: 5px;
    margin-bottom: 5px;
    border: 1px solid #1e1e1e48;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected-picker {
    transform: scale(1.2);
    box-shadow: 0 0 0 3px #1e1e1e48, 0 0 10px #1e1e1e48;
    border-color: white;
}

.color-option.used-color {
    opacity: 0.4;
    cursor: not-allowed;
    position: relative;
}

.color-option.used-color::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(0, 0, 0, 0.7);
    font-size: 14px;
    font-weight: bold;
}

.color-option.used-color:hover {
    transform: scale(1);
}

/* Table Styles */

.top-left {
    background-color: #3c8dbc;
    border: 1px solid #143344;
    position: relative;
    overflow: hidden;
}

.top-left:hover {
    background-color: #6fafd3;
}

.pika {
    position: absolute;
    top: -110%;
    left: 46%;
    transition: 0.5s all;
    animation: tilt 1.1s infinite ease-in-out;
}

@keyframes tilt {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    50% {
        transform: translate(-50%, -50%) rotate(10deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
}

.top-left:hover .pika {
    top: 70%;
}

table {
    margin-top: 50px;
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    font-size: 1.3em;
}

th,
td {
    border: 1px solid var(--border-color);
    padding: 6px;
    text-align: center;
}

th {
    background-color: #3c8dbc;
    border: 1px solid #143344;
    color: white;
}

td {
    background-color: white;
    border: 1px solid #3c8dbc;
    transition: transform 0.3s ease;
}

td:hover {
    cursor: pointer;
    transform: scale(1);
    box-shadow: inset 0 0 4px #1e1e1e;
}

.input1,
.input2,
.input3 {
    width: 170px;
    height: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1.5px solid lightgrey;
    outline: none;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0px 0px 20px -18px;
}

.input1:hover,
.input2:hover,
.input3:hover {
    box-shadow: 0px 0px 20px -17px;
}

.input1:active,
.input2:active,
.input3:active {
    transform: scale(0.95);
}

.input1:focus,
.input2:focus,
.input3:focus {
    border: 1px solid grey;
}

#subjectForm {
    margin-left: 10px;
}

.add-btn {
    background-color: #1e1e1e;
    --hover-bg: #6be36f;
    --hover-text: #000;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 40px;
    cursor: pointer;
    font-family: "roboto mono", monospace;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 1.1em;
    outline: none;
    transition: 0.2s all ease-in-out;
    margin-left: 1px;
}

.add-btn:hover {
    color: #000;
    background: #e9d44e;
    transform: translate(-0.25rem, -0.25rem);
    box-shadow: 0.25rem 0.25rem var(--primary-color);
}

.add-btn:active {
    transform: translate(0);
    box-shadow: none;
}

/* Subject Table Styles */

.final-download {
    display: flex;
    align-items: center;
}

.container-download {
    margin: 1.5rem 0;
    max-width: fit-content;
}

.tabs {
    display: flex;
    position: relative;
    background-color: #fbfbfb;
    padding: 0.15rem;
    border-radius: 99px;
    border: 1.5px solid lightgrey;
    outline: none;
}

.tabs * {
    z-index: 2;
}

.container-download input[type="radio"] {
    display: none;
}

.tab {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    width: 50px;
    font-size: 0.8rem;
    color: black;
    font-family: "roboto mono", monospace;
    font-weight: 600;
    border-radius: 99px;
    cursor: pointer;
    transition: color 0.15s ease-in;
}

.container-download input[type="radio"]:checked+label {
    color: #fbfbfb;
}

.container-download input[id="radio-1"]:checked~.glider {
    transform: translateX(0);
}

.container-download input[id="radio-2"]:checked~.glider {
    transform: translateX(100%);
}

.container-download input[id="radio-3"]:checked~.glider {
    transform: translateX(200%);
}

.glider {
    position: absolute;
    display: flex;
    height: 30px;
    width: 50px;
    background-color: #1e1e1e;
    z-index: 1;
    border-radius: 99px;
    transition: 0.25s ease-out;
}

@media (max-width: 700px) {
    .tabs {
        transform: scale(0.6);
    }
}

#downloadBtn {
    background-color: #1e1e1e;
    --hover-bg: #6be36f;
    --hover-text: #000;
    color: white;
    border: none;
    height: 40px;
    padding: 8px 12px;
    border-radius: 40px;
    margin-left: 11px;
    cursor: pointer;
    font-family: "roboto mono", monospace;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 1.1em;
    outline: none;
    transition: 0.2s all ease-in-out;
}

#downloadBtn:hover {
    color: #000;
    background: #e9d44e;
    transform: translate(-0.25rem, -0.25rem);
    box-shadow: 0.25rem 0.25rem var(--primary-color);
}

#downloadBtn:active {
    transform: translate(0);
    box-shadow: none;
}

#subjectTable {
    display: none;
    /* Initially hidden */
}

#subjectTable th {
    background-color: #3c8dbc;
}

.file-name-group {
    margin: 16px 0;
    margin-top: 30px;
    margin-left: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    display: none;
    /* Initially hidden */
}

#fileNameInput {
    width: fit-content;
    height: 22px;
    border-radius: 8px;
    border: 1.5px solid lightgrey;
    outline: none;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0px 0px 20px -18px;
}

#fileNameInput:hover {
    box-shadow: 0px 0px 20px -17px;
}

#fileNameInput:active {
    transform: scale(0.95);
}

#fileNameInput:focus {
    border: 1px solid grey;
}

#subjectForm1 {
    display: flex;
    gap: 12px;
}

.final-download {
    display: flex;
    margin-top: 12.5px;
    align-items: center;
    display: none;
    margin-left: auto;
    margin-right: 10px;
    /* Initially hidden */
}

.delete-btn {
    background-color: #f7313161;
    border: none;
    padding: 4px 6px;
    border-radius: 10px;
    width: 50px;
    cursor: pointer;
    font-family: "roboto mono", monospace;
    font-size: 0.75em;
}

.delete-btn:hover {
    transition: 0.5s all;
    animation: tilt1 1.1s infinite ease-in-out;
}

/* Footer Styles */

footer {
    margin-top: 80px;
    display: block;
    justify-content: flex-start;
    align-items: center;
    padding: 1px;
    background-color: #1e1e1e;
    color: white;
    font-size: 1em;
    max-width: 1525px;
    padding-top: -20px;
    overflow: hidden;
}

/* Footer GIF Animation */

footer img {
    bottom: -6px;
    left: 2%;
    position: relative;
    -webkit-animation: myfirst 22s linear infinite;
    animation: myfirst 22s linear infinite;
}

@-moz-keyframes myfirst {
    0% {
        left: -50%;
    }

    100% {
        left: 100%;
    }
}

@-webkit-keyframes myfirst {
    0% {
        left: -50%;
    }

    100% {
        left: 100%;
    }
}

@keyframes myfirst {
    0% {
        left: -50%;
    }

    100% {
        left: 100%;
    }
}

/* Responsive Design */

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.4em;
    }

    .quantity-input {
        margin-top: auto;
        width: 60px;
        height: 20px;
    }

    table {
        font-size: 0.75em;
    }

    th,
    td {
        padding: 5px;
    }

    p {
        font-size: 0.75em;
    }

    input[type="number"],
    input[type="text"] {
        font-size: 0.75em;
    }

    img {
        width: 100px;
    }

    button {
        font-size: 0.5em;
        margin-top: 10px;
    }

    a {
        font-size: 0.75em;
    }

    footer a {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.2em;
    }

    .top-bar #top-link {
        font-size: 0.75rem;
        margin-right: 10px;
    }

    .generate-btn {
        font-size: 0.9em;
        padding: 6px 10px;
        margin-right: 10px;
    }

    table {
        font-size: 0.7em;
    }

    th,
    td {
        padding: 4px;
    }

    .input-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .input-group label {
        margin-bottom: 5px;
    }

    p {
        font-size: 0.75em;
    }

    input[type="number"],
    input[type="text"] {
        font-size: 0.75em;
    }

    img {
        width: 100px;
    }

    .tabs {
        transform: scale(1);
    }

    #downloadBtn {
        font-size: 0.9em;
        padding: 2px 10px;
    }

    button {
        font-size: 0.75em;
        margin-top: 10px;
    }

    footer {
        visibility: hidden;
    }

    .modal {
        max-height: 90vh;
        max-width: 90vw;
    }
}

@media (max-width: 425px) {
    h1 {
        font-size: 1em;
    }

    .top-bar #top-link {
        font-size: 0.75rem;
        margin-right: 10px;
    }

    .generate-btn {
        font-size: 0.5em;
        padding: 6px 10px;
        margin-right: 10px;
    }

    table {
        font-size: 0.7em;
    }

    th,
    td {
        padding: 4px;
    }

    .input-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .input-group label {
        margin-bottom: 5px;
    }

    p {
        font-size: 0.75em;
    }

    input[type="number"],
    input[type="text"] {
        font-size: 0.75em;
    }

    img {
        width: 100px;
    }

    .tabs {
        transform: scale(1);
    }

    #downloadBtn {
        font-size: 0.9em;
        padding: 2px 10px;
    }

    button {
        font-size: 0.75em;
        margin-top: 10px;
    }

    footer {
        visibility: hidden;
    }

    .modal {
        max-height: 90vh;
        max-width: 90vw;
    }
}

/* Subtle animation for table cells */

@keyframes cellHighlight {
    0% {
        background-color: var(--primary-color);
        opacity: 0.1;
    }

    100% {
        background-color: transparent;
    }
}

.highlight {
    animation: cellHighlight 0.3s ease-out;
}

/* Slot Info Styles */
.slot-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 2px;
    line-height: 1.2;
}

.slot-info .slot-id {
    font-weight: bold;
    font-size: 0.9em;
}

.slot-info .subject-name {
    font-size: 0.7em;
    font-weight: 500;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slot-info .venue-info {
    font-size: 0.65em;
    font-style: italic;
    color: #333;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slot-info .faculty-name {
    font-size: 0.6em;
    color: #555;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Action Cell Styles */
.action-cell {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.edit-btn {
    background-color: #e9d44e6d;
    border: none;
    padding: 4px 6px;
    border-radius: 10px;
    width: 50px;
    cursor: pointer;
    font-family: "roboto mono", monospace;
    font-size: 0.75em;
}

.edit-btn:hover {
    transition: 0.5s all;
    animation: tilt1 1.1s infinite ease-in-out;
}

@keyframes tilt1 {
    0% {
        transform: translate(0%, 0%) rotate(0deg);
    }

    50% {
        transform: translate(0%, 0%) rotate(8deg);
    }

    100% {
        transform: translate(0%, 0%) rotate(0deg);
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.modal-field {
    margin-bottom: 15px;
}

.modal-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-color);
}

.modal-field input {
    width: 100%;
    height: 40px;
    padding: 12px;
    border-radius: 12px;
    border: 1.5px solid lightgrey;
    outline: none;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0px 0px 20px -18px;
    box-sizing: border-box;
}

.modal-field input:focus {
    outline: none;
    border: 1px solid grey;
}

.modal-field input:active {
    transform: scale(0.95);
}

.slot-hint {
    font-size: 0.85em;
    color: #77777798;
    margin-top: 5px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.save-btn {
    background-color: #1cad5658;
    color: #1cad56;
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
    font-family: "roboto mono", monospace;
}

.save-btn:hover {
    background-color: #219a516c;
}

.cancel-btn {
    background-color: #6a757656;
    color: #6a7576;
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
    font-family: "roboto mono", monospace;
}

.cancel-btn:hover {
    background-color: #7f8c8d8b;
}

/* Edit Slots Grid */
.edit-slots-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.edit-slot-btn {
    padding: 8px 4px;
    text-align: center;
    font-size: 0.75em;
    font-weight: 600;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.edit-slot-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.edit-slot-btn.selected {
    border-color: #6a7576;
    color: #333;
    font-weight: bold;
}

.edit-slot-btn.occupied {
    cursor: not-allowed;
    opacity: 0.7;
    border-style: dashed;
}

.edit-slot-btn.occupied:hover {
    transform: none;
    box-shadow: none;
}

.selected-slots-display {
    margin-top: 10px;
    padding: 8px 12px;
    background: #e8f4fc;
    border-radius: 5px;
    font-size: 0.9em;
    color: var(--primary-color);
}

.selected-slots-display span {
    font-weight: 600;
}

@media (max-width: 768px) {
    .slot-info .subject-name {
        font-size: 0.55em;
    }

    .slot-info .venue-info {
        font-size: 0.5em;
    }

    .slot-info .faculty-name {
        font-size: 0.5em;
    }

    .modal-content {
        padding: 15px;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .edit-slots-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 480px) {
    .slot-info .slot-id {
        font-size: 0.8em;
    }

    .slot-info .subject-name {
        font-size: 0.5em;
    }

    .slot-info .venue-info {
        font-size: 0.45em;
    }

    .slot-info .faculty-name {
        font-size: 0.45em;
    }

    .action-cell {
        flex-direction: column;
    }

    .edit-btn,
    .delete-btn {
        font-size: 0.8em;
        padding: 3px 5px;
    }

    .edit-slots-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 3px;
    }

    .edit-slot-btn {
        padding: 6px 2px;
        font-size: 0.65em;
    }
}

/* Custom Notification Styles */
.custom-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    font-family: "Roboto Mono", monospace;
    font-size: 16px;
    font-weight: 200;
    z-index: 10000;
    max-width: 600px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    animation: slideIn 0.5s ease-out, fadeOut 0.5s ease-in 3s forwards;
    white-space: pre-line;
}

.custom-notification.success {
    background: #1e1e1e75;
}

.custom-notification.warning {
    background: #1e1e1e75;
}

.custom-notification.error {
    background: #1e1e1e75;
}

@keyframes slideIn {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}
