* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.hidden {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0f0f1a;
    min-height: 100vh;
    color: #fff;
}

.landing-container {
    max-width: 100%;
}

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.hero-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
    border-radius: 50%;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
}

.hero-tagline {
    font-size: 1.5rem;
    color: #e0e0e8;
    margin-bottom: 12px;
    font-weight: 500;
}

.hero-subtagline {
    font-size: 1rem;
    color: #a0a0b0;
    margin-bottom: 48px;
    font-weight: 400;
}

.upload-box {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 24px;
}

.upload-area {
    border: 2px dashed #5c5c7a;
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.upload-area:hover, .upload-area.dragover {
    border-color: #7c7cff;
    background: rgba(124, 124, 255, 0.05);
}

.upload-main {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 8px;
    font-weight: 500;
}

.upload-sub {
    font-size: 0.95rem;
    color: #6c6c8a;
}

.file-name {
    text-align: center;
    margin-top: 16px;
    color: #7c7cff;
    font-weight: 500;
}

.analyze-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.3s ease;
}

.analyze-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.analyze-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pricing-line {
    font-size: 0.9rem;
    color: #6c6c8a;
    margin-bottom: 32px;
}

.pricing-line .dot {
    margin: 0 8px;
    color: #4c4c6a;
}

.other-sources {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.other-label {
    font-size: 0.85rem;
    color: #5c5c7a;
}

.source-btn {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid #4c4c6a;
    border-radius: 20px;
    color: #8c8ca0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.source-btn:hover {
    border-color: #7c7cff;
    color: #7c7cff;
}

.benefits {
    padding: 80px 24px;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.benefits-intro {
    font-size: 1.2rem;
    color: #c0c0d0;
    line-height: 1.7;
    margin-bottom: 48px;
}

.benefit-list {
    text-align: left;
    max-width: 400px;
    margin: 0 auto 48px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    font-size: 1.05rem;
    color: #a0a0b0;
}

.benefit-arrow {
    color: #7c7cff;
    font-size: 1.2rem;
    font-weight: 600;
}

.saved-link {
    background: transparent;
    border: none;
    color: #6c6c8a;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 8px 16px;
}

.saved-link:hover {
    color: #9c9cb0;
}

.auth-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(15, 15, 26, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.auth-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.usage-display {
    font-size: 0.85rem;
    color: #7c7cff;
    padding: 6px 12px;
    background: rgba(124, 124, 255, 0.1);
    border-radius: 16px;
}

.auth-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

#user-name {
    color: #a8b2d1;
    font-size: 0.9rem;
}

.logout-btn, .login-btn {
    font-size: 0.85rem;
    color: #8892b0;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: color 0.2s;
}

.logout-btn:hover, .login-btn:hover {
    color: #fff;
}

.feedback-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #4c4c6a;
    border-radius: 6px;
    color: #8892b0;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-btn:hover {
    border-color: #7c7cff;
    color: #7c7cff;
}

.input-section {
    max-width: 500px;
    margin: 0 auto;
    padding: 100px 20px 40px;
}

.back-btn {
    background: transparent;
    border: none;
    color: #7c7cff;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 24px;
    padding: 8px 0;
}

.back-btn:hover {
    text-decoration: underline;
}

.youtube-input {
    text-align: center;
    padding: 40px 24px;
    background: rgba(255, 0, 0, 0.03);
    border: 1px solid rgba(255, 100, 100, 0.2);
    border-radius: 16px;
}

.youtube-icon {
    font-size: 2.5rem;
    color: #ff4444;
    margin-bottom: 16px;
}

.youtube-input p {
    color: #a0a0b0;
    margin-bottom: 16px;
}

.youtube-input .hint {
    margin-top: 16px;
    font-size: 0.85rem;
    color: #6c6c8a;
}

.url-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    margin-bottom: 8px;
}

.url-input::placeholder {
    color: #6c6c8a;
}

.url-input:focus {
    outline: none;
    border-color: #ff4444;
}

.spotify-status {
    text-align: center;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.spotify-connected {
    background: rgba(29, 185, 84, 0.1);
    color: #1DB954;
}

.spotify-disconnected {
    background: rgba(255, 100, 100, 0.1);
    color: #ff6464;
}

.search-container {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.search-container input {
    flex: 1;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
}

.search-container input::placeholder {
    color: #6c6c8a;
}

.search-container input:focus {
    outline: none;
    border-color: #1DB954;
}

.search-btn {
    padding: 14px 24px;
    background: #1DB954;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.search-btn:hover {
    background: #1ed760;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.track-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.track-item:hover {
    background: rgba(29, 185, 84, 0.1);
    border-color: rgba(29, 185, 84, 0.3);
}

.track-image {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    background: #2a2a3a;
}

.track-info {
    flex: 1;
    overflow: hidden;
}

.track-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.track-artist {
    font-size: 0.85rem;
    color: #8892b0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-list {
    max-width: 500px;
    margin: 0 auto;
    padding: 100px 20px 40px;
}

.saved-list h3 {
    margin-bottom: 20px;
    color: #fff;
}

.saved-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.saved-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.saved-item-info {
    cursor: pointer;
    flex: 1;
}

.saved-item-title {
    font-weight: 600;
    color: #fff;
}

.saved-item-meta {
    font-size: 0.85rem;
    color: #6c6c8a;
    margin-top: 4px;
}

.saved-item-actions {
    display: flex;
    gap: 8px;
}

.delete-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 6px;
    color: #ff6464;
    font-size: 0.8rem;
    cursor: pointer;
}

.delete-btn:hover {
    background: rgba(255, 100, 100, 0.1);
}

.loading {
    text-align: center;
    padding: 80px 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(124, 124, 255, 0.2);
    border-top-color: #7c7cff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.results {
    max-width: 600px;
    margin: 0 auto;
    padding: 100px 20px 40px;
}

.results-top-bar {
    margin-bottom: 16px;
}

.new-analysis-btn {
    background: transparent;
    border: 1px solid #4c4c6a;
    color: #a0a0b0;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.new-analysis-btn:hover {
    border-color: #7c7cff;
    color: #7c7cff;
    background: rgba(124, 124, 255, 0.05);
}

.song-title {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 20px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
}

.bpm-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bpm-label {
    font-size: 0.8rem;
    color: #6c6c8a;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bpm-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    color: #8892b0;
    font-size: 0.9rem;
}

.actions {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #a0a0b0;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
}

.action-btn.primary:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.share-section {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(124, 124, 255, 0.05);
    border-radius: 10px;
}

.share-label {
    font-size: 0.85rem;
    color: #6c6c8a;
    margin-bottom: 8px;
}

.share-url-container {
    display: flex;
    gap: 8px;
}

.share-url {
    flex: 1;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
}

.copy-share-btn {
    padding: 10px 16px;
    background: #7c7cff;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    cursor: pointer;
}

.copy-share-btn:hover {
    background: #6c6cef;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    color: #8892b0;
}

.legend-title {
    font-weight: 600;
    color: #a0a0b0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-divider {
    color: #4c4c6a;
}

.beat-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #7c7cff;
}

.beat-circle.strong {
    width: 16px;
    height: 16px;
    box-shadow: 0 0 8px rgba(124, 124, 255, 0.5);
}

.beat-circle.soft {
    width: 10px;
    height: 10px;
    opacity: 0.5;
}

.legend-icon {
    font-size: 1rem;
}

.audio-player-section {
    background: rgba(15, 15, 26, 0.98);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(124, 124, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.play-pause-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.play-pause-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.play-icon {
    color: white;
    font-size: 16px;
    margin-left: 2px;
}

.audio-progress-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.audio-progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.audio-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.1s;
}

.audio-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6c6c8a;
}

.spotify-note {
    text-align: center;
    font-size: 0.85rem;
    color: #1DB954;
    margin-top: 10px;
    margin-bottom: 0;
}

.lyrics-section {
    margin-bottom: 24px;
}

.lyrics-header {
    font-size: 1rem;
    color: #a0a0b0;
    margin-bottom: 12px;
}

.lyrics-search {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.lyrics-input {
    flex: 1;
    min-width: 120px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
}

.lyrics-input::placeholder {
    color: #6c6c8a;
}

.lyrics-content {
    font-size: 0.9rem;
    color: #8892b0;
    line-height: 1.6;
}

.lyrics-success {
    color: #1DB954;
    padding: 12px;
    background: rgba(29, 185, 84, 0.1);
    border-radius: 8px;
}

.lyrics-offset-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.lyrics-offset-controls .offset-label {
    font-size: 0.75rem;
    color: #a0a0b0;
    margin-right: 4px;
}

.offset-btn {
    padding: 4px 8px;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.offset-btn:hover {
    background: rgba(124, 124, 255, 0.3);
    border-color: #7c7cff;
}

.offset-display {
    font-size: 0.8rem;
    font-weight: 600;
    color: #7c7cff;
    min-width: 24px;
    text-align: center;
}

.lyrics-line {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    margin-bottom: 4px;
}

.group-lyrics {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border-left: 3px solid rgba(124, 124, 255, 0.3);
}

.group-lyrics .lyric-line {
    display: block;
    padding: 4px 8px;
    margin: 4px 0;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #8892b0;
    transition: all 0.2s ease;
}

.group-lyrics .lyric-line.active {
    background: rgba(124, 124, 255, 0.2);
    color: #fff;
    font-weight: 500;
    box-shadow: 0 0 10px rgba(124, 124, 255, 0.3);
}

.eight-counts-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.eight-count-group {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

.eight-count-group.active {
    background: rgba(124, 124, 255, 0.1);
    border-color: #7c7cff;
    box-shadow: 0 0 20px rgba(124, 124, 255, 0.2);
}

.group-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.group-number {
    font-weight: 600;
    color: #fff;
}

.group-time {
    color: #6c6c8a;
}

.beats-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.beat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 4px;
}

.beat-count {
    font-size: 0.75rem;
    color: #6c6c8a;
}

.beat-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #7c7cff;
    transition: all 0.2s;
}

.beat.strong .beat-indicator {
    width: 26px;
    height: 26px;
    box-shadow: 0 0 12px rgba(124, 124, 255, 0.6);
}

.beat.soft .beat-indicator {
    width: 14px;
    height: 14px;
    opacity: 0.5;
}

.moment-icons {
    display: flex;
    gap: 2px;
    font-size: 0.7rem;
}

.movement-note-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    margin-top: 12px;
    font-family: inherit;
}

.movement-note-input::placeholder {
    color: #5c5c7a;
}

.movement-note-input:focus {
    outline: none;
    border-color: #7c7cff;
    background: rgba(124, 124, 255, 0.05);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: #1a1a2e;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.modal-content h2 {
    margin-bottom: 12px;
    color: #fff;
}

.modal-content p {
    color: #8892b0;
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pay-btn {
    display: block;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}

.pay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.feedback-textarea {
    width: 100%;
    min-height: 120px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 20px;
    font-family: inherit;
}

.feedback-textarea::placeholder {
    color: #6c6c8a;
}

.feedback-textarea:focus {
    outline: none;
    border-color: #7c7cff;
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-tagline {
        font-size: 1.2rem;
    }
    
    .hero-subtagline {
        font-size: 0.9rem;
    }
    
    .upload-area {
        padding: 32px 16px;
    }
    
    .beats-grid {
        gap: 4px;
    }
    
    .beat-indicator {
        width: 16px;
        height: 16px;
    }
    
    .beat.strong .beat-indicator {
        width: 22px;
        height: 22px;
    }
    
    .beat.soft .beat-indicator {
        width: 12px;
        height: 12px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .action-btn {
        min-width: 100%;
    }
    
    .auth-bar {
        padding: 10px 12px;
    }
    
    .feedback-btn {
        display: none;
    }
}
