/* Enhanced Smart Radio Recorder Styling */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Enhanced focus states */
input:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Button hover effects */
button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Enhanced button styles for permission states */
.permission-required {
    position: relative;
    overflow: hidden;
}

.permission-required::before {
    content: '🔒';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.75rem;
    opacity: 0.7;
    z-index: 10;
}

.permission-granted {
    position: relative;
    overflow: hidden;
}

.permission-granted::before {
    content: '✅';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.75rem;
    opacity: 0.8;
    z-index: 10;
}

/* Volume slider styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    background: #e2e8f0;
    height: 8px;
    border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

input[type="range"]::-moz-range-track {
    background: #e2e8f0;
    height: 8px;
    border-radius: 4px;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Connection status animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes ping {
    75%, 100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Enhanced status indicators */
.status-dot {
    position: relative;
}

.status-dot.connected::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.3;
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* VU Meter styling */
.vu-meter-bar {
    transition: background-color 0.1s ease-out;
    border-radius: 2px;
}

/* Recording button styles */
.recording-button {
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.5);
    position: relative;
}

.recording-button.active {
    animation: pulse 1s infinite;
    box-shadow: 0 0 30px rgba(220, 38, 38, 0.8);
}

.recording-button.active::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid rgba(220, 38, 38, 0.5);
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Card shadows and depth */
.card-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Audio player styling */
audio {
    height: 40px;
    border-radius: 8px;
    outline: none;
    background: #f8fafc;
}

audio::-webkit-media-controls-panel {
    background-color: #f8fafc;
    border-radius: 8px;
}

/* Enhanced category styling */
.category-border {
    border-left: 4px solid;
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.category-border.radio {
    border-color: #3b82f6;
}

.category-border.mic {
    border-color: #10b981;
}

.category-border.mixed {
    border-color: #8b5cf6;
}

/* Recording format badge styling */
.format-badge {
    background: linear-gradient(45deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

/* Permission flow styling */
.permission-flow {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px dashed #0ea5e9;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.permission-flow:hover {
    border-color: #0284c7;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
}

.permission-flow.granted {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #22c55e;
}

.permission-flow.denied {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    border-color: #f59e0b;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .text-4xl {
        font-size: 2rem;
    }
    
    /* Adjust recording button for mobile */
    .recording-button {
        width: 4rem;
        height: 4rem;
        font-size: 1.5rem;
    }
    
    /* Stack audio controls vertically on mobile */
    .player-controls {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .flex-col.md\\:flex-row {
        flex-direction: column;
    }
    
    .space-x-6 > * + * {
        margin-left: 0;
        margin-top: 1rem;
    }
    
    .w-32 {
        width: 6rem;
    }
    
    /* Simplify source buttons on small screens */
    .source-button {
        padding: 0.75rem 0.5rem;
    }
    
    .source-button .icon {
        font-size: 1rem;
    }
    
    .source-button .label {
        font-size: 0.75rem;
    }
}

/* Typography improvements */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

/* Enhanced button states */
button {
    transition: all 0.2s ease-in-out;
}

button:active:not(:disabled) {
    transform: translateY(0);
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success states */
.success-pulse {
    animation: pulse 0.5s ease-in-out 3;
}

/* Radio-first design enhancements */
.radio-ready {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #3b82f6;
}

.radio-ready::before {
    content: '📻';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1rem;
    animation: pulse 2s infinite;
}

/* Native format indicators */
.native-format {
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.native-format::before {
    content: '⚡';
    font-size: 0.875rem;
}

/* Enhanced shadows for modern look */
.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Accessibility improvements */
button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

input:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-blue-50 {
        background-color: #ffffff;
        border: 2px solid #000000;
    }
    
    .text-gray-600 {
        color: #000000;
    }
    
    .border-gray-200 {
        border-color: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .animate-pulse,
    .animate-spin,
    button:hover,
    .recording-button.active {
        animation: none;
    }
    
    button:hover {
        transform: none;
    }
}