/* TikTok MP3 Audio Downloader - Modern UI/UX Styles */
/* (Updated per request)
   - MP3 download button positioned in-card (≈30% from top, centered band)
   - H2 title margin set to 0px
   - URL input (tt-mp3-input) height increased
*/

:root {
    --bg-color: #ffffff;
    --primary-color: #10b981;
    --secondary-color: #059669;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --border-radius: 20px;
}

/* Reset and Base */
* {
    box-sizing: border-box;
}

/* Main Wrapper - Full Width Support */
.tiktok-mp3-wrapper {
    width: 100%;
    padding: 20px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(5, 150, 105, 0.05) 100%);
}

.alignwide .tiktok-mp3-wrapper,
.alignfull .tiktok-mp3-wrapper {
    padding-left: 0;
    padding-right: 0;
}

/* Container */
.tiktok-mp3-container {
    max-width: 1200px;
    margin: 0;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 30px 30px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.tiktok-mp3-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Header Section */
.tt-mp3-header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInDown 0.6s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tt-icon-wrapper {
    width: 10%;
    height: 80px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(16, 185, 129, 0.4);
    }
}

.tt-main-icon {
    width: 45px;
    height: 45px;
    color: white;
}

/* H2 title – margin removed as requested */
.tt-mp3-title {
    font-size: 2.0rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 100px;
    /* ← requested */
    line-height: 1.2;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tt-mp3-subtitle {
    font-size: 1.15rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.6;
}

/* Form Section */
.tt-mp3-form {
    margin-bottom: 50px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tt-mp3-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.tt-input-wrapper {
    flex: 1;
    position: relative;
}

.tt-input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    color: var(--text-light);
    pointer-events: none;
}

/* URL input – height increased as requested */
.tt-mp3-input {
    width: 90%;
    margin: 15px 0 0 51px;
    font-size: 1.05rem;
    height: 62px;
    /* ← requested (taller box) */
    line-height: 62px;
    /* ← keep text vertically centered */
    padding: 0 16px 0 60px;
    /* left padding accommodates the icon */
    border: 2px solid var(--border-color);
    border-radius: 15px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #f9fafb;
}

.tt-mp3-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    background: white;
}

.tt-mp3-input::placeholder {
    color: #9ca3af;
}

.tt-paste-btn {
    padding: 20px 25px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.tt-paste-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
}

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

.tt-mp3-submit {
    padding: 20px 35px;
    font-size: 1.05rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.tt-mp3-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.tt-mp3-submit:active {
    transform: translateY(0);
}

.tt-mp3-submit svg {
    width: 20px;
    height: 20px;
}

/* Features Grid */
.tt-mp3-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    animation: fadeIn 0.6s ease 0.4s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.tt-feature {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(5, 150, 105, 0.05) 100%);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.tt-feature:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.tt-feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

.tt-feature:nth-child(2) .tt-feature-icon {
    animation-delay: .2s;
}

.tt-feature:nth-child(3) .tt-feature-icon {
    animation-delay: .4s;
}

.tt-feature:nth-child(4) .tt-feature-icon {
    animation-delay: .6s;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.tt-feature h4 {
    font-size: 1.15rem;
    color: var(--text-color);
    margin-bottom: 8px;
    font-weight: 600;
}

.tt-feature p {
    font-size: .95rem;
    color: var(--text-light);
    margin: 0;
}

/* Error Message */
.tt-error {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
    padding: 16px 20px;
    border-radius: 12px;
    margin: 20px 0;
    font-size: .95rem;
    animation: shake .5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* Result Section */
.tt-mp3-result {
    animation: fadeInScale .5s ease;
    position: relative;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Download Another Button - Top Right */
.tt-another-form-top {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.tt-another-btn-top {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    background: #fff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    font-weight: 600;
    font-size: .95rem;
    margin-top: 305px;
    /* your custom offset */
    cursor: pointer;
    transition: all .3s ease;
    font-family: inherit;
    box-shadow: var(--shadow-md);
}

.tt-another-btn-top:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, .3);
}

.tt-another-btn-top svg {
    width: 18px;
    height: 18px;
}

/* Audio Card */
.tt-audio-card {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-radius: 20px;
    padding: 50px 40px 40px 40px;
    margin-top: 0;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    position: relative;
    /* needed for absolute-positioned download button */
}

/* Visual block */
.tt-audio-visual {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: left;
}

.tt-album-art {
    position: relative;
    width: 180px;
    height: 180px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    flex-shrink: 0;
}

.tt-album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.tt-album-art:hover img {
    transform: scale(1.1);
}

.tt-audio-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(16, 185, 129, .95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(16, 185, 129, .5);
}

.tt-audio-icon svg {
    width: 30px;
    height: 30px;
}

/* Audio Wave */
.tt-audio-wave {
    display: flex;
    gap: 6px;
    align-items: center;
    height: 60px;
}

.tt-audio-wave span {
    width: 8px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 10px;
    animation: wave 1.2s ease-in-out infinite;
}

.tt-audio-wave span:nth-child(1) {
    height: 30%;
    animation-delay: 0s;
}

.tt-audio-wave span:nth-child(2) {
    height: 50%;
    animation-delay: .1s;
}

.tt-audio-wave span:nth-child(3) {
    height: 80%;
    animation-delay: .2s;
}

.tt-audio-wave span:nth-child(4) {
    height: 60%;
    animation-delay: .3s;
}

.tt-audio-wave span:nth-child(5) {
    height: 40%;
    animation-delay: .4s;
}

.tt-audio-wave span:nth-child(6) {
    height: 70%;
    animation-delay: .5s;
}

.tt-audio-wave span:nth-child(7) {
    height: 50%;
    animation-delay: .6s;
}

.tt-audio-wave span:nth-child(8) {
    height: 35%;
    animation-delay: .7s;
}

.tt-audio-wave span:nth-child(9) {
    height: 65%;
    animation-delay: .8s;
}

.tt-audio-wave span:nth-child(10) {
    height: 45%;
    animation-delay: .9s;
}

@keyframes wave {

    0%,
    100% {
        height: 30%;
    }

    50% {
        height: 100%;
    }
}

/* Audio Info */
.tt-audio-info {
    flex: 1;
    min-width: 0;
}

.tt-audio-title {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 15px;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tt-audio-author {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 1.05rem;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tt-audio-author svg {
    flex-shrink: 0;
}

.tt-username {
    color: var(--primary-color);
    font-weight: 500;
}

/* MP3 Download Button – Placement & Style */
.tt-mp3-download-center {
    position: absolute;
    left: 70%;
    /* your custom alignment (moves to the right of profile) */
    top: 30%;
    transform: translate(-50%, -50%);
    width: min(420px, 90%);
    z-index: 5;
    margin: 0;
}

.tt-mp3-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;
    padding: 0px 4px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 15px;
    font-weight: 600;
    font-size: 1.15rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(16, 185, 129, .3);
    text-align: center;
    width: 60%;
    max-width: 100%;
    margin: 0 auto;
}

.tt-mp3-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(16, 185, 129, .4);
}

.tt-mp3-btn svg {
    width: 28px;
    height: 28px;
}

.tt-mp3-btn span {
    font-size: 1.15rem;
}

.tt-mp3-btn small {
    font-size: .9rem;
    opacity: .9;
    font-weight: 400;
}

/* Audio meta chips */
.tt-audio-meta {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.tt-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: .95rem;
    font-weight: 500;
    background: #fff;
    padding: 10px 18px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.tt-meta-item svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

/* MP3 Actions Container (bottom) */
.tt-mp3-actions {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.tt-mp3-actions .tt-mp3-btn {
    width: 100%;
    margin-bottom: 20px;
    padding: 16px 24px;
}

/* "Download Another" (bottom section) */
.tt-another-form {
    width: 100%;
}

.tt-another-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    background: #fff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all .3s ease;
    width: 100%;
    font-family: inherit;
}

.tt-another-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, .3);
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .tt-mp3-download-center {
        left: 60%;
        width: min(380px, 90%);
    }
}

@media (max-width: 768px) {
    .tiktok-mp3-wrapper {
        padding: 20px 10px;
    }

    .tiktok-mp3-container {
        padding: 30px 20px;
        border-radius: 15px;
    }

    .tt-mp3-title {
        font-size: 1.75rem !important;
        margin: 0 0 10px 0 !important;
    }

    .tt-mp3-subtitle {
        font-size: 1rem;
    }

    .tt-icon-wrapper {
        width: 80px;
        height: 80px;
    }

    .tt-mp3-input-group {
        flex-direction: column;
        gap: 15px;
    }

    .tt-mp3-input {
        width: 100% !important;
        margin: 0 !important;
        padding-left: 60px !important;
    }

    .tt-input-icon {
        left: 20px;
    }

    .tt-paste-btn,
    .tt-mp3-submit {
        width: 100%;
        justify-content: center;
        height: 60px;
    }

    .tt-mp3-features {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .tt-feature {
        padding: 20px 15px;
    }

    .tt-audio-card {
        padding: 40px 20px 25px 20px;
    }

    .tt-another-btn-top {
        position: static;
        margin: 0 auto 20px;
        width: 100%;
        justify-content: center;
    }

    .tt-audio-visual {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .tt-album-art {
        width: 160px;
        height: 160px;
        margin: 0 auto;
    }

    .tt-audio-info {
        width: 100%;
    }

    .tt-audio-title {
        font-size: 1.25rem;
    }

    .tt-audio-author {
        justify-content: center;
    }

    .tt-mp3-download-center {
        position: static;
        transform: none;
        width: 100%;
        margin: 25px 0 0 0;
    }

    .tt-mp3-btn {
        width: 100%;
        max-width: 100%;
        padding: 15px;
    }

    .tt-audio-meta {
        justify-content: center;
        gap: 12px;
    }

    .tt-meta-item {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .tt-mp3-title {
        font-size: 1.5rem !important;
    }

    .tt-mp3-features {
        grid-template-columns: 1fr;
    }

    .tt-audio-meta {
        gap: 8px;
    }

    .tt-meta-item {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 320px) {
    .tiktok-mp3-container {
        padding: 25px 15px;
    }

    .tt-mp3-title {
        font-size: 1.35rem !important;
    }

    .tt-mp3-subtitle {
        font-size: 0.9rem;
    }

    .tt-icon-wrapper {
        width: 60px;
        height: 60px;
    }

    .tt-main-icon {
        width: 30px;
        height: 30px;
    }

    .tt-mp3-input {
        font-size: 0.95rem !important;
    }

    .tt-paste-btn,
    .tt-mp3-submit {
        font-size: 0.95rem;
    }

    .tt-audio-visual {
        gap: 15px;
    }

    .tt-album-art {
        width: 140px;
        height: 140px;
    }

    .tt-audio-title {
        font-size: 1.1rem;
    }

    .tt-audio-author {
        font-size: 0.9rem;
    }

    .tt-audio-wave {
        height: 40px;
        justify-content: center;
    }

    .tt-audio-wave span {
        width: 4px;
    }

    .tt-mp3-btn {
        font-size: 1rem;
    }

    .tt-mp3-btn span {
        font-size: 1rem;
    }
}

/* Full Width Alignment */
.alignfull .tiktok-mp3-container {
    max-width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
}

/* Wide Alignment */
.alignwide .tiktok-mp3-container {
    max-width: 1200px;
}

/* Print Styles */
@media print {

    .tt-mp3-submit,
    .tt-mp3-btn,
    .tt-another-btn,
    .tt-mp3-form {
        display: none;
    }
}