/* Custom styles for Loud Log */

:root {
  /* Modern professional color palette */
  --primary: #6366f1;        /* Indigo - professional and trustworthy */
  --primary-dark: #4f46e5;   /* Darker indigo for hover states */
  --secondary: #f8fafc;      /* Clean light gray background */
  --accent: #0ea5e9;         /* Sky blue for accents */
  --success: #10b981;        /* Modern green */
  --warning: #f59e0b;        /* Amber warning */
  --error: #ef4444;          /* Red error */
  --dark: #1e293b;           /* Dark slate for cards */
  --dark-light: #334155;     /* Lighter dark for hover */
  --text-dark: #0f172a;      /* Almost black for headers */
  --text-body: #475569;      /* Slate gray for body text */
  --text-muted: #64748b;     /* Muted slate for secondary text */
  --border: #e2e8f0;         /* Light border color */
  --gradient: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

/* Sticky Header Styles */
.navbar {
  transition: all 0.3s ease;
  z-index: 1050;
  position: sticky;
  top: 0;
}

.navbar.sticky {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1) !important;
}

.navbar.sticky .navbar-nav.me-auto {
  display: none !important;
}

.navbar.sticky .sticky-cta {
  display: inline-flex !important;
  animation: slideInDown 0.5s ease;
}

.sticky-cta {
  display: none !important;
  background: var(--gradient);
  color: white !important;
  font-weight: 600;
  padding: 0.5rem 1.5rem;
  border-radius: 2rem;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.sticky-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  color: white !important;
}

/* Scroll Indicator Styles */
.scroll-indicator {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  background: var(--gradient);
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  z-index: 1040;
}

.scroll-indicator:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.scroll-indicator.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

/* Back Button Styles */
.back-button {
  position: fixed;
  left: 2rem;
  bottom: 2rem;
  background: var(--dark);
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(30, 41, 59, 0.3);
  z-index: 1040;
}

.back-button:hover {
  background: var(--dark-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 41, 59, 0.4);
}

.back-button.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

/* Animation Keyframes */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--secondary);
    color: var(--text-body);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

main {
    flex: 1;
}

/* Enhanced button styling */
.btn-primary {
    background: var(--gradient);
    border: none;
    color: white;
    font-weight: 600;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
    color: white;
}

.btn-secondary {
    background: var(--dark);
    border-color: var(--dark);
    color: white;
    font-weight: 500;
    border-radius: 0.5rem;
}

.btn-secondary:hover {
    background: var(--dark-light);
    border-color: var(--dark-light);
    color: white;
}

.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: white;
    font-weight: 500;
}

.btn-danger {
    background: var(--error);
    border-color: var(--error);
    color: white;
    font-weight: 500;
}

.btn-light {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-body);
    font-weight: 500;
}

.btn-light:hover {
    background: var(--secondary);
    border-color: var(--primary);
    color: var(--primary);
}

/* Pulse animation for recording indicator */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Noise level meter styling */
#meter {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--success);
    font-size: 1.25rem;
    text-shadow: 0 1px 2px rgba(16, 185, 129, 0.3);
}

/* Enhanced display elements */
.display-1 {
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Icon enhancements */
.bi {
    vertical-align: -0.125em;
}

/* Modal improvements */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

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

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

/* Chart container */
#noiseChart {
    max-height: 400px;
}

/* Print styles */
@media print {
    .btn-group,
    .modal,
    nav,
    footer {
        display: none !important;
    }
    
    /* Override dark theme for print */
    .card.bg-secondary {
        background: white !important;
        color: black !important;
        border: 1px solid #000 !important;
    }
    
    .card {
        border: 1px solid #000 !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .display-1 {
        font-size: 3rem;
    }
}

/* Loading states */
.btn:disabled {
    cursor: not-allowed;
}

/* Enhanced alert styling */
.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    font-weight: 500;
}

.alert-info {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(14, 165, 233, 0.1));
    color: var(--primary);
    border-left: 4px solid var(--primary);
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(34, 197, 94, 0.1));
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.1));
    color: var(--warning);
    border-left: 4px solid var(--warning);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(248, 113, 113, 0.1));
    color: var(--error);
    border-left: 4px solid var(--error);
}

/* Enhanced card styling */
.card {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    background: white;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    border-radius: 0.75rem 0.75rem 0 0 !important;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.card-header.bg-primary {
    background: var(--gradient) !important;
    border: none !important;
    color: white;
}

/* Statistics cards */
.card.bg-secondary {
    background: var(--dark) !important;
    border: none;
    color: white;
}

.card.bg-secondary h3,
.card.bg-secondary h5 {
    color: white;
}

/* Enhanced form styling */
.form-control {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
    outline: none;
}

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

/* Enhanced navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-brand i {
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-dark {
    background: var(--dark) !important;
    border-bottom: 1px solid var(--dark-light);
}

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

/* Card header with primary color */
.card-header.bg-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Badge colors */
.badge.bg-success {
    background: var(--success) !important;
}

/* Error styling */
.alert-danger {
    border-left-color: var(--error);
    background-color: rgba(231, 76, 60, 0.1);
}

.alert-warning {
    border-left-color: var(--warning);
    background-color: rgba(243, 156, 18, 0.1);
}

/* Permission info styling */
.alert-info strong {
    color: var(--text-dark);
}

/* Enhanced list group items */
.list-group-numbered .list-group-item {
    border-color: rgba(0, 191, 165, 0.2);
}

.list-group-numbered .list-group-item strong {
    color: var(--primary);
}
