/*
 * Twitter Video to MP3 Converter — Frontend Styles
 * Clean minimal design — just input + button
 *
 * @package TwitterToMP3
 * @version 1.0.0
 */

/* ========================================================================
   Animations
   ======================================================================== */
@keyframes ttm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes ttm-slide-up {
    0% { transform: translateY(12px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes ttm-progress-stripe {
    0% { background-position: 0 0; }
    100% { background-position: 40px 0; }
}

/* ========================================================================
   Wrapper — no background, inherits from theme
   ======================================================================== */
.ttm-converter-wrapper {
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    padding: 10px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.ttm-converter-wrapper *,
.ttm-converter-wrapper *::before,
.ttm-converter-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ========================================================================
   Input Group — grey rounded input with paste icon inside
   ======================================================================== */
.ttm-input-section {
    width: 100%;
}

.ttm-input-group {
    display: flex;
    align-items: center;
    background: #f2f2f2;
    border: none;
    border-radius: 10px;
    overflow: hidden;
}

.ttm-input-group:focus-within {
    box-shadow: 0 0 0 2px rgba(100, 155, 235, 0.35);
}

.ttm-url-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #333;
    font-family: inherit;
    font-size: 15px;
    padding: 15px 16px;
    width: 100%;
    min-width: 0;
}

.ttm-url-input::placeholder {
    color: #999;
    font-size: 14px;
}

.ttm-paste-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #aaa;
    padding: 12px 14px;
    cursor: pointer;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.ttm-paste-btn:hover {
    color: #649BEB;
}

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

/* ========================================================================
   Convert Button — solid blue, full width, rounded
   ======================================================================== */
.ttm-convert-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 24px;
    margin-top: 14px;
    background: #649BEB;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
    letter-spacing: 0.02em;
}

.ttm-convert-btn:hover:not(:disabled) {
    background: #5589d8;
}

.ttm-convert-btn:active:not(:disabled) {
    background: #4a7cc5;
}

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

.ttm-convert-btn.ttm-loading {
    opacity: 0.8;
    cursor: wait;
}

.ttm-convert-btn.ttm-loading .ttm-btn-text {
    display: none;
}

.ttm-convert-btn .ttm-btn-loading {
    display: none;
    align-items: center;
    gap: 8px;
}

.ttm-convert-btn.ttm-loading .ttm-btn-loading {
    display: flex;
}

.ttm-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ttm-spin 0.7s linear infinite;
}

/* ========================================================================
   Terms of Service text
   ======================================================================== */
.ttm-tos-text {
    text-align: center;
    font-size: 13px;
    color: #999;
    margin-top: 14px;
    line-height: 1.5;
}

.ttm-tos-text a {
    color: #649BEB;
    text-decoration: underline;
}

.ttm-tos-text a:hover {
    color: #5589d8;
}

/* ========================================================================
   Progress Bar
   ======================================================================== */
.ttm-progress {
    animation: ttm-slide-up 0.3s ease;
    margin-top: 20px;
}

.ttm-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ttm-progress-label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.ttm-progress-percent {
    font-size: 14px;
    font-weight: 600;
    color: #649BEB;
}

.ttm-progress-bar {
    width: 100%;
    height: 8px;
    background: #f2f2f2;
    border-radius: 100px;
    overflow: hidden;
}

.ttm-progress-fill {
    height: 100%;
    width: 0%;
    background: #649BEB;
    border-radius: 100px;
    transition: width 0.3s ease;
    background-size: 40px 40px;
    background-image: linear-gradient(
        45deg,
        rgba(255,255,255,0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255,255,255,0.2) 50%,
        rgba(255,255,255,0.2) 75%,
        transparent 75%,
        transparent
    );
    animation: ttm-progress-stripe 0.8s linear infinite;
}

.ttm-progress-status {
    font-size: 13px;
    color: #999;
    margin-top: 8px;
    text-align: center;
}

/* ========================================================================
   Download
   ======================================================================== */
.ttm-download {
    animation: ttm-slide-up 0.3s ease;
    margin-top: 20px;
}

.ttm-download-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 18px;
}

.ttm-download-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #dcfce7;
    color: #22c55e;
    flex-shrink: 0;
}

.ttm-download-icon svg {
    width: 22px;
    height: 22px;
}

.ttm-download-info {
    flex: 1;
    min-width: 0;
}

.ttm-download-title {
    font-size: 15px;
    font-weight: 600;
    color: #16a34a;
    margin-bottom: 2px;
}

.ttm-download-size {
    font-size: 13px;
    color: #888;
}

.ttm-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #22c55e;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.ttm-download-btn:hover {
    background: #16a34a;
    color: #fff;
    text-decoration: none;
}

/* ========================================================================
   Error
   ======================================================================== */
.ttm-error {
    animation: ttm-slide-up 0.3s ease;
    margin-top: 20px;
}

.ttm-error-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 14px 18px;
}

.ttm-error-message {
    flex: 1;
    font-size: 14px;
    color: #dc2626;
    line-height: 1.4;
}

.ttm-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.ttm-retry-btn:hover {
    background: #fcd5d5;
}

/* ========================================================================
   Responsive
   ======================================================================== */
@media (max-width: 480px) {
    .ttm-url-input {
        font-size: 14px;
        padding: 13px 12px;
    }

    .ttm-url-input::placeholder {
        font-size: 13px;
    }

    .ttm-convert-btn {
        padding: 14px 20px;
        font-size: 15px;
    }

    .ttm-download-card {
        flex-direction: column;
        text-align: center;
    }
}
