:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    --accent-primary: #00e676;
    --accent-hover: #00c853;
    --border-color: #3a3a3a;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(0, 230, 118, 0.3);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main), serif;
    background: var(--bg-primary);
    background-image:
        radial-gradient(circle at 20% 80%, rgba(0, 230, 118, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 230, 118, 0.05) 0%, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    align-items: center;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
    width: 100%;
}

.logo {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.sub-tagline {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-style: italic;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.8s ease-out;
    width: 100%;
}

/* Form Styles */
.query-form {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.query-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: var(--font-main), serif;
}

.query-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    background: var(--bg-secondary);
}

.query-input::placeholder {
    color: var(--text-muted);
}

.generate-btn {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-hover) 100%);
    color: var(--bg-primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.generate-btn:active {
    transform: translateY(0);
}

/* Examples Section */
.examples {
    text-align: center;
    margin-top: 2rem;
    width: 100%;
    max-width: 600px;
}

.examples p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.example-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.example-btn:hover {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Link Generation Page Styles */
.generate-main {
    width: 100%;
    max-width: 700px;
}

.success-message {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInScale 0.5s ease-out;
}

.success-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.success-message h2 {
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.query-display {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 1.125rem;
    padding: 0 1rem;
}

.link-section {
    margin-bottom: 2rem;
}

.link-container {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.5rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.link-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.75rem;
    font-family: var(--font-mono), serif;
    font-size: 0.875rem;
}

.link-input:focus {
    outline: none;
}

.copy-btn {
    padding: 0.75rem 1.5rem;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: var(--accent-hover);
}

/* Actions Section */
.actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.action-btn.primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.action-btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.action-btn.secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Share Section */
.share-section {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.share-section h3 {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.share-btn.twitter:hover {
    border-color: #1DA1F2;
    color: #1DA1F2;
}

.share-btn.reddit:hover {
    border-color: #FF4500;
    color: #FF4500;
}

.share-btn.email:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Share button SVG icon styles */
.share-btn svg {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    fill: currentColor;
    flex-shrink: 0;
}

.share-btn span {
    display: inline-block;
}

/* SVG colors on hover */
.share-btn.twitter:hover svg {
    fill: #1DA1F2;
}

.share-btn.reddit:hover svg {
    fill: #FF4500;
}

.share-btn.email:hover svg {
    fill: var(--accent-primary);
}

/* Instructions */
.instructions {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.instructions h3 {
    color: var(--accent-primary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.instructions ol {
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.instructions li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.social-links a:hover {
    color: var(--accent-primary);
}

.social-links svg {
    display: inline-block;
    width: 24px;
    height: 24px;
    vertical-align: middle;
    fill: currentColor;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.copyright a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.copyright a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    html {
        font-size: 18px;
    }

    .container {
        padding: 1rem 0.75rem;
    }

    .logo {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
        margin-bottom: 0.75rem;
        line-height: 1.2;
    }

    .tagline {
        font-size: 1rem;
        padding: 0 1rem;
        line-height: 1.4;
    }

    .sub-tagline {
        font-size: 0.875rem;
        padding: 0 1rem;
    }

    .input-group {
        flex-direction: column;
    }

    .query-input {
        padding: 1.25rem 1rem;
        font-size: 1.125rem;
        width: 100%;
    }

    .generate-btn {
        padding: 1.25rem 2rem;
        font-size: 1.125rem;
        width: 100%;
        margin-top: 0.75rem;
    }

    .examples {
        padding: 0 1rem;
    }

    .examples p {
        font-size: 0.875rem;
        margin-bottom: 0.75rem;
    }

    .example-btn {
        display: block;
        width: 100%;
        padding: 0.875rem 1rem;
        margin: 0.5rem auto;
        font-size: 1rem;
        text-align: center;
    }

    .actions {
        flex-direction: column;
    }

    .share-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 0.75rem;
    }

    .share-btn {
        flex: 1;
        min-width: 120px;
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
        width: 100%;
        justify-content: center;
    }

    .generate-main {
        width: 100%;
        padding: 0 1rem;
    }

    .success-message h2 {
        font-size: 1.75rem;
    }

    .query-display {
        font-size: 1.125rem;
        padding: 0 0.75rem;
        word-break: break-word;
    }

    .link-container {
        flex-direction: column;
        padding: 0.75rem;
    }

    .link-input {
        width: 100%;
        padding: 1rem;
        font-size: 0.875rem;
        word-break: break-all;
    }

    .copy-btn {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }

    .action-btn {
        width: 100%;
        padding: 1.125rem 1.5rem;
        font-size: 1rem;
    }

    footer {
        padding: 1.5rem 1rem;
    }

    .footer-content {
        gap: 0.75rem;
    }

    .social-links {
        gap: 1.5rem;
    }

    .social-links svg {
        width: 28px;
        height: 28px;
    }
}

@media (min-width: 769px) {
    .input-group {
        flex-direction: row;
    }

    .query-input {
        flex: 1;
    }

    .generate-btn {
        width: auto;
        padding: 1rem 2.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 2rem 1.5rem;
    }

    .logo {
        font-size: 3rem;
    }
}

@media (min-width: 1025px) {
    header, main, footer {
        width: 100%;
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }

    .examples {
        width: 100%;
        max-width: 600px;
    }
}

/* Dark mode scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
    button, .action-btn, .share-btn, .example-btn {
        min-height: 48px;
    }

    .social-links a {
        padding: 8px;
    }
}