/* ==========================================
   NFC Share — Premium Design System
   ========================================== */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);

    --text-primary: #f0f0f5;
    --text-secondary: #8a8a9a;
    --text-muted: #5a5a6a;

    --accent-primary: #6c5ce7;
    --accent-secondary: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.3);

    --gradient-primary: linear-gradient(135deg, #6c5ce7 0%, #a855f7 50%, #ec4899 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(108, 92, 231, 0.15) 0%, rgba(168, 85, 247, 0.1) 100%);
    --gradient-card: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(108, 92, 231, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(108, 92, 231, 0.2);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    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);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ==========================================
   Animated Background
   ========================================== */

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
    pointer-events: none;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    z-index: 0;
    pointer-events: none;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.4) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.3) 0%, transparent 70%);
    bottom: 10%;
    left: -80px;
    animation-delay: -7s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.25) 0%, transparent 70%);
    top: 50%;
    right: -50px;
    animation-delay: -14s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.05); }
}

/* ==========================================
   App Container
   ========================================== */

.app-container {
    position: relative;
    z-index: 1;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   Header
   ========================================== */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-glow);
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    backdrop-filter: blur(10px);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.3s;
}

.status-badge.supported .status-dot {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    animation: pulse 2s infinite;
}

.status-badge.not-supported .status-dot {
    background: var(--error);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.status-badge.active .status-dot {
    background: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-glow);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

/* ==========================================
   Main Content
   ========================================== */

.main-content {
    flex: 1;
    padding: 32px 0;
}

/* Hero */
.hero-section {
    text-align: center;
    margin-bottom: 32px;
}

.hero-title {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 10px;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.5;
}

/* URL Card */
.url-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 32px;
    backdrop-filter: blur(12px);
    transition: border-color 0.3s;
}

.url-card:hover {
    border-color: var(--border-accent);
}

.url-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.url-icon {
    color: var(--accent-secondary);
}

.url-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.url-display {
    font-size: 0.95rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    white-space: nowrap;
}

.url-protocol {
    color: var(--text-muted);
}

.url-domain {
    color: var(--accent-secondary);
    font-weight: 600;
}

.url-path {
    color: var(--text-secondary);
}

/* ==========================================
   NFC Visual
   ========================================== */

.nfc-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    margin-bottom: 28px;
    position: relative;
}

.phone-icon {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.3s, transform 0.3s;
}

.phone-icon.active {
    color: var(--accent-secondary);
    transform: scale(1.05);
}

.phone-icon.success {
    color: var(--success);
}

.nfc-waves {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
}

.nfc-waves.active {
    opacity: 1;
}

.wave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    opacity: 0;
}

.wave-1 {
    width: 100px;
    height: 100px;
}

.wave-2 {
    width: 140px;
    height: 140px;
}

.wave-3 {
    width: 180px;
    height: 180px;
}

.nfc-waves.active .wave {
    animation: waveExpand 2s ease-out infinite;
}

.nfc-waves.active .wave-2 {
    animation-delay: 0.4s;
}

.nfc-waves.active .wave-3 {
    animation-delay: 0.8s;
}

@keyframes waveExpand {
    0% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(0.6);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.3);
    }
}

.nfc-status-text {
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s;
}

.nfc-status-text.active {
    color: var(--accent-secondary);
}

.nfc-status-text.success {
    color: var(--success);
}

.nfc-status-text.error {
    color: var(--error);
}

/* ==========================================
   Buttons
   ========================================== */

.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md), 0 0 30px rgba(108, 92, 231, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 50px rgba(108, 92, 231, 0.3);
}

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

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

.btn-secondary {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-secondary:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    transform: translateY(-1px);
}

/* ==========================================
   Log Section
   ========================================== */

.log-section {
    background: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 32px;
    backdrop-filter: blur(12px);
}

.log-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.log-clear {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}

.log-clear:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.log-entries {
    max-height: 240px;
    overflow-y: auto;
    padding: 8px 0;
}

.log-entries::-webkit-scrollbar {
    width: 4px;
}

.log-entries::-webkit-scrollbar-track {
    background: transparent;
}

.log-entries::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 4px;
}

.log-entry {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 18px;
    font-size: 0.82rem;
    line-height: 1.5;
    animation: logSlideIn 0.3s ease-out;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.log-entry:last-child {
    border-bottom: none;
}

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

.log-time {
    color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.72rem;
    white-space: nowrap;
    padding-top: 1px;
}

.log-message {
    color: var(--text-secondary);
    flex: 1;
}

.log-entry.info .log-message { color: var(--accent-secondary); }
.log-entry.success .log-message { color: var(--success); }
.log-entry.error .log-message { color: var(--error); }
.log-entry.warning .log-message { color: var(--warning); }

.log-empty {
    padding: 24px 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ==========================================
   Info Cards
   ========================================== */

.info-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 32px;
}

.info-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    backdrop-filter: blur(12px);
    transition: border-color 0.3s, transform 0.3s;
}

.info-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
}

.info-card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--gradient-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-secondary);
    margin-bottom: 14px;
}

.info-card-icon.warn {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.info-card h3 {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.info-card p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ==========================================
   Footer
   ========================================== */

.app-footer {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.app-footer a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.app-footer a:hover {
    color: var(--accent-primary);
}

/* ==========================================
   Toast
   ========================================== */

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 1.1rem;
}

/* ==========================================
   Modal
   ========================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 36px 28px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s;
    box-shadow: var(--shadow-lg);
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-icon {
    color: var(--error);
    margin-bottom: 20px;
}

.modal h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.modal p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.modal ul {
    list-style: none;
    text-align: left;
    margin-bottom: 20px;
}

.modal ul li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 6px 0;
}

.modal-alt {
    background: var(--gradient-subtle);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
}

.modal-alt h3 {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--accent-secondary);
}

.modal-alt p {
    font-size: 0.8rem;
    margin-bottom: 0;
}

.modal-btn {
    width: 100%;
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 400px) {
    .hero-title {
        font-size: 2rem;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }

    .app-container {
        padding: 0 16px;
    }
}
