/**
 * Hukhta Free Tools - Frontend Styles
 * Modernized for "Space/Dark" theme
 */

:root {
    --hft-bg-page: #050505;
    --hft-bg-card: #0a0a0a;
    --hft-border: #222222;
    --hft-primary: #3b82f6;
    --hft-primary-hover: #2563eb;
    --hft-text-main: #ffffff;
    --hft-text-sub: #a1a1aa;
    --hft-text-placeholder: #52525b;
    --hft-accent-glow: rgba(59, 130, 246, 0.4);
    --hft-font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --hft-radius-lg: 20px;
}

/* Tabs Navigation */
.hft-tabs-nav-wrapper {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.hft-tabs {
    display: flex;
    background: #11141a;
    padding: 6px;
    border-radius: 14px;
    gap: 4px;
    border: 1px solid #1f2937;
}

.hft-tab {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hft-tab:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.03);
}

.hft-tab.active {
    background: #1e293b;
    color: #3b82f6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hft-tab-icon {
    font-size: 1.1rem;
}

/* Tab Content */
.hft-tab-content {
    display: none;
    animation: hftFadeSlide 0.4s ease-out;
}

.hft-tab-content.active {
    display: block;
}

@keyframes hftFadeSlide {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* Base Container */
.hft-tools {
    font-family: var(--hft-font-family);
    box-sizing: border-box;
    max-width: 100%;
    color: var(--hft-text-sub);
    position: relative;
    padding: 0;
    border-radius: 25px;
}

.hft-tools.hft-theme-dark {
    background: var(--hft-bg-page);
}

.hft-tools * {
    box-sizing: border-box;
}

/* Dark Theme (Default/Premium) */
.hft-theme-dark {
    color: var(--hft-text-main);
}

/* MAIN CARD - Cyber Form */
.hft-input-box {
    background: linear-gradient(180deg, #0e1116 0%, #06070a 100%);
    border: 1px solid #1f2937;
    border-radius: var(--hft-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    min-height: 400px;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.hft-input-box:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2), 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

/* Textarea */
.hft-textarea-wrapper {
    flex: 1;
    display: flex;
    padding: 32px;
}

.hft-textarea-wrapper textarea {
    width: 100%;
    background: transparent !important;
    border: none !important;
    resize: none;
    color: #f1f5f9 !important;
    font-size: 1.125rem;
    line-height: 1.7;
    font-family: inherit;
    outline: none;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.hft-textarea-wrapper textarea::placeholder {
    color: #475569;
    opacity: 0.8;
}

/* Controls - Positioned at bottom of card */
.hft-box-controls {
    padding: 20px 32px 32px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: rgba(2, 6, 23, 0.5);
    border-top: 1px solid #1e293b;
}

/* Pills (Selects) */
.hft-pills-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hft-custom-select {
    position: relative;
}

.hft-custom-select select {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #94a3b8 !important;
    font-size: 0.875rem;
    padding: 10px 20px;
    padding-right: 38px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s ease;
}

.hft-custom-select::after {
    content: '↓';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    font-size: 0.8rem;
}

.hft-custom-select select:hover:not(:disabled) {
    border-color: #475569;
    color: #f1f5f9;
    background: #1e293b;
}

.hft-custom-select select:focus {
    outline: none;
    border-color: #3b82f6;
    color: white;
}

/* Footer Row */
.hft-box-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Char Counter */
.hft-char-counter {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.hft-char-counter .hft-current {
    color: #94a3b8;
}

/* Main Button */
.hft-submit-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    font-weight: 700;
    font-size: 1rem;
    padding: 12px 28px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.hft-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

.hft-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.hft-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #334155;
    box-shadow: none;
}

/* Output Section */
.hft-output-section {
    margin-top: 32px;
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.hft-output-box {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: var(--hft-radius-lg);
    padding: 32px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hft-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.hft-output-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #f8fafc;
    font-weight: 600;
}

.hft-copy-btn {
    background: rgba(30, 41, 59, 0.5);
    color: #94a3b8;
    padding: 8px 16px;
    border: 1px solid #334155;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
}

.hft-copy-btn:hover {
    background: #1e293b;
    color: #f1f5f9;
    border-color: #475569;
}

.hft-result {
    line-height: 1.8;
    color: #e2e8f0;
    font-size: 1.1rem;
    white-space: pre-wrap;
}

/* Ad Modal */
.hft-ad-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hft-ad-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 23, 0.9);
    backdrop-filter: blur(12px);
}

.hft-ad-modal-content {
    position: relative;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 24px;
    padding: 40px;
    max-width: 540px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    animation: hftModalScale 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hftModalScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

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

.hft-ad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.hft-ad-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hft-ad-icon {
    font-size: 1.5rem;
}

.hft-ad-header h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.5rem;
    font-weight: 700;
}

.hft-ad-subtitle {
    color: #94a3b8;
    font-size: 1rem;
    margin: 0 0 32px 0;
    line-height: 1.5;
}

.hft-ad-close {
    background: #1e293b;
    border: none;
    color: #94a3b8;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
}

.hft-ad-close:hover {
    background: #334155;
    color: white;
}

.hft-ad-container {
    background: #020617;
    border-radius: 16px;
    margin-bottom: 32px;
    overflow: hidden;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #1e293b;
}

.hft-ad-placeholder {
    color: #334155;
    font-weight: 700;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
}

.hft-claim-attempts {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    border-radius: 16px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Mobile Responsive */
@media (max-width: 640px) {
    .hft-textarea-wrapper {
        padding: 20px;
    }

    .hft-box-controls {
        padding: 20px;
    }

    .hft-submit-btn {
        width: 100%;
        justify-content: center;
    }

    .hft-tabs {
        flex-direction: column;
        width: 100%;
    }

    .hft-tab {
        justify-content: center;
    }

    .hft-ad-modal-content {
        padding: 24px;
    }
}