/* Clean and Minimal CSS for Interactive Timetable */

:root {
    --primary-color: #2F3C7E;
    /* 60% of the page color */
    --secondary-color: #FBEAEB;
    /* 30% of the page color */
    --background-color: #E1E5E6;
    /* 10% additional color */
    --text-color: #2c3e50;
    --border-color: #d1d8e0;
    --hover-color: #ff6b6b;
}

body {
    font-family: "Exo 2", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    background-color: var(--secondary-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
}

.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;
}

.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"] {
    width: 150px;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1.25em;
    margin-right: 10px;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Exo 2", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 1.1em;
    box-shadow: rgba(17, 12, 46, 0.15) 0px 48px 100px 0px;
    transition: box-shadow 0.3s ease;
}

button:hover {
    box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
}

.color-picker {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.color-option {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid black;
    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 var(--primary-color), 0 0 10px rgba(47, 60, 126, 0.5);
    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 */

table {
    margin-top: 10px;
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    font-size: 1.3em;
    box-shadow: rgba(50, 50, 93, 0.25) 0px 30px 60px -12px, rgba(0, 0, 0, 0.3) 0px 18px 36px -18px;
}

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

th {
    background-color: var(--primary-color);
    color: white;
}

td {
    background-color: white;
    transition: transform 0.3s ease;
}

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

/* Subject Table Styles */

.download-format {
    margin: 1rem 0;
}

#downloadBtn {
    margin-bottom: 1rem;
}

.download-btn:hover {
    transition: all .3s ease-in-out;
}

#subjectTable {
    box-shadow: rgba(50, 50, 93, 0.25) 0px 30px 60px -12px, rgba(0, 0, 0, 0.3) 0px 18px 36px -18px;
}

#subjectTable th {
    background-color: var(--primary-color);
}

.delete-btn {
    background-color: var(--hover-color);
    color: white;
    border: none;
    padding: 4px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 1em;
}

.delete-btn:hover {
    background-color: #e55656;
}

/* Footer Styles */

footer {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-size: 1.2em;
}

footer .left-section {
    display: flex;
    align-items: center;
    flex-direction: column;
    margin-left: 10px;
}

footer .right-section {
    display: flex;
    align-items: center;
    flex-direction: column;
}

.social-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-icons a {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.social-icons a img {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    filter: brightness(0) invert(1);
}

.heart {
    color: #ff6b6b;
    font-size: 1.5em;
    animation: heartbeat 1.2s infinite;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(0.8);
    }

    50% {
        transform: scale(1.2);
    }
}

footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */

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

    h1 {
        font-size: 1.4em;
    }

    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;
    }

    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;
    }

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

    footer a {
        font-size: 1em;
    }

    footer {
        font-size: 0.85em;
    }

    footer .right-section .social-icons {
        font-size: .60rem;
    }

    footer .right-section .social-icons img {
        width: 15px;
        height: 15px;
    }
}

/* 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: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

.edit-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 4px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 1em;
}

.edit-btn:hover {
    background-color: #2980b9;
}

/* 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%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box;
}

.modal-field input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(47, 60, 126, 0.3);
}

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

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

.save-btn {
    background-color: #27ae60;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

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

.cancel-btn {
    background-color: #95a5a6;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

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

/* 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: var(--primary-color);
    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;
    }
}