@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --error: #ef4444;
    --success: #10b981;
    --border: #475569;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.25rem;
    font-weight: 300;
}

.input-section {
    background: var(--surface);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease;
}

.input-wrapper {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

#mediumUrl {
    flex: 1;
    padding: 1rem 1.5rem;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

#mediumUrl:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

#mediumUrl::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

#fetchBtn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 0.75rem;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

#fetchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

#fetchBtn:active {
    transform: translateY(0);
}

#fetchBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

#fetchBtn:hover .btn-icon {
    transform: translateX(4px);
}

.error-msg {
    display: none;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 1rem;
    border-radius: 0.5rem;
    animation: shake 0.5s ease;
    margin-bottom: 1rem;
}

.footer {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 1rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.social-link:hover::before {
    opacity: 0.1;
}

.social-link:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.social-link svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.social-link:hover svg {
    transform: rotate(5deg) scale(1.1);
}

.social-link span {
    font-family: 'Inter', sans-serif;
}

/* Platform-specific colors */
.social-link.instagram:hover {
    border-color: #E1306C;
    box-shadow: 0 8px 24px rgba(225, 48, 108, 0.4);
}

.social-link.instagram:hover::before {
    background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    opacity: 0.15;
}

.social-link.linkedin:hover {
    border-color: #0077B5;
    box-shadow: 0 8px 24px rgba(0, 119, 181, 0.4);
}

.social-link.linkedin:hover::before {
    background: linear-gradient(135deg, #0077B5, #00A0DC);
    opacity: 0.15;
}

.social-link.github:hover {
    border-color: #6e5494;
    box-shadow: 0 8px 24px rgba(110, 84, 148, 0.4);
}

.social-link.github:hover::before {
    background: linear-gradient(135deg, #6e5494, #8b7aa8);
    opacity: 0.15;
}

.loading-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    animation: fadeIn 0.3s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--surface-light);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.article-section {
    animation: fadeInUp 0.5s ease;
    margin-bottom: 2rem;
}

.article-header {
    margin-bottom: 2rem;
}

.back-btn {
    background: var(--surface);
    border: 2px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.back-btn:hover {
    background: var(--surface-light);
    border-color: var(--primary);
    transform: translateX(-4px);
}

.article-title {
    color: var(--text);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.article-content {
    background: var(--surface);
    border-radius: 1rem;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    line-height: 1.8;
}

/* Styling for Medium article content */
.article-content h1,
.article-content h2,
.article-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text);
}

.article-content h1 {
    font-size: 2.5rem;
    line-height: 1.2;
}

.article-content h2 {
    font-size: 2rem;
}

.article-content h3 {
    font-size: 1.5rem;
}

.article-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.article-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.article-content a:hover {
    border-bottom-color: var(--primary);
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 2rem 0;
}

.article-content pre {
    background: var(--background);
    padding: 1.5rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}

.article-content code {
    background: var(--background);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.article-content ul,
.article-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
    color: var(--text-secondary);
}

.article-content li {
    margin-bottom: 0.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .input-wrapper {
        flex-direction: column;
    }

    #fetchBtn {
        justify-content: center;
    }

    .social-links {
        flex-direction: column;
        gap: 1rem;
    }

    .social-link {
        justify-content: center;
    }
}