/* Custom styles beyond Tailwind */

/* Dark mode toggle functionality */
.dark-mode-toggle {
    transition: all 0.3s ease;
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(to right, #ff6b35, #f7931e, #ffd23f);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Dark mode gradient text */
.dark .gradient-text {
    background: linear-gradient(to right, #ff8a65, #ffb74d, #ffeb3b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Scroll styling for transcript */
#transcript-container::-webkit-scrollbar {
    width: 10px;
}

#transcript-container::-webkit-scrollbar-track {
    background: #fef3c7;
    border-radius: 8px;
}

.dark #transcript-container::-webkit-scrollbar-track {
    background: #451a03;
}

#transcript-container::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #ff6b35, #f7931e, #ffd23f);
    border-radius: 8px;
    border: 2px solid #fef3c7;
}

.dark #transcript-container::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #ff8a65, #ffb74d, #ffeb3b);
    border: 2px solid #451a03;
}

#transcript-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #ff5722, #ff9800, #ffc107);
}

.dark #transcript-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #ff7043, #ffcc02, #ffeb3b);
}

/* Glowing animation for objection suggestions */
.glow-animation {
    animation: glow 2s ease-in-out;
    border-color: #ff6b35;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 107, 53, 0.6), 0 0 35px rgba(247, 147, 30, 0.4);
    }
}

.dark .glow-animation {
    animation: darkGlow 2s ease-in-out;
    border-color: #ff8a65;
}

@keyframes darkGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 138, 101, 0.4);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 138, 101, 0.7), 0 0 35px rgba(255, 183, 77, 0.5);
    }
}

/* Recording indicator pulse */
.recording-pulse {
    position: relative;
}

.recording-pulse::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background-color: #e74c3c;
    border-radius: 50%;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.dark .recording-pulse::before {
    background-color: #ff6b6b;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.6);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    50% {
        opacity: 0.3;
        transform: translateY(-50%) scale(1.2);
    }
}

/* Checklist item spacing and delete button */
#checklist-items {
    padding-right: 8px;
}

.checklist-item {
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 4px 0;
    position: relative;
}

.checklist-item:hover {
    transform: translateX(6px);
    background-color: rgba(255, 107, 53, 0.1);
}

.dark .checklist-item:hover {
    background-color: rgba(255, 138, 101, 0.2);
}

.checklist-item.completed {
    text-decoration: line-through;
    opacity: 0.7;
    background-color: rgba(76, 175, 80, 0.1);
}

.dark .checklist-item.completed {
    background-color: rgba(76, 175, 80, 0.2);
}

/* Ensure delete button is always accessible */
.checklist-item button {
    flex-shrink: 0;
    z-index: 10;
}

/* Button hover effects */
.btn-hover-effect {
    transition: all 0.3s ease;
}

.btn-hover-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
}

.dark .btn-hover-effect:hover {
    box-shadow: 0 8px 25px rgba(255, 138, 101, 0.4);
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    /* Removed floating effect - cards stay in place */
}

.dark .card-hover:hover {
    /* Removed floating effect - cards stay in place */
}

/* Dark mode toggle animation */
.dark-mode-toggle i {
    transition: transform 0.5s ease;
}

.dark-mode-toggle:hover i {
    transform: rotate(180deg);
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator.ready {
    background-color: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.dark .status-indicator.ready {
    background-color: rgba(76, 175, 80, 0.2);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.status-indicator.error {
    background-color: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.dark .status-indicator.error {
    background-color: rgba(244, 67, 54, 0.2);
    color: #ef5350;
    border: 1px solid rgba(244, 67, 54, 0.4);
}

/* Responsive sidebar */
@media (max-width: 1024px) {
    #sidebar.show {
        display: block;
        position: fixed;
        top: 70px;
        left: 0;
        bottom: 0;
        z-index: 50;
        width: 280px;
        overflow-y: auto;
        backdrop-filter: blur(10px);
    }
    
    #checklist-sidebar.show {
        display: block;
        position: fixed;
        top: 70px;
        right: 0;
        bottom: 0;
        z-index: 50;
        width: 320px;
        overflow-y: auto;
        backdrop-filter: blur(10px);
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 40;
        backdrop-filter: blur(2px);
    }
}

/* Checklist sidebar specific styles */
#checklist-sidebar {
    height: calc(100vh - 120px);
    overflow-y: auto;
}

#checklist-sidebar .max-h-96 {
    max-height: calc(100vh - 280px);
}

/* Custom scrollbar for checklist sidebar */
#checklist-sidebar::-webkit-scrollbar {
    width: 8px;
}

#checklist-sidebar::-webkit-scrollbar-track {
    background: #fef3c7;
    border-radius: 8px;
}

.dark #checklist-sidebar::-webkit-scrollbar-track {
    background: #451a03;
}

#checklist-sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #ff6b35, #f7931e, #ffd23f);
    border-radius: 8px;
    border: 2px solid #fef3c7;
}

.dark #checklist-sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #ff8a65, #ffb74d, #ffeb3b);
    border: 2px solid #451a03;
}

#checklist-sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #ff5722, #ff9800, #ffc107);
}

.dark #checklist-sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #ff7043, #ffcc02, #ffeb3b);
}

/* Animation keyframes */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Custom focus styles */
.focus-ring:focus {
    outline: none;
    ring: 2px;
    ring-color: #ff6b35;
    ring-offset: 2px;
}

.dark .focus-ring:focus {
    ring-color: #ff8a65;
}

/* Loading spinner */
.loading-spinner {
    border: 3px solid rgba(255, 107, 53, 0.3);
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

.dark .loading-spinner {
    border: 3px solid rgba(255, 138, 101, 0.3);
    border-top: 3px solid #ff8a65;
}

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

@keyframes wave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.5); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Glass morphism effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Collapsible sidebar styles */
#sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    width: 256px;
    min-width: 256px;
    max-width: 256px;
    padding: 1rem;
}

#sidebar.collapsed {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    padding: 1rem 0.5rem;
}

#sidebar.collapsed .sidebar-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    transform: translateX(-10px);
}

#sidebar.collapsed .sidebar-title {
    justify-content: center;
}

#sidebar.collapsed .sidebar-title i {
    margin-right: 0;
}

#sidebar.collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

#sidebar.collapsed ul li a {
    justify-content: center;
    padding: 12px 8px;
    position: relative;
}

#sidebar.collapsed ul li a i {
    margin-right: 0;
    font-size: 1.2rem;
}

/* Sidebar text transitions */
.sidebar-text {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    opacity: 1;
    width: auto;
    transform: translateX(0);
}

/* Delayed text transitions for smoother animation */
#sidebar.collapsed .sidebar-text {
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
                transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
                width 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

#sidebar:not(.collapsed) .sidebar-text {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.05s,
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.05s,
                width 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.05s;
}

/* Collapse button transitions */
.sidebar-collapse-btn i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover effects for collapsed sidebar */
#sidebar.collapsed ul li a:hover {
    transform: scale(1.1);
}

#sidebar.collapsed ul li a:hover .sidebar-text {
    opacity: 1;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    margin-left: 8px;
    width: auto;
}

.dark #sidebar.collapsed ul li a:hover .sidebar-text {
    background: rgba(255, 255, 255, 0.9);
    color: black;
}

/* Main content adjustment when sidebar is collapsed */
#sidebar.collapsed + .flex-grow {
    margin-left: 0;
}

/* Ensure smooth transitions for all sidebar elements */
#sidebar * {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                margin 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main content transitions */
.flex-grow {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Improve collapsed sidebar appearance */
#sidebar.collapsed {
    border-radius: 0 1rem 1rem 0;
}

#sidebar.collapsed ul li a {
    border-radius: 0.5rem;
    margin: 0.25rem 0;
}

/* High specificity sidebar styles to override Tailwind */
body #sidebar {
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: visible !important;
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    padding: 0.75rem !important;
    position: relative !important;
    z-index: 1000 !important;
}

body #sidebar.collapsed {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    padding: 0.75rem !important;
}

/* Tooltip styles to ensure they appear on top */
.tooltip {
    position: absolute !important;
    z-index: 999999 !important;
    pointer-events: none !important;
}

/* Ensure sidebar allows tooltips to overflow */
#sidebar {
    overflow: visible !important;
}

/* Ensure parent containers don't clip tooltips */
.flex {
    overflow: visible !important;
}

/* Ensure main content area doesn't clip tooltips */
.flex.flex-col.lg\\:flex-row {
    overflow: visible !important;
}
