/* General Body Styles */
body.secure-content {
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10+ */
    user-select: none; /* Standard syntax */
}
body {
    font-family: 'Hind Siliguri', sans-serif;
    background-color: #faf9fb;
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}
html.dark body {
     background-color: #111827;
}

/* Main Content Styles */
.main-container {
    max-width: 1300px;
    margin: 0 auto;
}
.bio-sidebar {
    background-color: #522b79;
    color: white;
    padding: 20px 15px 30px;
    border-radius: 4px;
    transition: background-color 0.3s ease-in-out;
}
.dark .bio-sidebar {
    background-color: #261a3b;
}
.bio-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-top: 1px solid #8a8a8a;
    border-bottom: 1px solid #8a8a8a;
    transition: border-color 0.3s ease-in-out;
}
.dark .bio-item {
    border-color: #5a4e6e;
}
.bio-item label, .bio-item p {
    flex: 0 0 50%;
    max-width: 50%;
    text-align: center;
    margin: 0;
    padding: 5px 0;
    font-size: 0.875rem;
}
.bio-item label {
    font-weight: 700;
}
.bio-item p {
    border-left: 1px solid #8a8a8a;
    transition: border-color 0.3s ease-in-out;
}
.dark .bio-item p {
    border-color: #5a4e6e;
}
.bio-card {
    border: 1px solid #d5d5d5;
    margin-bottom: 30px;
    box-shadow: 0 -2px 1px #522b79;
    border-radius: 5px;
    background: #fff;
    transition: background-color 0.3s ease-in-out, border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}
.dark .bio-card {
    background-color: #1f2937;
    border-color: #374151;
    box-shadow: 0 -2px 1px #8b5cf6;
}
.bio-card h3 {
    text-align: center;
    color: #522b79;
    padding: 20px 0;
    font-weight: 700;
    font-size: 1.25rem;
    transition: color 0.3s ease-in-out;
}
.dark .bio-card h3 {
    color: #c4b5fd;
}
.card-item {
    display: flex;
    justify-content: space-between;
    box-shadow: 0px -0.6px 0px #d5d5d5;
    flex-wrap: wrap;
    transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}
.dark .card-item {
    box-shadow: 0px -0.6px 0px #374151;
}
.card-item:nth-child(odd) {
     background: rgba(245,246,252,.4);
}
.dark .card-item:nth-child(odd) {
     background: rgba(55, 65, 81, 0.3);
}
.card-item label {
    max-width: 50%;
    flex: 0 0 50%;
    border-right: .6px solid #d5d5d5;
    padding: 8px 15px;
    font-weight: 700;
    color: #4a5568;
    font-size: 0.875rem;
    transition: color 0.3s ease-in-out, border-color 0.3s ease-in-out;
}
.dark .card-item label {
    color: #d1d5db;
    border-color: #374151;
}
.card-item p {
    padding: 8px 15px;
    max-width: 50%;
    flex: 0 0 50%;
    word-wrap: break-word;
    color: #2d3748;
    font-size: 0.875rem;
    transition: color 0.3s ease-in-out;
}
.dark .card-item p {
    color: #f3f4f6;
}
.card-item.full-width p {
    white-space: pre-line;
}
.card-item.full-width label {
    max-width: 100%;
    flex: 0 0 100%;
    border-right: 0;
    border-bottom: .6px solid #d5d5d5;
}
.dark .card-item.full-width label {
    border-color: #374151;
}
.card-item.full-width p {
    max-width: 100%;
    flex: 0 0 100%;
}

/* Theme Toggle Styles */
.toggle-container {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 0.5rem;
}
.theme-switch-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 85px;
    height: 44px;
    background: #e5e7eb;
    border-radius: 22px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.dark .theme-switch-wrapper {
    background: #1f2937;
}
.slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    z-index: 10;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dark .slider {
    transform: translateX(41px);
    background: #374151;
}
.switch-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 10px;
}
.day-text {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
    margin-left: 34px;
    margin-top: 2px;
}
.night-text {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
    position: relative;
    left: -65px;
    margin-top: 3px;
}
.day-text { color: #374151; transition: opacity 0.2s ease; }
.night-text { color: #d1d5db; transition: opacity 0.2s ease; }
.dark .day-text { opacity: 0; }
html:not(.dark) .night-text { opacity: 0; }
.sun-icon { color: #f59e0b; }
.moon-icon { color: #8b5cf6; }
.slider svg {
    transition: opacity 0.2s ease, transform 0.3s ease;
}
html:not(.dark) .moon-icon, .dark .sun-icon { opacity: 0; transform: rotate(90deg); }
html:not(.dark) .sun-icon, .dark .moon-icon { opacity: 1; transform: rotate(0deg); }
.moon-icon { position: absolute; }

/* Lock Screen Styles */
#lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #faf9fb;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}
.dark #lock-screen {
    background-color: #111827;
}
.lock-container {
    text-align: center;
    padding: 2rem;
}
.lock-container > * {
    animation: fadeIn 0.8s ease-in-out both;
}
.lock-container h2 { animation-delay: 0.2s; }
.password-wrapper { animation-delay: 0.4s; }
#unlock-button { animation-delay: 0.6s; }
.lock-container h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #522b79;
    margin-bottom: 1.5rem;
}
.dark .lock-container h2 {
    color: #c4b5fd;
}
.dark #password-input {
    background-color: #1f2937;
    border-color: #374151;
    color: #f3f4f6;
}
#unlock-button {
    background-color: #522b79;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.dark #unlock-button {
    background-color: #8b5cf6;
}
#unlock-button:hover {
    background-color: #412260;
}
.dark #unlock-button:hover {
    background-color: #7c3aed;
}
#error-message {
    color: #ef4444;
    margin-top: 1rem;
    height: 1.25rem;
}
#lock-screen .toggle-container {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-slide-up {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s ease-out forwards;
}
@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button Loading Animation */
#analyze-button {
    position: relative;
    overflow: hidden;
}
#analyze-button.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: swipe 1.5s infinite ease-in-out;
}
@keyframes swipe {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}


/* Responsive Styles */
@media (max-width: 1023px) {
    .bio-sidebar {
        margin: 0 auto 15px;
        max-width: 470px;
    }
}
@media (max-width: 767px) {
     .card-item label, .card-item p {
         max-width: 50%;
         flex: 0 0 50%;
     }
     .card-item label {
         border-right: .6px solid #d5d5d5;
         border-bottom: 0;
     }
     .card-item p {
        padding-top: 8px;
     }
     .dark .card-item label {
         border-color: #374151;
     }
     .card-item.full-width label {
        max-width: 100%;
        flex: 0 0 100%;
        border-right: 0;
        border-bottom: .6px solid #d5d5d5;
     }
     .card-item.full-width p {
        max-width: 100%;
        flex: 0 0 100%;
     }
}

/* Custom Audio Player Styles */
.custom-player {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #f3f4f6;
  border-radius: 9999px;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  transition: background-color 0.3s, border-color 0.3s;
  /* CHANGE: Added margin for spacing */
  margin-bottom: 1rem;
}

.dark .custom-player {
  background-color: #374151;
  border-color: #4b5563;
}

.play-pause-btn {
  background-color: #522b79;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.3s;
}

.dark .play-pause-btn {
  background-color: #8b5cf6;
}

.play-pause-btn:hover {
  background-color: #412260;
}
.dark .play-pause-btn:hover {
  background-color: #7c3aed;
}

.play-pause-btn svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.timeline {
  flex-grow: 1;
  background-color: #d1d5db;
  height: 6px;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.dark .timeline {
  background-color: #1f2937;
}

.progress {
  background-color: #522b79;
  width: 0%;
  height: 100%;
  border-radius: 3px;
  transition: background-color 0.3s;
  /* CHANGE: Added for thumb positioning */
  position: relative;
}

.dark .progress {
  background-color: #8b5cf6;
}

/* CHANGE: Added timeline thumb */
.thumb {
    width: 14px;
    height: 14px;
    background-color: #522b79;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    right: -7px; /* Half of its width to center it on the edge */
    transform: translateY(-50%);
    transition: background-color 0.3s;
}

.dark .thumb {
    background-color: #8b5cf6;
}

.time-display {
  font-size: 0.875rem;
  color: #4b5563;
  font-family: monospace;
  transition: color 0.3s;
}

.dark .time-display {
  color: #d1d5db;
}

/* CHANGE: Added loading state animation */
.loading-state {
  text-align: center;
  color: #9ca3af;
  padding: 1rem;
  animation: breathe 1.5s ease-in-out infinite;
}

.dark .loading-state {
  color: #6b7280;
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
