/**
 * Bixby - The Silent Digital Butler
 * Ultra-minimalist, high-end styling with Butler theme
 * Refined with subtle animations and improved typography
 */

:root {
    --bg-primary: #faf9f6;
    --bg-secondary: #ffffff;
    --text-primary: #2a2a2a;
    --text-secondary: rgba(42, 42, 42, 0.65);
    --border-color: rgba(42, 42, 42, 0.15);
    --shadow-color: rgba(42, 42, 42, 0.08);
    --button-bg: #2a2a2a;
    --button-text: #faf9f6;
    --spinner-track: rgba(250, 249, 246, 0.3);
    --spinner-color: #faf9f6;
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --text-primary: #faf9f6;
    --text-secondary: rgba(250, 249, 246, 0.7);
    --border-color: rgba(250, 249, 246, 0.15);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --button-bg: #faf9f6;
    --button-text: #2a2a2a;
    --spinner-track: rgba(42, 42, 42, 0.3);
    --spinner-color: #2a2a2a;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.dark-mode-toggle:active {
    transform: scale(0.95);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3 {
    font-family: 'Merriweather', 'Playfair Display', serif;
    font-weight: 300;
    letter-spacing: -0.01em;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Fade-in animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.fade-in-delay {
    animation: fadeIn 0.6s ease-out 0.15s forwards;
    opacity: 0;
}

.fade-in-delay-2 {
    animation: fadeIn 0.6s ease-out 0.3s forwards;
    opacity: 0;
}

.fade-in-delay-3 {
    animation: fadeIn 0.6s ease-out 0.45s forwards;
    opacity: 0;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.logo-container {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
    animation: fadeIn 0.8s ease-out;
}

.logo-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.logo-image:hover {
    transform: scale(1.05);
}

.logo-container a {
    text-decoration: none;
    display: inline-block;
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0.01em;
    transition: color 0.3s ease;
}

/* Card */
.card {
    background: var(--bg-secondary);
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--shadow-color);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    transition: box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px var(--shadow-color);
}

/* Label */
.label {
    display: block;
    font-family: 'Merriweather', serif;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

/* Textarea */
.textarea {
    width: 100%;
    min-height: 256px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: all 0.2s ease;
}

.textarea:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 4px var(--shadow-color);
}

.textarea::placeholder {
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.6;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 1.125rem 2rem;
    background: var(--button-bg);
    color: var(--button-text);
    font-family: 'Merriweather', serif;
    font-size: 1.125rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-text, .btn-loading {
    position: relative;
    z-index: 1;
}

.btn-loading {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--spinner-track);
    border-top-color: var(--spinner-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.btn-secondary {
    padding: 1rem 1.75rem;
    background: var(--button-bg);
    color: var(--button-text);
    font-family: 'Merriweather', serif;
    font-size: 0.95rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.copy-success {
    display: none;
}

/* Error */
.error {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #dc2626;
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.error-container {
    text-align: center;
    background: var(--bg-secondary);
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--shadow-color);
    border: 1px solid rgba(220, 38, 38, 0.2);
    padding: 2.5rem;
}

.error-title {
    font-family: 'Merriweather', serif;
    font-size: 1.5rem;
    color: #dc2626;
    margin-bottom: 1rem;
}

.error-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

/* Footer note */
.footer-note {
    text-align: center;
    margin-top: 2.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.5;
    transition: color 0.3s ease;
}

/* Secure badge with glowing lock */
.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.lock-icon {
    width: 1rem;
    height: 1rem;
    color: #22c55e;
    filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.6));
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.9)) drop-shadow(0 0 12px rgba(34, 197, 94, 0.4));
    }
}

/* Success message */
.success-message {
    text-align: center;
    margin-bottom: 2.5rem;
}

.success-title {
    font-family: 'Merriweather', serif;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 400;
    transition: color 0.3s ease;
}

.success-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    transition: color 0.3s ease;
}

/* Link section */
.link-section {
    margin-bottom: 1rem;
}

.link-input-group {
    display: flex;
    gap: 0.75rem;
}

.link-input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.8125rem;
    transition: all 0.2s ease;
}

.link-input:focus {
    outline: none;
    border-color: var(--text-secondary);
    box-shadow: 0 0 0 3px var(--shadow-color);
}

.copied-message {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    display: none;
    animation: fadeIn 0.3s ease-out;
}

/* Footer section */
.footer-section {
    text-align: center;
}

.warning {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 1.25rem;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.link-back {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
}

.link-back:hover {
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

/* Loading */
.loading {
    text-align: center;
    transition: opacity 0.3s ease;
}

.expired, .error-container {
    transition: opacity 0.4s ease;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1.5rem;
    border: 3px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.loading-text {
    font-family: 'Merriweather', serif;
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 400;
    transition: color 0.3s ease;
}

.loading-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
    transition: color 0.3s ease;
}

/* Expired */
.expired {
    text-align: center;
}

.tray-illustration {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: center;
    color: var(--text-secondary);
    opacity: 0.4;
    animation: fadeIn 0.8s ease-out;
    transition: color 0.3s ease;
}

.expired-title {
    font-family: 'Merriweather', serif;
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 300;
    transition: color 0.3s ease;
}

.expired-subtitle {
    font-family: 'Merriweather', serif;
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-weight: 300;
    font-style: italic;
    transition: color 0.3s ease;
}

/* Message card */
.message-card {
    background: var(--bg-secondary);
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--shadow-color);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    width: 100%;
    transition: opacity 0.4s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.message-header {
    text-align: center;
    margin-bottom: 2rem;
}

.message-title {
    font-family: 'Merriweather', serif;
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 300;
    transition: color 0.3s ease;
}

.message-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
    transition: color 0.3s ease;
}

.message-content {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.message-content:hover {
    box-shadow: 0 2px 8px var(--shadow-color);
}

.message-text {
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1.0625rem;
    line-height: 1.75;
    white-space: pre-wrap;
    word-wrap: break-word;
    transition: color 0.3s ease;
}

.message-footer {
    text-align: center;
}

/* Responsive */
@media (max-width: 640px) {
    .logo-image {
        width: 100px;
        height: 100px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }

    .card {
        padding: 1.75rem;
    }

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

    .btn-secondary {
        width: 100%;
    }

    .message-content {
        padding: 1.5rem;
    }
}

/* Smooth transitions for all interactive elements */
a, button {
    transition: all 0.2s ease;
}

/* Selection styling */
::selection {
    background: var(--border-color);
    color: var(--text-primary);
}

/* ==========================================
   About Page Styles
   ========================================== */

.code-block {
    background: #1e1e2e;
    border-radius: 12px;
    overflow: hidden;
    margin: 1.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.code-header {
    background: #313244;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-header-dots {
    display: flex;
    gap: 6px;
}

.code-header-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-header-dot.red { background: #f38ba8; }
.code-header-dot.yellow { background: #f9e2af; }
.code-header-dot.green { background: #a6e3a1; }

.code-header-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #a6adc8;
    font-weight: 500;
}

.code-header-lang {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.7rem;
    color: #6c7086;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

.code-content {
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
}

.code-block code {
    color: #cdd6f4;
    display: block;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    white-space: pre;
}

.code-keyword { color: #cba6f7; font-weight: 500; }
.code-string { color: #a6e3a1; }
.code-comment { color: #6c7086; font-style: italic; }
.code-function { color: #89b4fa; }
.code-number { color: #fab387; }
.code-variable { color: #f38ba8; }
.code-property { color: #89dceb; }

.tech-section {
    margin-bottom: 3rem;
}

.tech-title {
    font-family: 'Merriweather', serif;
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 300;
    transition: color 0.3s ease;
}

.tech-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    position: relative;
    transition: color 0.3s ease;
}

.tech-detail {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-family: 'Monaco', 'Menlo', monospace;
    display: block;
}

.tech-section:hover .tech-detail,
.feature-card:hover .tech-detail,
.security-item:hover .tech-detail {
    opacity: 1;
    max-height: 100px;
    margin-top: 0.75rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: help;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px var(--shadow-color);
}

.feature-title {
    font-family: 'Merriweather', serif;
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.feature-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.security-item {
    cursor: help;
    transition: all 0.2s ease;
}

.security-item:hover {
    transform: translateY(-2px);
}


.back-link {
    display: inline-block;
    margin-top: 2rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--text-primary);
}

.privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--button-bg);
    color: var(--button-text);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.privacy-badge:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.privacy-icon {
    font-size: 1.25rem;
}

.code-files {
    background: var(--border-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    border-left: 3px solid var(--text-primary);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.code-files ul {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0 0;
}

.code-files li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.code-files li:before {
    content: '📄 ';
    margin-right: 0.5rem;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

.code-files li:nth-child(2):before { animation-delay: 0.2s; }
.code-files li:nth-child(3):before { animation-delay: 0.4s; }
.code-files li:nth-child(4):before { animation-delay: 0.6s; }
.code-files li:nth-child(5):before { animation-delay: 0.8s; }
.code-files li:nth-child(6):before { animation-delay: 1s; }

/* About page scroll progress */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--text-primary), var(--text-secondary));
    z-index: 9999;
    transition: width 0.1s ease;
}


@keyframes codeGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes fadeInCode {
    from {
        opacity: 0;
        filter: blur(4px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

/* Privacy highlight pulse */
.privacy-highlight {
    position: relative;
}

.privacy-highlight::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--border-color);
    border-radius: 8px;
    opacity: 0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}
