/* assets/css/url-shortener.css - ORIGINAL DESIGN + PERFORMANCE OPTIMIZED */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* RESET Wrapper - Keep this */
.ashraf-tools-wrapper {
    padding-top: 20px;
    background: transparent !important;
    all: initial !important;
}

.ashraf-tools-wrapper * {
    all: unset !important;
}

/* Main Container - UPDATED: Wider and less margin */
.url-shortener-container {
    width: 100%;
    max-width: 100%; /* UPDATED: 500px থেকে 100% */
    background: white !important;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        rgba(0, 0, 0, 0.4) 0px 2px 4px,
        rgba(0, 0, 0, 0.3) 0px 7px 13px -3px,
        rgba(0, 0, 0, 0.2) 0px -3px 0px inset;
    margin: 8px auto 0 auto; /* UPDATED: 10px থেকে 8px */
    border: none !important;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif; /* ADDED: Font family */
    box-sizing: border-box; /* ADDED: সঠিক সাইজ হিসাবের জন্য */
}

/* Dark Mode - Keep original colors */
.dark .url-shortener-container,
.dark-mode .url-shortener-container {
    background: #202124 !important;
    box-shadow: 
        rgba(0, 0, 0, 0.6) 0px 4px 8px,
        rgba(0, 0, 0, 0.5) 0px 10px 20px -5px,
        rgba(0, 0, 0, 0.4) 0px -4px 0px inset;
}

/* Header - Keep original gradient */
.url-shortener-header {
    background: linear-gradient(135deg, #3a86ff, #2a75eb);
    color: white;
    padding: 16px 20px;
    text-align: center;
}

.dark .url-shortener-header,
.dark-mode .url-shortener-header {
    background: linear-gradient(135deg, #1a73e8, #1669d6);
}

.url-shortener-header h2 {
    font-size: 1.4rem;
    margin-bottom: 6px;
    font-weight: 800;
    letter-spacing: -0.5px;
    font-family: 'Inter', sans-serif;
}

.url-shortener-badge {
    display: inline-block;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.25);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

/* Input Section */
.url-shortener-input-section {
    padding: 10px;
}

.url-shortener-input-group {
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    background: white;
}

.dark .url-shortener-input-group,
.dark-mode .url-shortener-input-group {
    background: #303134 !important;
    border-color: #5f6368 !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3) !important;
}

.url-shortener-input-group:focus-within {
    border-color: #3a86ff;
    box-shadow: 0 4px 14px rgba(58, 134, 255, 0.15);
    transform: translateY(-1px);
}

.dark .url-shortener-input-group:focus-within,
.dark-mode .url-shortener-input-group:focus-within {
    border-color: #8ab4f8 !important;
    box-shadow: 0 4px 14px rgba(138, 180, 248, 0.2) !important;
}

.url-shortener-input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    font-size: 0.95rem;
    outline: none;
    background: transparent;
    min-width: 0;
    color: #1f2937;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.dark .url-shortener-input,
.dark-mode .url-shortener-input {
    color: #e8eaed !important;
}

.url-shortener-input::placeholder {
    color: #94a3b8;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.dark .url-shortener-input::placeholder,
.dark-mode .url-shortener-input::placeholder {
    color: #9aa0a6 !important;
}

.url-shortener-button {
    background: linear-gradient(135deg, #3a86ff, #2a75eb);
    color: white;
    border: none;
    padding: 0 20px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Inter', sans-serif;
}

.dark .url-shortener-button,
.dark-mode .url-shortener-button {
    background: linear-gradient(135deg, #1a73e8, #1669d6) !important;
}

.url-shortener-button:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(58, 134, 255, 0.35);
}

.dark .url-shortener-button:hover:not(:disabled),
.dark-mode .url-shortener-button:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(138, 180, 248, 0.3) !important;
}

.url-shortener-button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none !important;
}

.dark .url-shortener-button:disabled,
.dark-mode .url-shortener-button:disabled {
    background: #5f6368 !important;
}

.url-shortener-button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(58, 134, 255, 0.4);
}

/* Messages */
.url-shortener-message {
    margin: 12px 0 0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: none;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.url-shortener-error {
    background: #fee2e2;
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

.dark .url-shortener-error,
.dark-mode .url-shortener-error {
    background: #3c1f1f !important;
    color: #fecaca !important;
    border-left-color: #ef4444 !important;
}

.url-shortener-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.dark .url-shortener-success,
.dark-mode .url-shortener-success {
    background: #1a3a2e !important;
    color: #a7f3d0 !important;
    border-left-color: #10b981 !important;
}

/* Social Buttons Section - FIXED */
.social-buttons-container {
    display: flex;
    gap: 10px;
    margin: 15px 20px 20px;
    width: calc(100% - 40px);
}

.social-button {
    flex: 1;
    height: 36px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    font-family: 'Inter', sans-serif;
}

.dark .social-button,
.dark-mode .social-button {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
}

.facebook-follow-button {
    background: linear-gradient(135deg, #1877F2, #0D6EFD);
    color: white;
}

.facebook-follow-button:hover {
    background: linear-gradient(135deg, #0D6EFD, #0B5ED7);
    box-shadow: 0 2px 6px rgba(24, 119, 242, 0.3);
    transform: translateY(-1px);
}

.dark .facebook-follow-button:hover,
.dark-mode .facebook-follow-button:hover {
    box-shadow: 0 2px 6px rgba(24, 119, 242, 0.5) !important;
}

.facebook-follow-button:active {
    transform: scale(0.98);
    box-shadow: 0 1px 3px rgba(24, 119, 242, 0.2);
}

.share-button {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.share-button:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.dark .share-button:hover,
.dark-mode .share-button:hover {
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.5) !important;
}

.share-button:active {
    transform: scale(0.98);
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.2);
}

.social-icon {
    font-size: 0.8rem;
    font-weight: bold;
}

/* Popup - KEEP ORIGINAL */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.popup-content {
    background: white;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    max-width: 400px;
    width: 98%;
    font-family: 'Inter', sans-serif;
}

.dark .popup-content,
.dark-mode .popup-content {
    background: #303134 !important;
    color: #e8eaed !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
}

.popup-content h2 {
    color: #3a86ff;
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
}

.dark .popup-content h2,
.dark-mode .popup-content h2 {
    color: #8ab4f8 !important;
}

.progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.progress-wrapper {
    position: relative;
    width: 220px;
    height: 220px;
    box-shadow: 
        0 12px 30px rgba(0, 0, 0, 0.15),
        0 6px 12px rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    z-index: 0;
}

.dark .progress-wrapper,
.dark-mode .progress-wrapper {
    box-shadow: 
        0 12px 30px rgba(0, 0, 0, 0.4),
        0 6px 12px rgba(0, 0, 0, 0.3) !important;
}

.circular-progress {
    position: relative;
    width: 100%;
    height: 100%;
}

.progress-bg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    position: relative;
    z-index: 0;
}

.dark .progress-bg,
.dark-mode .progress-bg {
    background: #303134 !important;
}

/* Progress fill - FIXED (Keep original but add variables) */
.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(var(--progress-color, #ff6b35) var(--progress-percent, 0%), var(--bg-color, #f0f0f0) 0%);
    clip-path: circle(106px at center);
    transition: background 0.3s ease-in-out;
    z-index: 1;
}

.dark .progress-fill,
.dark-mode .progress-fill {
    --bg-color: #424242 !important;
    background: conic-gradient(var(--progress-color, #ff6b35) var(--progress-percent, 0%), var(--bg-color, #424242) 0%) !important;
}

.progress-text-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.progress-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: #2d3748;
    background: white;
    padding: 22px;
    border-radius: 50%;
    border: 6px solid #e2e8f0;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.dark .progress-number,
.dark-mode .progress-number {
    color: #e8eaed !important;
    background: #303134 !important;
    border-color: #5f6368 !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3) !important;
}

.progress-number::after {
    content: '%';
    font-size: 1.4rem;
    margin-left: 3px;
    color: #64748b;
}

.dark .progress-number::after,
.dark-mode .progress-number::after {
    color: #9aa0a6 !important;
}

.url-count {
    font-size: 1.1rem;
    color: #666;
    font-weight: 500;
    transition: color 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.dark .url-count,
.dark-mode .url-count {
    color: #e8eaed !important;
}

/* URL Results Section */
.url-shortener-result {
    display: none;
    padding: 0 20px;
    flex-direction: column;
    gap: 12px;
}

.url-shortener-result h3 {
    color: #1f2937;
    margin-bottom: 5px;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    padding: 10px 0;
    border-bottom: 2px solid #e2e8f0;
    font-family: 'Inter', sans-serif;
}

.dark .url-shortener-result h3,
.dark-mode .url-shortener-result h3 {
    color: #e8eaed !important;
    border-bottom-color: #5f6368 !important;
}

.url-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #10b981;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.dark .url-item,
.dark-mode .url-item {
    background: #303134 !important;
    border-left-color: #10b981 !important;
}

.url-item:hover {
    background: #f1f5f9;
    transform: translateX(2px);
}

.dark .url-item:hover,
.dark-mode .url-item:hover {
    background: #3c4043 !important;
}

.url-number {
    background: #3a86ff;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    font-family: 'Inter', sans-serif;
}

.dark .url-number,
.dark-mode .url-number {
    background: #1a73e8 !important;
}

.url-link {
    color: #10b981;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    word-break: break-all;
    flex: 1;
    font-family: 'Inter', sans-serif;
}

.dark .url-link,
.dark-mode .url-link {
    color: #34d399 !important;
}

.url-link:hover {
    text-decoration: underline;
}

.url-error {
    color: #dc2626;
    font-weight: 500;
    font-size: 0.9rem;
    flex: 1;
    font-family: 'Inter', sans-serif;
}

.dark .url-error,
.dark-mode .url-error {
    color: #f87171 !important;
}

/* Copy Button - Keep original design */
.copy-all-button {
    margin: 20px 20px 0;
    padding: 14px 20px;
    background: #10b981 !important;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    width: calc(100% - 40px);
    display: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    position: relative;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Inter', sans-serif;
}

.dark .copy-all-button,
.dark-mode .copy-all-button {
    background: #10b981 !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.5) !important;
}

.copy-all-button:hover {
    background: #0da271;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}

.dark .copy-all-button:hover,
.dark-mode .copy-all-button:hover {
    background: #0da271 !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6) !important;
}

.copy-all-button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.copy-all-button:focus {
    outline: 3px solid #3a86ff;
    outline-offset: 2px;
}

.dark .copy-all-button:focus,
.dark-mode .copy-all-button:focus {
    outline-color: #8ab4f8 !important;
}

.copy-all-button.copied {
    background: #3a86ff;
    box-shadow: 0 4px 14px rgba(58, 134, 255, 0.4);
}

.dark .copy-all-button.copied,
.dark-mode .copy-all-button.copied {
    background: #1a73e8 !important;
    box-shadow: 0 4px 14px rgba(26, 115, 232, 0.5) !important;
}

.copy-all-button.copied:hover {
    background: #2a75eb;
    box-shadow: 0 6px 20px rgba(58, 134, 255, 0.5);
}

.dark .copy-all-button.copied:hover,
.dark-mode .copy-all-button.copied:hover {
    background: #1669d6 !important;
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.6) !important;
}

/* Scroll Indicator - Keep original */
.scroll-indicator {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-5px);
    }
    60% {
        transform: translateX(-50%) translateY(-3px);
    }
}

/* Mobile Responsive - UPDATED: less margin */
@media (max-width: 480px) {
    .url-shortener-container {
        border-radius: 10px;
        margin: 6px auto 0 auto; /* UPDATED: কম মার্জিন */
    }
    
    .url-shortener-header {
        padding: 14px 16px;
    }
    
    .url-shortener-header h2 {
        font-size: 1.2rem;
    }
    
    .url-shortener-input-section {
        padding: 16px;
    }
    
    .url-shortener-input-group {
        flex-direction: column;
        border-radius: 8px;
    }
    
    .url-shortener-input {
        padding: 12px 14px;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .dark .url-shortener-input,
    .dark-mode .url-shortener-input {
        border-bottom-color: #5f6368 !important;
    }
    
    .url-shortener-button {
        padding: 12px;
        border-radius: 0 0 6px 6px;
        font-size: 0.85rem;
    }
    
    .social-buttons-container {
        margin: 15px 16px 16px;
        width: calc(100% - 32px);
        gap: 8px;
    }
    
    .social-button {
        height: 32px;
        font-size: 0.7rem;
    }
    
    .social-icon {
        font-size: 0.75rem;
    }
    
    .url-shortener-result {
        padding: 0 16px;
    }
    
    .url-item {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .url-number {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .url-link, .url-error {
        font-size: 0.85rem;
    }
    
    .copy-all-button {
        margin: 16px 16px 0;
        width: calc(100% - 32px);
        padding: 12px 16px;
    }
    
    .progress-wrapper {
        width: 180px;
        height: 180px;
    }

    .progress-fill {
        clip-path: circle(85px at center);
    }

    .progress-number {
        width: 90px;
        height: 90px;
        font-size: 1.8rem;
        padding: 18px;
    }
}

/* Tablets */
@media (min-width: 481px) and (max-width: 768px) {
    .url-shortener-container {
        max-width: 95%; /* ADDED: ট্যাবলেটের জন্য */
        margin: 10px auto 0 auto;
    }
}

/* Desktop */
@media (min-width: 769px) {
    .url-shortener-container {
        max-width: 90%; /* ADDED: ডেস্কটপের জন্য */
        margin: 12px auto 0 auto;
    }
}

/* Extra small mobiles */
@media (max-width: 360px) {
    .url-shortener-container {
        margin: 4px auto 0 auto; /* UPDATED: আরও কম মার্জিন */
        border-radius: 8px;
    }
}

/* Accessibility improvements - ADDED */
@media (prefers-reduced-motion: reduce) {
    .scroll-indicator,
    .copy-all-button,
    .social-button,
    .url-item,
    .url-shortener-button {
        animation: none !important;
        transition: none !important;
    }
    
    .copy-all-button:hover,
    .social-button:hover,
    .url-item:hover,
    .url-shortener-button:hover {
        transform: none !important;
    }
}

/* Print styles - ADDED */
@media print {
    .url-shortener-button,
    .social-buttons-container,
    .copy-all-button,
    .popup,
    .scroll-indicator {
        display: none !important;
    }
    
    .url-shortener-container {
        box-shadow: none !important;
        border: 1px solid #000 !important;
        background: white !important;
    }
    
    .url-link {
        color: #000 !important;
        text-decoration: underline !important;
    }
}