/* Modal Core Functionality */
.modal-toggle {
    display: none;
}

.modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    display: flex;
    justify-content: flex-end;
}

.modal-body {
    background-color: #ffffff;
    width: 50%;
    height: 100%;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-toggle:checked+.modal-wrapper {
    opacity: 1;
    visibility: visible;
}

.modal-toggle:checked+.modal-wrapper .modal-body {
    transform: translateX(0);
}

/* Modal Overlay for Closing */
.modal-overlay-close {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Modal Content Layout */
.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    margin: 0;
    line-height: 2rem;
    font-weight: 700;
    color: #1f2937;
}

.modal-close {
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 700;
    color: #6b7280;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #1f2937;
}

.modal-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.examples-modal .modal-content {
    padding: 0;
}

/* Side Buttons */
.codelab-publish-actions {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.side-button {
    cursor: pointer;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    padding: 1rem 0.5rem;
    margin-bottom: 8px;
    color: white;
    font-weight: 700;
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: background-color 0.3s;
}

.side-button-publish {
    background-color: #2563eb;
}

.side-button-publish:hover {
    background-color: #1d4ed8;
}

.side-button-examples {
    background-color: #555555;
}

.side-button-examples:hover {
    background-color: #111111;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: box-shadow 0.2s;
    box-sizing: border-box;
    /* Ensures padding doesn't affect width */
}

.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6;
}

/* Category List Styles */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.category-item-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.2s;
}

.category-item-label:hover {
    background-color: #f3f4f6;
}

.category-item-label span {
    color: #374151;
}

.publish-controls {
    display: grid;
    grid-template-columns: 50% 50%;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1rem 2rem;
    margin-left: -1.5rem;
    box-sizing: border-box;
    background-color: #fff;
    box-shadow: 0 2px 10px 0 #49505788;
    border-top: 1px solid #e5e7eb;
}

/* Submit Button */
.submit-button,
.new-button {
    width: 100%;
    background-color: #16a34a;
    color: white;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
}

.new-button {
    background-color: #7c3aed;
    text-decoration: none;
}

.new-button:hover {
    background-color: #6d28d9;
}

.submit-button:hover {
    background-color: #15803d;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .modal-body {
        width: 90%;
    }
}


/* Table Wrapper for horizontal scrolling on small screens */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
}

/* Table Styles */
.awesome-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    /* Prevents table from becoming too cramped */
}

/* Table Header Styles */
.awesome-table thead th {
    background-color: #f8f9fa;
    color: #6c757d;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: left;
    padding: 1rem 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e9ecef;
}

/* Table Body Row Styles */
.awesome-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease-in-out;
}

.awesome-table tbody tr:last-child {
    border-bottom: none;
    /* Remove border from the last row */
}

.awesome-table tbody tr:hover {
    background-color: #f1f3f5;
}

/* Table Cell Styles */
.awesome-table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    font-size: 0.95rem;
    color: #495057;
}

.awesome-table tr td:nth-child(2),
.awesome-table tr th:nth-child(2) {
    text-align: center;
    width: 150px;
    border-left: 1px solid #e9ecef;
}

.awesome-table .post-name {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Link styles within the table */
.awesome-table a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.awesome-table a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Category Badge Style */
.category-badge {
    display: inline-block;
    background-color: #e7f3ff;
    color: #007bff;
    padding: 0.35em 0.65em;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 50px;
    white-space: nowrap;
}

/* Pagination Styles */
.pagination-container {
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid #e9ecef;
    background-color: #fff;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
    /* Space between pagination items */
}

.pagination .page-numbers {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    background-color: #fff;
    border: 1px solid #dee2e6;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination .page-numbers:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
    transform: translateY(-2px);
}

.pagination .page-numbers.current {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
}

.pagination .page-numbers.disabled {
    color: #adb5bd;
    pointer-events: none;
    border-color: #e9ecef;
}

.pagination .page-numbers.prev,
.pagination .page-numbers.next {
    font-weight: 600;
    text-wrap: nowrap;
    width: auto;
    padding: 10px;
}