/* ===== TRIALS PAGE STYLING ===== */

/* Main Page Container */
.trials-page {
    background: #f5f5f5;
    min-height: 100vh;
    position: relative;
    margin: -1.25rem;
}

@media (min-width: 768px) {
    .trials-page {
        margin: -2rem;
    }
}

@media (max-width: 767.98px) {
    .trials-page {
        margin: -1rem -1rem -5.5rem -1rem;
        padding-bottom: 5.5rem;
    }
}

/* Trials Loading Overlay */
.trials-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(2px);
    z-index: 9999;
}

.trials-loading-overlay .spinner-border {
    width: 3.5rem;
    height: 3.5rem;
    border-width: 0.4em;
    color: #2563eb;
}

/* Header Section */
.trials-header {
    background: white;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.trials-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.trials-header .subtitle {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
}

/* Search Container */
.search-container {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
}

input.search-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    background: #fafafa;
}

input.search-input:focus {
    outline: none;
    border-color: #1d4ed8;
    background: white;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.08);
}

input.search-input::placeholder {
    color: #9ca3af;
}

.btn-filter {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #374151;
    font-size: 1.1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-filter:hover {
    background: #f3f4f6;
    color: #1d4ed8;
}

/* Status Tabs */
.status-tabs {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
}

.status-tabs::-webkit-scrollbar {
    display: none;
}

.status-tab {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 0.55rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.status-tab:hover {
    background: #f3f4f6;
}

.status-tab.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: white;
}

/* Trials List Container */
.trials-list-container {
    padding: 1.5rem;
    max-width: 100%;
}

/* Trials Grid */
.trials-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* Trial Card */
.trial-card {
    background: white;
    border: 1px solid #eef0f3;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.trial-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Trial Card Header */
.trial-card-header {
    padding: 1.1rem 1.1rem 0.9rem 1.1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.trial-icon {
    width: 3rem;
    height: 3rem;
    background: #1f2430;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.trial-title-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.trial-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.trial-title-row h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #111827;
    font-weight: 700;
}

.trial-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
}

.trial-status {
    display: inline-flex;
    width: fit-content;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.status-draft {
    background-color: #fef3c7;
    color: #b45309;
}

.status-submitted {
    background-color: #cffafe;
    color: #0e7490;
}

.status-under-review {
    background-color: #ede9fe;
    color: #6d28d9;
}

.status-approved {
    background-color: #d1fae5;
    color: #047857;
}

.status-published {
    background-color: #d1fae5;
    color: #047857;
}

.status-upcoming {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.status-live {
    background-color: #dcfce7;
    color: #15803d;
}

.status-completed {
    background-color: #f3f4f6;
    color: #4b5563;
}

/* Trial Card Body */
.trial-card-body {
    padding: 0 1.1rem 1rem 1.1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.trial-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #4b5563;
}

.meta-icon {
    font-size: 0.95rem;
    min-width: 1.1rem;
    text-align: center;
}

/* Trial Card Footer */
.trial-card-footer {
    padding: 0.9rem 1.1rem 1.1rem 1.1rem;
    display: flex;
    gap: 0.6rem;
}

.btn-action {
    flex: 1;
    min-width: 0;
    background: #f4f5f7;
    border: 1px solid #eceef1;
    border-radius: 0.75rem;
    padding: 0.65rem 0.75rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-action:hover {
    background: #e8eaee;
    color: #1d4ed8;
}
    /* Filter Panel Modal Overlay */
    .filter-panel-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 998;
    }

    /* Filter Panel - Bottom Sheet */
    .filter-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 88vh;
        background: white;
        z-index: 999;
        display: flex;
        flex-direction: column;
        border-radius: 1.25rem 1.25rem 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        animation: slideUp 0.25s ease;
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }

    .filter-drag-handle {
        width: 3rem;
        height: 0.3rem;
        background: #d1d5db;
        border-radius: 999px;
        margin: 0.75rem auto 0 auto;
        flex-shrink: 0;
    }

    .filter-panel-header {
        padding: 1rem 1.5rem 0.5rem 1.5rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-shrink: 0;
    }

    .filter-panel-header h3 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 700;
        color: #111827;
    }

    .filter-panel-content {
        flex: 1;
        overflow-y: auto;
        padding: 0.75rem 1.5rem 1rem 1.5rem;
    }

    .btn-clear-all {
        background: none;
        border: none;
        color: #1d4ed8;
        font-weight: 600;
        cursor: pointer;
        font-size: 0.9rem;
        transition: color 0.2s ease;
        padding: 0;
    }

    .btn-clear-all:hover {
        color: #1e40af;
        text-decoration: underline;
    }

    .filter-group {
        margin-bottom: 1.5rem;
    }

    .filter-label {
        display: block;
        font-size: 0.92rem;
        font-weight: 700;
        color: #111827;
        margin-bottom: 0.6rem;
    }

    select.filter-select,
    input.filter-date {
        width: 100%;
        border: 1px solid #d1d5db;
        border-radius: 0.75rem;
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
        background: white;
        color: #374151;
        -webkit-appearance: none;
        appearance: none;
        display: block;
        min-height: 3rem;
    }

    select.filter-select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23374151' stroke-width='1.5' stroke-linecap='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 1rem center;
        padding-right: 2.5rem;
    }

    input.filter-date + input.filter-date {
        margin-top: 0.6rem;
    }

    select.filter-select:focus,
    input.filter-date:focus {
        outline: none;
        border-color: #1d4ed8;
        box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.08);
    }

    .filter-panel-footer {
        padding: 1rem 1.5rem 1.5rem 1.5rem;
        flex-shrink: 0;
    }

    .btn-apply {
        width: 100%;
        background: #1d4ed8;
        color: white;
        border: none;
        border-radius: 0.75rem;
        padding: 0.95rem 1.5rem;
        font-size: 1rem;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .btn-apply:hover {
        background: #1e40af;
    }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 420px;
    margin: 0 auto;
}

.empty-illustration {
    width: 200px;
    height: 200px;
    margin-bottom: 1.5rem;
}

.empty-illustration svg {
    width: 100%;
    height: 100%;
}

.empty-state h3 {
    font-size: 1.35rem;
    color: #111827;
    margin: 0 0 0.75rem 0;
    font-weight: 800;
}

.empty-state p {
    color: #6b7280;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.btn-create-first {
    width: 100%;
    background: #1d4ed8;
    color: white;
    border: none;
    border-radius: 0.75rem;
    padding: 0.95rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-create-first:hover {
    background: #1e40af;
}

.btn-create-first .btn-plus {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.loading-spinner .spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

.loading-spinner p {
    font-size: 1rem;
    color: #666;
}

.btn .loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    padding: 0;
    flex: none;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #FFFFFF;
    animation: pf-btn-spinner 0.6s linear infinite;
}

@keyframes pf-btn-spinner {
    to { transform: rotate(360deg); }
}

/* Pagination */
.pagination-nav {
    display: flex;
    justify-content: center;
    margin: 2rem 1rem 0 1rem;
    padding: 0 1rem;
}

.pagination {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: center;
}

.page-item .page-link {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    background: white;
    color: #007bff;
    text-decoration: none;
    border-radius: 0.35rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.page-item .page-link:hover:not([disabled]) {
    background: #f0f0f0;
    border-color: #007bff;
}

.page-item.active .page-link {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.page-item.disabled .page-link {
    color: #999;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Floating Action Button */
.fab-create {
    position: fixed;
    bottom: 5.5rem;
    right: 1.25rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: #1d4ed8;
    color: white;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 50;
}

.fab-create:hover {
    background: #1e40af;
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .trials-header {
        padding: 1rem;
    }

    .trials-header h1 {
        font-size: 1.5rem;
    }

    .search-input {
        min-width: 100%;
    }

    .filter-panel {
        max-width: 100%;
    }

    .status-tabs {
        width: 100%;
    }

    .trials-list-container {
        padding: 1rem;
    }

    .trials-grid {
        gap: 1rem;
    }

    .trial-card {
        border-radius: 0.5rem;
    }

    .trial-card-header {
        padding: 1rem;
    }

    .trial-card-body {
        padding: 1rem;
    }

    .trial-card-footer {
        padding: 0.85rem 1rem 1rem 1rem;
    }

    .fab-create {
        width: 3.25rem;
        height: 3.25rem;
        bottom: 5rem;
        right: 1rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}
