/* SingMyLink.com - Mobile-first styles */

:root {
    --primary: #ff69b4;
    --primary-dark: #ff1493;
    --bg: #0a0a0a;
    --bg-card: #1a1a1a;
    --text: #ffffff;
    --text-muted: #888888;
    --success: #10b981;
    --error: #ef4444;
    --border: #333333;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

/* Desktop adjustments */
@media (min-width: 768px) {
    .container {
        max-width: 700px;
        padding: 2rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 1.125rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="url"],
    textarea {
        font-size: 1.125rem;
        padding: 1.25rem;
    }

    .btn-large {
        font-size: 1.25rem;
        padding: 1.5rem 2.5rem;
    }

    .btn-primary {
        font-size: 1.125rem;
        padding: 1.25rem 2rem;
    }

    .btn-secondary {
        font-size: 1.125rem;
        padding: 1.25rem 2rem;
    }

    .style-chip span {
        padding: 1rem 1.5rem;
        font-size: 1.125rem;
    }

    .form-group label {
        font-size: 1rem;
    }

    /* Setup page desktop */
    .setup-page {
        max-width: 600px;
    }

    .setup-page h1 {
        font-size: 2rem;
    }

    .username-input input {
        font-size: 1.125rem;
        padding: 1.25rem;
        padding-left: 0;
    }

    .username-prefix {
        font-size: 1rem;
        padding: 1.25rem;
    }

    .link-row input {
        font-size: 1rem;
        padding: 1rem;
    }

    .profile-pic-preview {
        width: 100px;
        height: 100px;
    }

    .toggle-row {
        padding: 1.25rem;
    }
}

/* Header */
header {
    text-align: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

/* Main content */
main {
    flex: 1;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Hero section */
.hero {
    text-align: center;
    padding: 1.5rem 0;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.tagline {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Forms */
.song-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.hidden {
    display: none !important;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
}

textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 200px;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.char-count {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Style chips */
.style-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.style-chip {
    cursor: pointer;
}

.style-chip input {
    display: none;
}

.style-chip span {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: capitalize;
    transition: all 0.2s;
}

.style-chip input:checked + span {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}

.style-chip:hover span {
    border-color: var(--primary);
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-large {
    padding: 1.25rem 2rem;
    min-height: 56px;
}

.btn-secondary {
    display: inline-block;
    padding: 1rem 2rem;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--primary);
    color: #000;
}

.link-secondary {
    display: block;
    text-align: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    margin-top: 1rem;
}

.link-secondary:hover {
    color: var(--primary);
}

.price-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.login-link {
    text-align: center;
    margin-top: 2rem;
    padding-bottom: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.login-link a {
    color: var(--pink);
}

/* Generating page */
.generating-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1.5rem;
}

.generating-page h1 {
    font-size: 1.5rem;
}

.status-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.progress-container {
    width: 100%;
    max-width: 300px;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.progress-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.tips {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.tip-small {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Preview page */
.preview-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    padding: 1rem 0;
}

.preview-page h1 {
    font-size: 1.75rem;
}

.audio-player {
    width: 100%;
}

.audio-player audio {
    width: 100%;
    height: 48px;
}

.preview-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.countdown-container {
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.countdown-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.countdown-time {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.countdown-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.btn-buy {
    width: 100%;
}

.features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.feature {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Success page */
.success-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1.5rem;
}

.success-page h1 {
    font-size: 2rem;
}

.success-icon {
    background: var(--success);
    border-radius: 50%;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    color: #fff;
}

.btn-download {
    width: 100%;
    max-width: 300px;
}

.downloads-left {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.success-tips {
    text-align: left;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 12px;
    width: 100%;
    max-width: 300px;
}

.success-tips h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.success-tips ul {
    list-style: none;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.success-tips li::before {
    content: '\2713';
    color: var(--success);
    margin-right: 0.5rem;
}

/* Audio player customization */
audio::-webkit-media-controls-panel {
    background: var(--bg-card);
}

/* Input fields */
input[type="text"],
input[type="email"],
input[type="url"] {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus {
    outline: none;
    border-color: var(--primary);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="url"]::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Social login buttons */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.social-login-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.social-login-divider::before,
.social-login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-social:hover {
    border-color: var(--primary);
    background: var(--bg);
}

.btn-social svg {
    width: 20px;
    height: 20px;
}

.btn-social.google {
    border-color: #4285f4;
}

.btn-social.google:hover {
    background: rgba(66, 133, 244, 0.1);
}

.btn-social.patreon {
    border-color: #ff424d;
}

.btn-social.patreon:hover {
    background: rgba(255, 66, 77, 0.1);
}

.btn-social.twitter {
    border-color: #1da1f2;
}

.btn-social.twitter:hover {
    background: rgba(29, 161, 242, 0.1);
}

/* Optional label */
.optional {
    font-weight: 400;
    opacity: 0.6;
}

/* Edit hint */
.edit-hint {
    font-weight: 400;
    opacity: 0.6;
    font-size: 0.75rem;
}

/* Step indicator */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}

.step {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background: var(--bg-card);
}

.step.active {
    color: #000;
    background: var(--primary);
    font-weight: 600;
}

.step.done {
    color: var(--success);
    background: transparent;
    border: 1px solid var(--success);
}

/* Lyrics actions */
.lyrics-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

/* Text button */
.btn-text {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
}

.btn-text:hover {
    color: var(--primary);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    z-index: 1000;
}

.loading-overlay p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Setup page */
.setup-page {
    max-width: 500px;
    margin: 0 auto;
    padding: 1rem 0;
}

.success-badge {
    display: inline-block;
    background: var(--success);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.setup-page h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.setup-intro {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.setup-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.username-input {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: text;
}

.username-input:focus-within {
    border-color: var(--primary);
}

.username-prefix {
    padding: 1rem;
    padding-right: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    white-space: nowrap;
    background: var(--bg);
    border-right: 1px solid var(--border);
}

.username-input input {
    flex: 1;
    border: none;
    background: var(--bg-card);
    padding: 1rem;
    padding-left: 0.75rem;
    border-radius: 0;
    color: var(--text);
    font-size: 1rem;
}

.username-input input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.username-input input:focus {
    outline: none;
}

.username-status {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    min-height: 1rem;
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 0.25rem;
}

.username-status.checking {
    color: var(--text-muted);
}

.username-status.available {
    color: var(--success);
}

.username-status.taken {
    color: var(--error);
}

.link-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.link-title {
    flex: 1;
    max-width: 120px;
}

.link-url {
    flex: 2;
}

.link-row input {
    padding: 0.75rem;
    font-size: 0.875rem;
}

.btn-remove {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.25rem;
}

.btn-remove:hover {
    border-color: var(--error);
    color: var(--error);
}

/* Profile picture upload */
.profile-pic-upload {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-pic-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-pic-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-pic-placeholder {
    font-size: 2rem;
    color: var(--text-muted);
}

/* Cropper modal */
.cropper-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cropper-modal.hidden {
    display: none !important;
}

.cropper-container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
}

.cropper-container h3 {
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text);
}

.cropper-wrapper {
    width: 100%;
    height: 300px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.cropper-wrapper img {
    display: block;
    max-width: 100%;
}

.cropper-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    gap: 1rem;
}

.cropper-actions .btn-text {
    flex: 1;
    padding: 0.875rem;
}

.cropper-actions .btn-primary {
    flex: 1;
    padding: 0.875rem;
}

/* Cropper.js overrides for dark theme */
.cropper-view-box,
.cropper-face {
    border-radius: 50%;
}

.cropper-view-box {
    outline: 2px solid var(--primary);
    outline-color: var(--primary);
}

.cropper-line {
    background-color: var(--primary);
}

.cropper-point {
    background-color: var(--primary);
}

.cropper-modal-overlay {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Sensitive content toggle */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
}

.toggle-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toggle-label span:first-child {
    font-weight: 600;
}

.toggle-label span:last-child {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border);
    border-radius: 28px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Login page */
.login-page {
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem 0;
    text-align: center;
}

.login-page h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-intro {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.login-form {
    text-align: left;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-footer {
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.success-message {
    padding: 2rem;
}

.success-message .success-icon {
    color: var(--success);
    margin-bottom: 1rem;
}

.success-message h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.success-message p {
    color: var(--text-muted);
}

.login-hint {
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* Dashboard */
.dashboard-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 1.5rem;
}

.dashboard-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-section h2 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.profile-preview-pic {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg);
    flex-shrink: 0;
}

.profile-preview-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-preview-info h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.profile-preview-info p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.edit-field {
    margin-bottom: 1rem;
}

.edit-field label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.link-item-drag {
    color: var(--text-muted);
    cursor: grab;
}

.link-item-info {
    flex: 1;
}

.link-item-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.link-item-url {
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
}

.btn-icon:hover {
    color: var(--text);
    background: var(--border);
}

.btn-icon.delete:hover {
    color: var(--error);
}

.view-profile-link {
    display: block;
    text-align: center;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    margin-top: 1rem;
}

.view-profile-link:hover {
    text-decoration: underline;
}
