/* Protocol Builder Custom Styles */

/* Light Theme (Default) */
:root {
    --bs-primary: #ff8c42;
    --bs-primary-rgb: 255, 140, 66;
    
    /* Light theme colors */
    --bg-primary: #ffffff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #F9FAFB;
    --text-primary: #000000;
    --text-secondary: #1a1a1a;
    --text-muted: #4a4a4a;
    --border-color: #E5E7EB;
    --card-bg: #ffffff;
    --card-border: #E5E7EB;
    --input-bg: #ffffff;
    --input-border: #D1D5DB;
    --header-bg: #ffffff;
    --sidebar-bg: #F9FAFB;
    --footer-bg: #F9FAFB;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --bg-tertiary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #f0f0f0;
    --text-muted: #b0b0b0;
    --border-color: #404040;
    --card-bg: #2d2d2d;
    --card-border: #404040;
    --input-bg: #333333;
    --input-border: #505050;
    --header-bg: #1a1a1a;
    --sidebar-bg: #242424;
    --footer-bg: #1a1a1a;
}

/* Apply theme colors */
body {
    background-color: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
}

.protocol-header {
    background-color: var(--header-bg) !important;
    border-color: var(--border-color) !important;
    min-height: 70px;
}

.protocol-header .navbar {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.protocol-header .navbar-brand {
    font-size: 1.25rem;
}

.protocol-header .nav-link {
    padding: 0.5rem 1rem;
}

.protocol-header .btn {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
}

.protocol-header .btn i {
    font-size: 1rem;
}

.protocol-header .btn-primary {
    background-color: #ff8c42 !important;
    border-color: #ff8c42 !important;
    color: white !important;
}

.protocol-header .btn-primary:hover {
    background-color: #ff7a2e !important;
    border-color: #ff7a2e !important;
}

.protocol-header .btn-outline-secondary {
    border-color: #6c757d !important;
    color: #6c757d !important;
}

.protocol-header .btn-outline-secondary:hover {
    background-color: #6c757d !important;
    color: white !important;
}

.protocol-sidebar {
    width: 280px;
    background-color: white;
    border-right: 1px solid #E5E7EB;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-content {
    padding: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #4B5563;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background-color: #F3F4F6;
    color: #111827;
}

.sidebar-item.active {
    background-color: #fff5f0;
    color: #ff8c42;
    border-left-color: #ff8c42;
}

.sidebar-item i {
    font-size: 1.1rem;
    width: 24px;
    margin-right: 0.75rem;
}

.sidebar-divider {
    margin: 1rem 1.5rem;
    border-color: #E5E7EB;
}

.sidebar-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6B7280;
    letter-spacing: 0.05em;
}

.sidebar-filter-group {
    margin-bottom: 0.5rem;
}

.sidebar-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.sidebar-filter-header:hover {
    background-color: #F9FAFB;
}

.sidebar-filter-header i {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.sidebar-filter-header[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.sidebar-filter-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.5rem 0.5rem 2.5rem;
    font-size: 0.875rem;
    color: #6B7280;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-filter-item:hover {
    background-color: #F9FAFB;
    color: #111827;
}

.sidebar-filter-item.active {
    background-color: #fff5f0;
    color: #ff8c42;
    font-weight: 500;
}

.sidebar-stats {
    padding: 1rem 1.5rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.stat-label {
    font-size: 0.875rem;
    color: #6B7280;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

/* Mobile responsive sidebar */
@media (max-width: 768px) {
    .protocol-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #E5E7EB;
        max-height: 300px;
    }
}

.protocol-footer {
    background: var(--footer-bg) !important;
}

.protocol-content {
    background-color: var(--bg-secondary) !important;
}

.protocol-card,
.card,
.protocol-list-item {
    background-color: #FAFBFC !important;
    border-color: var(--card-border) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .protocol-card,
[data-theme="dark"] .card,
[data-theme="dark"] .protocol-list-item {
    background-color: var(--card-bg) !important;
}

.form-control,
.form-select {
    background-color: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-secondary) !important;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--input-bg) !important;
    color: var(--text-secondary) !important;
}

h1, h2, h3, h4, h5, h6,
.protocol-list-title {
    color: var(--text-primary) !important;
}

p, span, div, .text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted) !important;
}

.border,
.border-top,
.border-bottom {
    border-color: var(--border-color) !important;
}

/* Dark theme adjustments */
[data-theme="dark"] .navbar-light .navbar-nav .nav-link {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .navbar-light .navbar-nav .nav-link:hover {
    color: #ff8c42 !important;
}

[data-theme="dark"] .dropdown-menu {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: var(--bg-tertiary) !important;
    color: #ff8c42 !important;
}

[data-theme="dark"] .modal-content {
    background-color: var(--card-bg) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .alert {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .footer-text,
[data-theme="dark"] .footer-links li a,
[data-theme="dark"] .footer-features li,
[data-theme="dark"] .footer-copyright,
[data-theme="dark"] .footer-tagline {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .footer-heading {
    color: #ff8c42 !important;
}

/* Footer Middle Section */
.footer-middle {
    border-top: 1px solid var(--border-color);
}

.footer-main-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.footer-main-link img {
    height: 32px;
    max-width: 120px;
    width: auto;
    object-fit: contain;
}

.footer-main-link:hover {
    color: #ff8c42;
    transform: translateY(-2px);
}

.footer-separator {
    color: var(--border-color);
    font-size: 1.5rem;
}

.footer-btn {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.footer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .footer-main-link {
    color: var(--text-secondary);
}

[data-theme="dark"] .footer-main-link:hover {
    color: #ff8c42;
}

/* List group fixes for dashboard */
.list-group-item {
    background-color: transparent !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

.list-group-item:hover {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] .list-group-item {
    background-color: transparent !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .list-group-item:hover {
    background-color: var(--bg-tertiary) !important;
}

.list-group-item .fw-bold {
    color: var(--text-primary) !important;
}

/* Badge consistency */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Consistent button heights */
.btn-sm {
    height: 31px;
    display: inline-flex;
    align-items: center;
}

/* Avatar circle consistency */
.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ff8c42;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Dropdown menu dark theme */
[data-theme="dark"] .dropdown-menu {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: var(--bg-tertiary) !important;
    color: #ff8c42 !important;
}

/* Pagination dark theme */
[data-theme="dark"] .pagination .page-link {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .pagination .page-link:hover {
    background-color: var(--bg-tertiary) !important;
    color: #ff8c42 !important;
}

[data-theme="dark"] .pagination .page-item.active .page-link {
    background-color: #ff8c42 !important;
    border-color: #ff8c42 !important;
    color: white !important;
}

/* Button group consistency */
.btn-group .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Form control consistency */
.form-control,
.form-select {
    height: calc(2.25rem + 2px);
}

.form-control-sm,
.form-select-sm {
    height: calc(1.8rem + 2px);
}

/* ============================================
   AUTH PAGES STYLES (Login & Register)
   ============================================ */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 3rem 0;
}

.auth-content {
    padding: 3rem;
}

.auth-form {
    padding: 3rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

[data-theme="dark"] .auth-form {
    background-color: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.form-control:focus,
.form-select:focus {
    border-color: #ff8c42;
    box-shadow: 0 0 0 0.2rem rgba(255, 140, 66, 0.25);
}

/* Int'l Tel Input width */
.iti {
    width: 100%;
}

/* ============================================
   HOME PAGE STYLES
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    color: var(--text-primary);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid #ff8c42;
}

[data-theme="dark"] .hero-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,140,66,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: bottom;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-lead {
    font-size: 1.3rem;
}

.hero-icon {
    font-size: 200px;
    opacity: 0.9;
    color: #ff8c42;
}

[data-theme="dark"] .hero-icon {
    opacity: 0.8;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-lead {
    font-size: 1.2rem;
}

.feature-card {
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.feature-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 24px;
    margin-bottom: 20px;
    background-color: rgba(255, 140, 66, 0.1);
    color: #ff8c42;
}

.stats-section {
    background: linear-gradient(135deg, rgba(255, 140, 66, 0.05) 0%, rgba(255, 140, 66, 0.1) 100%);
    padding: 60px 0;
    border-top: 1px solid rgba(255, 140, 66, 0.1);
    border-bottom: 1px solid rgba(255, 140, 66, 0.1);
}

.stat-card {
    text-align: center;
    padding: 30px 20px;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 140, 66, 0.15);
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: #ff8c42;
    display: block;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 1.15rem;
    font-weight: 500;
    margin-top: 8px;
}

/* Recent Protocols Section */
.recent-protocols-section {
    background-color: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

[data-theme="dark"] .recent-protocols-section {
    background-color: var(--bg-secondary);
}

.protocol-preview-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    transition: all 0.3s ease;
    height: 100%;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

[data-theme="dark"] .protocol-preview-card {
    background-color: var(--card-bg);
    border-color: var(--card-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.protocol-preview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 140, 66, 0.15);
    border-color: rgba(255, 140, 66, 0.3);
}

[data-theme="dark"] .protocol-preview-card:hover {
    box-shadow: 0 8px 25px rgba(255, 140, 66, 0.25);
    border-color: rgba(255, 140, 66, 0.4);
}

.protocol-card-title a {
    color: var(--text-primary);
    transition: color 0.2s;
}

.protocol-card-title a:hover {
    color: #ff8c42;
}

.protocol-card-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.protocol-target-info {
    background-color: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: 6px;
    border-left: 3px solid #ff8c42;
}

[data-theme="dark"] .protocol-target-info {
    background-color: rgba(255, 140, 66, 0.1);
    border-left-color: #ff8c42;
}

.protocol-target-info small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.protocol-stats-row {
    background-color: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: 8px;
}

[data-theme="dark"] .protocol-stats-row {
    background-color: rgba(255, 255, 255, 0.03);
}

.protocol-stat-item {
    flex: 1;
}

.protocol-stat-item i {
    font-size: 1.25rem;
    display: block;
    margin-bottom: 0.25rem;
}

.protocol-stat-item small {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.protocol-card-footer {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.protocol-author-avatar {
    color: #ff8c42;
    font-size: 1.5rem;
    line-height: 1;
}

.protocol-author-name {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.protocol-date {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.protocol-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.cta-section {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    padding: 80px 0;
    position: relative;
    border-top: 2px solid #ff8c42;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,140,66,0.1)" d="M0,128L48,144C96,160,192,192,288,192C384,192,480,160,576,149.3C672,139,768,149,864,165.3C960,181,1056,203,1152,202.7C1248,203,1344,181,1392,170.7L1440,160L1440,0L1392,0C1344,0,1248,0,1152,0C1056,0,960,0,864,0C768,0,672,0,576,0C480,0,384,0,288,0C192,0,96,0,48,0L0,0Z"></path></svg>');
    background-size: cover;
    opacity: 0.3;
}

.btn-hero {
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    background-color: #ff8c42;
    border-color: #ff8c42;
    color: white;
}

.btn-hero:hover {
    background-color: #e67a31;
    border-color: #e67a31;
    color: white;
}

/* ============================================
   CITATION BOX (Show Protocol Page)
   ============================================ */
.citation-box {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    background-color: var(--bg-tertiary);
}

.citation-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
}

[data-theme="dark"] .citation-box {
    border-color: var(--border-color);
    background-color: var(--bg-tertiary);
}

/* ============================================
/* PHONE INPUT (Profile & Register)
   ============================================ */
.iti {
    width: 100%;
}

/* ============================================
   BADGE VARIANTS
   ============================================ */
.badge-no-doi {
    font-size: 0.75rem;
    background-color: #ffe5d0 !important;
    color: #333 !important;
}

[data-theme="dark"] .badge-no-doi {
    background-color: rgba(255, 140, 66, 0.2) !important;
    color: #ff8c42 !important;
}

/* ============================================
   PROFILE STAT BOXES
   ============================================ */
.profile-stat-box {
    padding: 1rem;
    border-radius: 6px;
    background-color: rgba(255, 140, 66, 0.1);
    border: 1px solid rgba(255, 140, 66, 0.2);
}

[data-theme="dark"] .profile-stat-box {
    background-color: rgba(255, 140, 66, 0.15);
    border-color: rgba(255, 140, 66, 0.3);
}

/* Light theme sidebar active state */
.protocol-sidebar .nav-link.active {
    background-color: #e8f4f8 !important;
    color: #1a1a1a !important;
}

.protocol-sidebar .nav-link:hover {
    background-color: #f0f0f0 !important;
}

/* Dark theme sidebar fixes */
[data-theme="dark"] .protocol-sidebar .nav-link {
    color: #d1d1d1 !important;
}

[data-theme="dark"] .protocol-sidebar .nav-link.active {
    background-color: #505050 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

[data-theme="dark"] .protocol-sidebar .nav-link:hover {
    background-color: #404040 !important;
    color: #ffffff !important;
}

/* Dark theme sidebar item fixes (actual classes used in sidebar) */
[data-theme="dark"] .protocol-sidebar {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .sidebar-item {
    color: #d1d1d1 !important;
}

[data-theme="dark"] .sidebar-item:hover {
    background-color: #404040 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .sidebar-item.active {
    background-color: #505050 !important;
    color: #ff8c42 !important;
    border-left-color: #ff8c42 !important;
}

[data-theme="dark"] .sidebar-filter-item {
    color: #9CA3AF !important;
}

[data-theme="dark"] .sidebar-filter-item:hover {
    background-color: #404040 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .sidebar-filter-item.active {
    background-color: #505050 !important;
    color: #ff8c42 !important;
}

[data-theme="dark"] .sidebar-filter-header {
    color: #E5E7EB !important;
}

[data-theme="dark"] .sidebar-filter-header:hover {
    background-color: #374151 !important;
}

[data-theme="dark"] .sidebar-section-title {
    color: #9CA3AF !important;
}

[data-theme="dark"] .sidebar-divider {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .stat-label {
    color: #9CA3AF !important;
}

[data-theme="dark"] .stat-value {
    color: #E5E7EB !important;
}

/* Header nav-link visibility fixes */
.protocol-header .nav-link {
    color: #4B5563 !important;
    font-weight: 500;
}

.protocol-header .nav-link:hover {
    color: #111827 !important;
}

.protocol-header .nav-link.active {
    color: #ff8c42 !important;
    font-weight: 600 !important;
}

/* Dark theme header nav-link fixes */
[data-theme="dark"] .protocol-header .nav-link {
    color: #d1d1d1 !important;
}

[data-theme="dark"] .protocol-header .nav-link:hover {
    color: #ffffff !important;
}

[data-theme="dark"] .protocol-header .nav-link.active {
    color: #ff8c42 !important;
    font-weight: 600 !important;
}

/* Dark theme placeholder fix */
[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] .form-select::placeholder,
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #888888 !important;
    opacity: 1;
}

/* Dark theme form text and labels */
[data-theme="dark"] .form-label,
[data-theme="dark"] .form-text,
[data-theme="dark"] label {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .form-text {
    color: var(--text-muted) !important;
}

/* Dark theme modal text */
[data-theme="dark"] .modal-body .form-text,
[data-theme="dark"] .modal-body label,
[data-theme="dark"] .modal-body p {
    color: var(--text-secondary) !important;
}

.btn-primary {
    background-color: #ff8c42 !important;
    border-color: #ff8c42 !important;
    color: white !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #e67a31 !important;
    border-color: #e67a31 !important;
}

.btn-outline-primary {
    color: #ff8c42 !important;
    border-color: #ff8c42 !important;
}

.btn-outline-primary:hover {
    background-color: #ff8c42 !important;
    border-color: #ff8c42 !important;
    color: white !important;
}

.badge.bg-primary {
    background-color: #ff8c42 !important;
}

.text-primary {
    color: #ff8c42 !important;
}

.bg-primary {
    background-color: #ff8c42 !important;
}

/* Text colors for better readability */
.text-muted {
    color: var(--text-muted) !important;
}

p, span, div {
    color: var(--text-secondary);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

/* Protocol List Item */
.protocol-list-item {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.2s;
    cursor: pointer;
}

.protocol-list-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border-color: #ff8c42;
}

.protocol-list-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.protocol-list-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.protocol-list-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.protocol-list-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.protocol-list-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.protocol-list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #E5E7EB;
}

.protocol-list-actions {
    display: flex;
    gap: 0.5rem;
}

/* Step indicators */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #ff8c42;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.step-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    background: white;
}

.step-content {
    flex: 1;
}

.step-type {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background-color: #fff5f0;
    color: #ff8c42;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.step-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.step-params {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: #F9FAFB;
    border-radius: 4px;
}

.step-param {
    font-size: 0.875rem;
}

.step-param-label {
    color: var(--text-muted);
    font-weight: 500;
}

.step-param-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Table styles - fix background issues */
.table,
.reagent-table {
    width: 100%;
    font-size: 0.875rem;
    background-color: transparent !important;
}

.table thead th,
.reagent-table th {
    background-color: transparent !important;
    font-weight: 600;
    color: var(--text-primary) !important;
    padding: 0.75rem;
    border-bottom: 2px solid var(--border-color) !important;
    border-top: none !important;
}

.table tbody td,
.reagent-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color) !important;
    border-top: none !important;
    color: var(--text-secondary) !important;
    background-color: transparent !important;
}

.table tbody tr,
.reagent-table tr {
    background-color: transparent !important;
}

.table tbody tr:hover,
.reagent-table tr:hover {
    background-color: var(--bg-tertiary) !important;
}

/* Dark theme table fixes */
[data-theme="dark"] .table thead th,
[data-theme="dark"] .reagent-table th {
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .table tbody td,
[data-theme="dark"] .reagent-table td {
    background-color: transparent !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .table tbody tr:hover,
[data-theme="dark"] .reagent-table tr:hover {
    background-color: var(--bg-tertiary) !important;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Tag input */
.tag-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    min-height: 42px;
}

.tag-input-container:focus-within {
    border-color: #ff8c42;
    box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.1);
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background-color: #F9FAFB;
    color: #ff8c42;
    border-radius: 4px;
    font-size: 0.875rem;
}

.tag-item .remove-tag {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.tag-item .remove-tag:hover {
    opacity: 1;
}

/* Print styles */
@media print {
    body {
        font-size: 12pt;
        color: black;
    }
    
    .protocol-card {
        border: none;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .step-item {
        page-break-inside: avoid;
    }
    
    .btn, .badge {
        display: none !important;
    }
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Auth page styles */
.auth-title {
    color: #ff8c42;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.auth-check-icon {
    color: #ff8c42;
    font-size: 1.5rem;
}

.auth-feature-title {
    color: var(--text-primary);
}

.auth-feature-text {
    color: var(--text-muted);
}

.auth-form-title {
    color: var(--text-primary);
}

.auth-link {
    color: #ff8c42;
}

.auth-link:hover {
    color: #e67a32;
}

.auth-divider {
    background-color: var(--bg-primary);
}

.btn-google {
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.btn-google:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.google-icon {
    margin-right: 8px;
}

/* Input group height fix - match form-select height */
.input-group .form-control,
.input-group .form-select,
.input-group .btn {
    height: calc(2.25rem + 2px);
    line-height: 1.5;
}

.input-group .form-control-lg,
.input-group .btn-lg {
    height: calc(1.5em + 1.5rem + 2px);
    line-height: 1.5;
}

/* Phone input dark mode */
[data-theme="dark"] .iti__country-list {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .iti__country {
    color: var(--text-primary);
}

[data-theme="dark"] .iti__country:hover {
    background-color: var(--bg-tertiary);
}

[data-theme="dark"] .iti__selected-flag {
    background-color: transparent;
}

[data-theme="dark"] .iti__arrow {
    border-top-color: var(--text-secondary);
}

/* Form controls dark mode */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: var(--bg-secondary);
    border-color: #ff8c42;
    color: var(--text-primary);
}

/* Small close button for tags */
.btn-close-sm {
    width: 0.5em !important;
    height: 0.5em !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Protocol list */
    .protocol-list-header {
        flex-direction: column;
    }
    
    .protocol-list-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Step builder */
    .step-params {
        grid-template-columns: 1fr;
    }
    
    /* Header and navigation */
    .protocol-header .navbar-brand {
        font-size: 1rem;
    }
    
    .protocol-header .navbar-nav {
        margin-top: 1rem;
    }
    
    /* Cards and containers */
    .protocol-card {
        padding: 1rem;
    }
    
    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Buttons */
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Forms */
    .input-group {
        flex-direction: column;
    }
    
    .input-group .btn,
    .input-group .form-select,
    .input-group .form-control {
        width: 100%;
        border-radius: 0.375rem !important;
        margin-bottom: 0.5rem;
    }
    
    /* Sidebar */
    .protocol-sidebar {
        position: static;
        width: 100%;
        height: auto;
    }
    
    /* Modals */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    /* Badge groups */
    .d-flex.flex-wrap.gap-2 {
        gap: 0.5rem !important;
    }
}

/* Small mobile devices */
@media (max-width: 576px) {
    body {
        font-size: 13px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .protocol-header {
        padding: 0.5rem 0;
    }
    
    .protocol-card {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}
