/* CSS for Ucon Ward Manager */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #f1f5f9;
    --sidebar-bg: #1e293b;
    --sidebar-dark: #0f172a;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --hover-bg: #f8fafc;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #ffffff 100%);
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
}

/* Global placeholder styles */
::placeholder {
    color: #a1a1aa !important;
    font-style: italic !important;
    opacity: 0.8 !important;
}

::-webkit-input-placeholder {
    color: #a1a1aa !important;
    font-style: italic !important;
    opacity: 0.8 !important;
}

::-moz-placeholder {
    color: #a1a1aa !important;
    font-style: italic !important;
    opacity: 0.8 !important;
}

:-ms-input-placeholder {
    color: #a1a1aa !important;
    font-style: italic !important;
    opacity: 0.8 !important;
}

/* Mobile Menu Styles */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1100;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1.25rem;
    cursor: pointer;
    transition: left 0.3s ease, background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 50px;
    height: 50px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.mobile-menu-toggle i {
    transition: transform 0.3s ease;
}

.mobile-menu-toggle.menu-open {
    left: 295px; /* 280px sidebar width + 15px margin */
    transition: left 0.3s ease, background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.mobile-menu-toggle.menu-open i {
    transform: rotate(90deg);
}

/* Mobile sync notification badge */
.mobile-sync-badge {
    position: fixed;
    top: 0.6rem;  /* Slightly above hamburger button */
    left: 3.2rem; /* Position over top-right corner of hamburger button */
    background: #fbbf24; /* Yellow/amber color */
    color: #1e293b; /* Dark blue color (nav bar background) */
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: none; /* Hidden by default, shown via JS */
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1101; /* Above the hamburger button */
    transition: left 0.3s ease; /* Smooth transition when menu opens */
    border: 2px solid #6366f1; /* Purple border (hamburger button color) */
}

/* Move badge when menu is open */
.mobile-menu-toggle.menu-open ~ .mobile-sync-badge {
    left: 310px; /* Move with the hamburger button when menu is open */
}

/* Only show mobile sync badge on mobile devices */
@media (min-width: 769px) {
    .mobile-sync-badge {
        display: none !important;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}


/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-dark) 100%);
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    padding: 0;
}

.sidebar .p-4 {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar h5 {
    color: white;
    margin-bottom: 0;
}

/* Navigation Links */
.sidebar .nav-link {
    color: #94a3b8;
    padding: 1rem 1.5rem;
    border: none;
    text-align: left;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    margin: 0.25rem 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    text-decoration: none;
    background: none;
    width: calc(100% - 2rem);
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(4px);
    text-decoration: none;
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 12px;
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    padding: 2rem;
    min-height: 100vh;
}

/* Alert Container */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
}

/* Shared Component Styles */
.shortlink-item {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: var(--card-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.shortlink-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.file-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 0.75rem;
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--card-bg);
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--primary-color);
    background: var(--hover-bg);
}

/* Index Page Specific Styles */
.content-wrapper {
    /* margin-top: 50px; */
}

.form-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.form-section h5 {
    color: var(--text-primary);
    border-bottom: none;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.form-section h5::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--primary-color) 0%, transparent 100%);
    margin-left: 1rem;
}

.agenda-item, .announcement-item {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: var(--card-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.agenda-item:hover, .announcement-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Disabled state for agenda items */
.agenda-item.disabled {
    opacity: 0.6;
    background: #f8f9fa;
    pointer-events: none;
    position: relative;
}

.agenda-item.disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0.75rem;
    cursor: not-allowed;
    pointer-events: auto;
}

.agenda-items-override-message {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #0066cc;
}

.agenda-items-override-message i {
    font-size: 1.25rem;
}

/* Netlify controls container */
.netlify-controls-container {
    position: relative;
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Netlify control button styling */
.netlify-control-btn {
    opacity: 0.6;
    transition: opacity 0.2s ease;
    font-size: 0.8rem;
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    border: none;
    background: none;
    color: inherit;
}

.netlify-control-btn:hover {
    opacity: 1;
    text-decoration: none !important;
}

.netlify-control-btn:focus {
    text-decoration: none !important;
    outline: none;
    box-shadow: none;
}

/* Netlify loading spinner with narrow stroke */
.netlify-loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 1rem;
    height: 1rem;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 1.5px solid rgba(255, 255, 255, 0.6);
    animation: spin 1s linear infinite;
}

/* Sync loading spinner (same style as Netlify) */
.sync-loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 1.5px solid rgba(255, 255, 255, 0.6);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #16a34a);
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
}

.btn-success:hover {
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-outline-danger {
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-danger:hover {
    background: var(--danger-color);
}

.form-control {
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-label {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: var(--hover-bg);
    border-bottom: 1px solid var(--border-color);
    border-radius: 0.75rem 0.75rem 0 0 !important;
    padding: 1.25rem 1.5rem;
}

.card-header h5 {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

.alert {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.modal-content {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    border-radius: 0.75rem 0.75rem 0 0;
    padding: 1.5rem;
}

.modal-title {
    color: var(--text-primary);
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 0.75rem 0.75rem;
    padding: 1.5rem;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: .5rem;
    }
    .form-section {
        padding: 1.5rem;
        margin-bottom: 1.25rem;
    }
    .form-section h5 {
        margin-bottom: 0;
    }
    .form-label {
        margin-top: 1rem;
    }
    
    /* Stack toggle options vertically on mobile */
    .toggle-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .toggle-option > div {
        margin-bottom: 0;
    }
    
    .toggle-switch {
        align-self: flex-start;
    }
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    transition: all 0.4s ease;
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background: linear-gradient(135deg, #ffffff, #f1f5f9);
    transition: all 0.4s ease;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    background: var(--card-bg);
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-option:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.toggle-option-label {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
}

.toggle-option-description {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* New Hymn Selector Styles */
.hymn-selector-new {
    position: relative;
}

.hymn-display-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
}

.hymn-display-field:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.hymn-display-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.hymn-display-field.open {
    border-radius: 0.75rem 0.75rem 0 0;
    border-bottom-color: transparent;
}

.hymn-display-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.hymn-display-text.placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.hymn-dropdown-arrow {
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.hymn-display-field.open .hymn-dropdown-arrow {
    transform: rotate(180deg);
}

.hymn-dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-top: none;
    border-radius: 0 0 0.75rem 0.75rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    max-height: 320px;
    overflow: hidden;
}

.hymn-search-container {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--hover-bg);
}

.hymn-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    background: var(--card-bg);
    transition: all 0.3s ease;
}

.hymn-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.hymn-search-input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.hymn-results-container {
    max-height: 220px;
    overflow-y: auto;
}

.hymn-results-list {
    padding: 0;
}

.hymn-result-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.hymn-result-item:hover,
.hymn-result-item.highlighted {
    background: var(--hover-bg);
}

.hymn-result-item:last-child {
    border-bottom: none;
}

.hymn-result-number {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 40px;
    font-size: 1rem;
}

.hymn-result-title {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    margin-left: 1rem;
    flex: 1;
}

.hymn-results-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* Loading state */
.hymn-results-loading {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.hymn-results-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* YAML Preview Styles */
.yaml-preview-controls {
    display: flex;
    align-items: center;
}

.yaml-preview-container {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--card-bg);
    overflow: hidden;
}

.yaml-preview-content {
    margin: 0;
    padding: 1.5rem;
    background: #0f172a;
    color: #e2e8f0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
}

.yaml-preview-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.yaml-preview-content::-webkit-scrollbar-track {
    background: #1e293b;
}

.yaml-preview-content::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.yaml-preview-content::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* YAML Syntax Highlighting */
.yaml-key {
    color: #60a5fa;
    font-weight: 600;
}

.yaml-string {
    color: #34d399;
}

.yaml-number {
    color: #fbbf24;
}

.yaml-boolean {
    color: #f87171;
}

.yaml-null {
    color: #9ca3af;
    font-style: italic;
}

.yaml-comment {
    color: #6b7280;
    font-style: italic;
}

.yaml-array-marker {
    color: #a78bfa;
    font-weight: 600;
}

/* Copy button styling */
.btn-outline-secondary:hover {
    background: var(--secondary-color);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* Toast notification for copy feedback */
.copy-toast {
    position: fixed;
    top: 120px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1060;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
}

.custom-dropdown-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    font-size: 0.95rem;
}

.custom-dropdown-display:hover {
    border-color: var(--primary-color);
}

.custom-dropdown-display:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.custom-dropdown-display.open {
    border-radius: 0.5rem 0.5rem 0 0;
    border-bottom-color: transparent;
}

.custom-dropdown-text {
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.custom-dropdown-text.placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.custom-dropdown-arrow {
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.custom-dropdown-display.open .custom-dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-panel {
    position: fixed;
    z-index: 10000;
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    max-height: 200px;
    overflow-y: auto;
}

.custom-dropdown-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.custom-dropdown-option:hover,
.custom-dropdown-option.highlighted {
    background: var(--hover-bg);
}

.custom-dropdown-option.selected {
    background: var(--primary-color);
    color: white;
}

.custom-dropdown-option:last-child {
    border-radius: 0 0 0.5rem 0.5rem;
}

/* Dropdown positioned above */
.custom-dropdown-panel.dropdown-above {
    border-top: 2px solid var(--primary-color);
    border-bottom: none;
    border-radius: 0.5rem 0.5rem 0 0;
}

.custom-dropdown-panel.dropdown-above .custom-dropdown-option:first-child {
    border-radius: 0.5rem 0.5rem 0 0;
}

.custom-dropdown-panel.dropdown-above .custom-dropdown-option:last-child {
    border-radius: 0;
}

/* Agenda Item Layout */
.agenda-item-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0;
}

.agenda-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
    justify-content: flex-start;
}

/* Ensure all form controls within agenda fields align properly */
.agenda-field .form-control,
.agenda-field .custom-dropdown,
.agenda-field .hymn-selector-new,
.agenda-field .agenda-toggle-switch {
    margin-top: 0;
}

/* Ensure consistent height for all input controls */
.agenda-field .form-control,
.agenda-field .custom-dropdown-display,
.agenda-field .hymn-display-field {
    min-height: 48px;
    display: flex;
    align-items: center;
}

.agenda-field-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    height: 22px;
    line-height: 22px;
}

.agenda-field-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: help;
}

.agenda-type-field {
    flex: 0 0 240px;
    align-self: flex-start;
}

.agenda-name-field {
    flex: 1;
    min-width: 150px;
    align-self: flex-start;
}

.agenda-title-field {
    flex: 1;
    min-width: 150px;
    align-self: flex-start;
}

.agenda-special-field {
    flex: 0 0 80px;
    align-items: center;
    align-self: flex-start;
}

.agenda-delete-field {
    flex: 0 0 40px;
    align-items: flex-end;
    align-self: flex-start;
    padding-top: 1.5rem;
}

.drag-handle {
    flex: 0 0 24px;
    align-self: center;
}

/* Agenda Toggle Switch */
.agenda-toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    margin: 0;
}

.agenda-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.agenda-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    transition: all 0.3s ease;
    border-radius: 28px;
}

.agenda-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background: white;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.agenda-toggle-switch input:checked + .agenda-toggle-slider {
    background: var(--primary-color);
}

.agenda-toggle-switch input:checked + .agenda-toggle-slider:before {
    transform: translateX(20px);
}

.agenda-delete-btn {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom type field */
.custom-type-field {
    margin-top: 0.75rem;
    margin-left: 40px; /* Account for drag handle */
    transition: all 0.3s ease;
}

.custom-type-field input {
    width: 300px;
    max-width: 100%;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .agenda-item-content {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .agenda-type-field,
    .agenda-name-field,
    .agenda-title-field {
        flex: 1 1 200px;
        min-width: 180px;
    }
    
    .agenda-special-field {
        flex: 0 0 100px;
    }
}

@media (max-width: 768px) {
    .agenda-item-content {
        flex-direction: row;
        gap: 1rem;
    }
    
    .agenda-field {
        width: 100%;
    }

    .agenda-type-field,
    .agenda-name-field,
    .agenda-title-field {
        flex: 1 1 800px;
    }
    
    .drag-handle {
        margin-top: 0;
        order: -1;
    }
    
    .agenda-delete-field {
        padding-top: 0;
        align-self: flex-start;
    }
    
    .custom-type-field {
        margin-left: 0;
    }
}

/* Sidebar Header Styles */
.sidebar-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar-icon i {
    font-size: 1.2rem;
    color: white;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 0.85rem;
    font-weight: 400;
    color: #94a3b8;
    line-height: 1.2;
}

/* Additional Enhancement Styles */
.text-muted {
    color: var(--text-muted) !important;
}

h6 {
    color: var(--text-primary);
    font-weight: 600;
}

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

/* Focus and Active States */
select.form-control:focus,
textarea.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Loading and Status Indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-success {
    background-color: var(--success-color);
}

.status-warning {
    background-color: var(--warning-color);
}

.status-danger {
    background-color: var(--danger-color);
}

/* Drag and Drop Styles */
.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    margin-right: 0.75rem;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.drag-handle:hover {
    color: var(--primary-color);
    background: var(--hover-bg);
}

.drag-handle:active {
    cursor: grabbing;
}

.draggable-item {
    transition: all 0.3s ease;
    position: relative;
}

.draggable-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.draggable-item.drag-over {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
}

.sortable-container {
    min-height: 100px;
    transition: all 0.3s ease;
}

.sortable-container.drag-over {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(79, 70, 229, 0.05));
    border: 2px dashed var(--primary-color);
    border-radius: 0.75rem;
}

.drop-placeholder {
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: 2px;
    margin: 0.5rem 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drop-placeholder.active {
    opacity: 1;
}

.item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.item-title {
    display: flex;
    align-items: center;
    margin: 0;
}

/* Custom Tooltip Styles */
.custom-tooltip {
    position: fixed;
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 320px;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* Markdown content styles within tooltips */
.custom-tooltip p {
    margin: 0 0 8px 0;
}

.custom-tooltip p:last-child {
    margin-bottom: 0;
}

.custom-tooltip strong {
    font-weight: 600;
    color: #e2e8f0;
}

.custom-tooltip em {
    font-style: italic;
    color: #cbd5e1;
}

.custom-tooltip code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    color: #fbbf24;
}

.custom-tooltip ul {
    margin: 4px 0;
    padding-left: 20px;
}

.custom-tooltip li {
    margin: 2px 0;
}

.custom-tooltip a {
    color: #60a5fa;
    text-decoration: none;
}

.custom-tooltip a:hover {
    text-decoration: underline;
}

/* Tooltip trigger styling */
.tooltip-trigger {
    cursor: help;
    position: relative;
}

.tooltip-trigger:hover {
    color: var(--primary-color);
}

/* Custom Type Field Styles */
.custom-type-field {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--hover-bg);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.custom-type-field input {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Agenda Hymn Field Styles */
.agenda-hymn-field {
    flex: 1;
    min-width: 200px;
    align-self: flex-start;
}

.agenda-hymn-details-field {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--hover-bg);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.agenda-hymn-details-field input {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Hymn details toggle button */
.agenda-hymn-details-toggle {
    margin-top: 0.5rem;
}

.agenda-hymn-details-btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.agenda-hymn-details-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* WYSIWYG Editor Styles */
.announcement-editor {
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    overflow: hidden;
}

.editor-toolbar {
    background: var(--hover-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem;
    display: flex;
    gap: 0.25rem;
}

.editor-toolbar .btn {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.editor-toolbar .btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.editor-toolbar .btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.toolbar-separator {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 0.25rem;
}

.editor-content {
    min-height: 80px;
    padding: 0.75rem;
    background: white;
    border: none;
    outline: none;
    line-height: 1.5;
    font-size: 0.95rem;
}

.editor-content:empty::before {
    content: attr(placeholder);
    color: var(--text-muted);
    font-style: italic;
}

.editor-content:focus {
    box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Markdown editor when visible */
.announcement-content-markdown {
    border: none;
    border-radius: 0;
    resize: vertical;
    min-height: 80px;
}

.announcement-content-markdown:focus {
    box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Editor toggle button */
.editor-toggle {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

/* Basic styling for editor content */
.editor-content strong {
    font-weight: bold;
}

.editor-content em {
    font-style: italic;
}

.editor-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.editor-content ul,
.editor-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.editor-content li {
    margin: 0.25rem 0;
}

/* Fixed Save Changes Button - Top Right */
.fixed-save-btn-top {
    position: fixed;
    top: 20px;
    right: 30px;
    z-index: 1050;
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.3s ease-out;
}

.fixed-save-btn-top.show {
    transform: translateY(0);
    opacity: 1;
}

.fixed-save-btn-top button {
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, var(--success-color) 0%, #16a34a 100%);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.25);
}

.fixed-save-btn-top button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.35);
    background: linear-gradient(135deg, #16a34a 0%, var(--success-color) 100%);
}

.fixed-save-btn-top button:active {
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .fixed-save-btn-top {
        top: 15px;
        right: 15px;
    }
    
    .fixed-save-btn-top button {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Shortlink action buttons consistency */
.shortlink-item .btn-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-width: 1px;
}

.shortlink-item .btn-sm i {
    font-size: 14px;
    margin: 0;
}

/* Shortlink layout and URL truncation */
.shortlink-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: white;
}

.shortlink-item .d-flex {
    align-items: flex-start;
}

.shortlink-item > .d-flex > div:first-child {
    flex: 1;
    min-width: 0; /* This is crucial for text truncation to work */
    margin-right: 16px;
}

.shortlink-item > .d-flex > div:last-child {
    flex-shrink: 0; /* Prevents buttons from shrinking */
}

.shortlink-item .text-muted {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}

/* File action buttons consistency */
#filesList .btn-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-width: 1px;
}

#filesList .btn-sm i {
    font-size: 14px;
    margin: 0;
}

/* Desktop - ensure sidebar is visible and hamburger is hidden */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .sidebar {
        transform: translateX(0) !important;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1001;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    /* Move page titles to the right to avoid menu button */
    .main-content h2:first-child,
    .main-content h1:first-child {
        margin-left: 60px; /* Account for menu button width */
        margin-top: .35rem; /* Add space above title */
        margin-bottom: 0.25rem; /* Reduce space below title */
    }
    
    /* Also move subtitles that follow the page title */
    .main-content h2:first-child + p.text-muted,
    .main-content h1:first-child + p.text-muted {
        margin-left: 60px; /* Account for menu button width */
        margin-top: 0; /* Remove default top margin to bring closer to title */
    }
    
    /* Touch-friendly navigation links */
    .sidebar .nav-link {
        padding: 1.25rem 1.5rem;
        font-size: 1.1rem;
    }
    
    /* Responsive form elements */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem 1rem;
    }
    
    /* Responsive buttons */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Modal adjustments for mobile */
    .modal-dialog {
        margin: 1rem 0.5rem;
        max-width: none;
    }
    
    .modal-content {
        border-radius: 1rem;
    }
    
    /* Table responsive on mobile */
    .table-responsive {
        border: none;
    }
    
    /* Cards padding adjustment for mobile */
    .card {
        border-radius: 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
}

/* Mobile action menu styles */
.action-buttons {
    position: relative;
}

.desktop-action {
    display: inline-block;
}

.mobile-action-menu {
    display: none;
    position: relative;
}

.mobile-menu-trigger {
    padding: 0.25rem 0.5rem;
}

.mobile-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1000;
    min-width: 150px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    margin-top: 0.25rem;
}

[data-bs-theme="dark"] .mobile-menu-dropdown {
    background: #212529;
    border-color: #495057;
}

.mobile-menu-dropdown.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #dee2e6;
}

.dropdown-item:hover {
    color: #1e2125;
    background-color: #f8f9fa;
}

[data-bs-theme="dark"] .dropdown-item:hover {
    color: #fff;
    background-color: #495057;
}

.dropdown-item.text-danger {
    color: #dc3545 !important;
}

/* Mobile responsive styles for action menus */
@media (max-width: 768px) {
    .desktop-action {
        display: none !important;
    }
    
    .mobile-action-menu {
        display: inline-block;
    }
    
    /* Adjust spacing for mobile */
    .shortlink-item .d-flex,
    #filesList .d-flex {
        flex-wrap: wrap;
    }
    
    .shortlink-item h6,
    #filesList h6 {
        font-size: 0.9rem;
    }
    
    .shortlink-item p,
    #filesList small {
        font-size: 0.8rem;
    }
}