/* Custom CSS for Glassmorphism and Audio Tool */

/* Gazpacho Heavy Font - Original TTF Files */
@font-face {
    font-family: 'Gazpacho';
    src: url('../fonts/GazpachoHeavy.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gazpacho';
    src: url('../fonts/GazpachoBlack.ttf') format('truetype');
    font-weight: 1000;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gazpacho';
    src: url('../fonts/GazpachoBold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gazpacho';
    src: url('../fonts/GazpachoMedium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gazpacho';
    src: url('../fonts/GazpachoRegular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

.gazpacho-font {
    font-family: 'Gazpacho', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 900;
    letter-spacing: -0.01em;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enhanced Background with Natural Grain Noise Texture */
.bg-noise {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(120, 119, 255, 0.3) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='basenoise'%3E%3CfeTurbulence baseFrequency='0.8' numOctaves='4' type='fractalNoise' stitchTiles='stitch' seed='42'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23basenoise)' opacity='0.9'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='150' height='150' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='midnoise'%3E%3CfeTurbulence baseFrequency='1.2' numOctaves='3' type='turbulence' stitchTiles='stitch' seed='17'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23midnoise)' opacity='0.7'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='roughnoise'%3E%3CfeTurbulence baseFrequency='1.8' numOctaves='2' type='fractalNoise' stitchTiles='stitch' seed='73'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23roughnoise)' opacity='0.6'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='75' height='75' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='finenoise'%3E%3CfeTurbulence baseFrequency='2.4' numOctaves='2' type='turbulence' stitchTiles='stitch' seed='29'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23finenoise)' opacity='0.4'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='50' height='50' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='detailnoise'%3E%3CfeTurbulence baseFrequency='3.2' numOctaves='1' type='fractalNoise' stitchTiles='stitch' seed='91'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23detailnoise)' opacity='0.3'/%3E%3C/svg%3E");
}

/* Word break utility for long filenames */
.word-break-all {
    word-break: break-all;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Hide ugly number input arrows */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* Glassmorphism Checkbox Styles */
.glassmorphism-checkbox-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.glassmorphism-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.glassmorphism-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.glassmorphism-checkbox-label:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.glassmorphism-checkbox-indicator {
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    margin-right: 12px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.glassmorphism-checkbox:checked + .glassmorphism-checkbox-label {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(147, 51, 234, 0.2));
    border-color: rgba(236, 72, 153, 0.4);
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.2);
}

.glassmorphism-checkbox:checked + .glassmorphism-checkbox-label .glassmorphism-checkbox-indicator {
    background: linear-gradient(135deg, #ec4899, #9333ea);
    border-color: #ec4899;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.glassmorphism-checkbox:checked + .glassmorphism-checkbox-label .glassmorphism-checkbox-indicator::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.glassmorphism-checkbox:focus + .glassmorphism-checkbox-label {
    outline: none;
    ring: 2px;
    ring-color: rgba(255, 255, 255, 0.5);
    ring-offset: 2px;
}

/* Animation for checkbox selection */
@keyframes checkboxPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.glassmorphism-checkbox:checked + .glassmorphism-checkbox-label {
    animation: checkboxPulse 0.3s ease-out;
}

/* Custom Scrollbar for Client Container */
#bulk-clients-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.4) rgba(255, 255, 255, 0.1);
}

/* Webkit Scrollbar Styling */
#bulk-clients-container::-webkit-scrollbar {
    width: 8px;
}

#bulk-clients-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#bulk-clients-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

#bulk-clients-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

/* Transparent input fields with glassmorphism */
input[type="text"], 
input[type="number"], 
select, 
textarea {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

/* Specifically target bulk settings inputs */
#bulk_program_title,
#bulk_season,
#bulk_client,
#bulk_client_custom {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

input[type="text"]:focus,
input[type="number"]:focus, 
select:focus, 
textarea:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1) !important;
}

input[type="text"]::placeholder,
input[type="number"]::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Fixed layout for file items to prevent layout shifting */
.file-item {
    min-height: 120px !important;
    height: 120px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    position: relative !important;
}

/* Ensure progress bars don't cause layout shifts */
.upload-progress {
    margin-top: 8px;
    margin-bottom: 4px;
}

/* Glassmorphism Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Progress Steps */
.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.step-item.active {
    opacity: 1;
}

.step-item.completed {
    opacity: 1;
}

.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #374151;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.step-item.active .step-circle {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
    color: #60a5fa;
}

.step-item.completed .step-circle {
    background: rgba(34, 197, 94, 0.3);
    border-color: #22c55e;
    color: #4ade80;
}

.step-label {
    font-size: 0.875rem;
    color: #374151;
}

/* Drag over effect */
.drag-over {
    border-color: #60a5fa !important;
    background-color: rgba(59, 130, 246, 0.2) !important;
    transform: scale(1.02);
}
    font-weight: 500;
}

.step-connector {
    width: 60px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 16px;
    align-self: center;
    margin-bottom: 24px;
}

/* Analysis Cards */
.analysis-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.analysis-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px 0 rgba(31, 38, 135, 0.3);
}

.analysis-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    margin-right: 16px;
    flex-shrink: 0;
}

.analysis-content h4 {
    font-size: 0.875rem;
    color: white;
    font-weight: 600;
    margin-bottom: 4px;
}

.analysis-content p {
    font-size: 1.125rem;
    color: white;
    font-weight: 700;
}

/* Drop Zone Styles */
#drop-zone {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 2px dashed rgba(255, 255, 255, 0.3) !important;
    border-radius: 12px;
}

#drop-zone.drag-over {
    border-color: rgba(255, 255, 255, 0.6) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    transform: scale(1.02);
}

#drop-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

#drop-zone:hover::before {
    left: 100%;
}

/* Custom Checkbox Styles - Override Tailwind */
#bulk_one_time_series {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    width: 12px !important;
    height: 12px !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 4px !important;
    background: transparent !important;
    cursor: pointer !important;
    position: relative !important;
    margin-right: 8px !important;
}

#bulk_one_time_series:checked {
    background: rgba(236, 72, 153, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
}

#bulk_one_time_series:checked::after {
    content: '✓' !important;
    position: absolute !important;
    top: -2px !important;
    left: 2px !important;
    color: white !important;
    font-size: 12px !important;
    font-weight: bold !important;
}

/* Custom Select Styles */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select option {
    background: #1f2937;
    color: white;
}

/* Animation Delays */
.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* Button Hover Effects */
button {
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

/* Loading Animation */
@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.05);
    }
}

.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Responsive Adjustments */
/* Enhanced Mobile-first responsive design */
@media (max-width: 640px) {
    .glass-card {
        padding: 1rem !important;
        margin: 0.5rem !important;
    }
    
    input[type="text"], input[type="number"], select, textarea {
        padding: 1rem 0.75rem !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
        min-height: 48px;
    }
    
    button {
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
        min-height: 48px; /* Touch-friendly minimum */
    }
    
    .text-6xl { font-size: 2.5rem !important; }
    .text-5xl { font-size: 2rem !important; }
}

@media (max-width: 768px) {
    .step-item {
        margin: 0 8px;
    }
    
    .step-connector {
        width: 40px;
        margin: 0 8px;
    }
    
    .analysis-card {
        flex-direction: column;
        text-align: center;
    }
    
    .analysis-icon {
        margin-right: 0;
        margin-bottom: 12px;
    }
    
    /* Better spacing for tablets */
    .glass-card {
        padding: 1.5rem !important;
    }
}

/* Large screens optimization */
@media (min-width: 1024px) {
    .glass-card {
        padding: 2rem !important;
    }
}

/* Touch-friendly improvements */
.touch-friendly {
    min-height: 44px;
    min-width: 44px;
}

/* Better focus states for accessibility */
input:focus, button:focus, select:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Success Animation */
@keyframes success-bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

.success-bounce {
    animation: success-bounce 1s ease-in-out;
}

/* File Info Styles */
#file-info {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error Styles */
#error-container {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ec4899, #8b5cf6);
    border-radius: 3px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progress-shine 1.5s ease-in-out infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Toast Notifications - Glassmorphism Style */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    min-width: 300px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    color: white;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

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

.toast.success {
    border-left: 4px solid rgba(168, 85, 247, 0.8);
    background: rgba(168, 85, 247, 0.1);
}

.toast.error {
    border-left: 4px solid rgba(236, 72, 153, 0.8);
    background: rgba(236, 72, 153, 0.1);
}

.toast.info {
    border-left: 4px solid rgba(147, 51, 234, 0.8);
    background: rgba(147, 51, 234, 0.1);
}

/* Conversion Dialog Modal - Glassmorphism Style */
.conversion-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.conversion-modal-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    color: white;
    text-align: center;
}

.conversion-modal h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.conversion-modal p {
    font-size: 1rem;
    margin-bottom: 24px;
    line-height: 1.6;
    opacity: 0.9;
}

.conversion-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.conversion-modal button {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.conversion-modal .convert-yes {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: white;
}

.conversion-modal .convert-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.4);
}

.conversion-modal .convert-no {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.conversion-modal .convert-no:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Clear All Button Styling */
.clear-all-btn {
    background: linear-gradient(135deg, #ec4899, #8b5cf6) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.clear-all-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.4) !important;
}

.clear-all-btn i {
    color: white !important;
}
