/* ================================================================
   Remote Clipboard Tool Styles
   Uses D3 Dev Tools token system (tokens.css)
   ================================================================ */

.rc-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-bottom: 2rem;
}

/* Header & Expiration Banner */
.rc-header-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-xs);
}

.rc-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-fg);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.rc-title i {
    color: var(--color-accent);
}

.rc-subtitle {
    color: var(--color-fg-muted);
    font-size: 0.92rem;
    margin-bottom: 0;
}

/* Expiry indicator pill */
.rc-expiry-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    color: var(--color-fg);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.rc-expiry-pill i {
    color: var(--color-warning);
}

.rc-expiry-pill .rc-timer-value {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--color-accent);
}

/* Pairing & Room Card */
.rc-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
}

.rc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-elevated);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-fg);
}

.rc-card-body {
    padding: 1.25rem;
    flex: 1;
}

/* Room Code Display */
.rc-code-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.rc-code-box {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.25rem;
    color: var(--color-accent);
    background: var(--color-surface-elevated);
    border: 2px dashed var(--color-border);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    user-select: all;
    display: inline-block;
}

/* QR Code Section */
.rc-qr-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin: 0 auto 1rem;
    max-width: 200px;
    box-shadow: var(--shadow-xs);
}

.rc-qr-code {
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rc-qr-code img,
.rc-qr-code canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

.rc-qr-hint {
    font-size: 0.8rem;
    color: #4b5563;
    margin-top: 0.5rem;
    text-align: center;
    font-weight: 500;
}

/* Connected Devices Bar */
.rc-devices-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}

.rc-pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-success);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: rc-pulse 2s infinite;
}

.rc-pulse-dot.disconnected {
    background-color: var(--color-danger);
    animation: none;
}

.rc-pulse-dot.waiting {
    background-color: var(--color-warning);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
}

@keyframes rc-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Editor / Sender Area */
.rc-textarea-wrapper {
    position: relative;
    margin-bottom: 0.75rem;
}

.rc-textarea {
    width: 100%;
    min-height: 140px;
    max-height: 380px;
    padding: 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    background: var(--color-bg);
    color: var(--color-fg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rc-textarea:focus {
    outline: none;
    border-color: var(--color-ring);
    box-shadow: var(--shadow-ring);
}

.rc-editor-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.rc-stats-text {
    font-size: 0.82rem;
    color: var(--color-fg-muted);
    font-family: var(--font-mono);
}

/* Feed / Shared Items List */
.rc-feed-container {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

/* Empty State */
.rc-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--color-fg-muted);
}

.rc-empty-icon {
    font-size: 2.8rem;
    color: var(--color-fg-muted);
    opacity: 0.6;
    margin-bottom: 0.75rem;
}

/* Item Card */
.rc-item-card {
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-xs);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    animation: rc-fade-in 0.25s ease-out;
}

.rc-item-card:hover {
    border-color: color-mix(in srgb, var(--color-accent) 40%, var(--color-border));
    box-shadow: var(--shadow-sm);
}

@keyframes rc-fade-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rc-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    font-size: 0.82rem;
}

.rc-item-sender {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.rc-item-sender.desktop {
    background: color-mix(in srgb, var(--color-accent) 15%, transparent);
    color: var(--color-accent);
}

.rc-item-sender.mobile {
    background: color-mix(in srgb, var(--color-success) 15%, transparent);
    color: var(--color-success);
}

.rc-item-meta {
    color: var(--color-fg-muted);
    font-size: 0.78rem;
}

.rc-item-content {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--color-fg);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow-y: auto;
    line-height: 1.45;
}

.rc-item-content.is-url {
    color: var(--color-accent);
    text-decoration: underline;
    cursor: pointer;
}

.rc-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.rc-item-actions-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Join Modal / Room Switcher */
.rc-join-box {
    display: flex;
    gap: 0.5rem;
}

/* Copy Animation Badge */
.rc-copied-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--color-success);
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 9999;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: rc-toast-in 0.2s ease-out;
}

@keyframes rc-toast-in {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* File Sharing Tip Card */
.rc-file-share-tip {
    background: color-mix(in srgb, var(--color-accent) 6%, var(--color-surface));
    border: 1px dashed color-mix(in srgb, var(--color-accent) 35%, var(--color-border));
    border-radius: var(--radius-md);
    padding: 0.95rem 1.15rem;
    font-size: 0.88rem;
    color: var(--color-fg);
}

.rc-tip-icon {
    font-size: 1.25rem;
    color: var(--color-warning);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.rc-tip-text {
    font-size: 0.85rem;
    color: var(--color-fg-muted);
    line-height: 1.5;
}

.rc-tip-text a {
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 1px dotted var(--color-accent);
}

.rc-tip-text a:hover {
    color: var(--color-accent);
    border-bottom-style: solid;
}

/* Collapsible Pairing & Setup Section (All Device Types) */
.rc-collapsible-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.rc-collapsible-header:hover {
    background-color: color-mix(in srgb, var(--color-accent) 6%, var(--color-surface-elevated));
}

@media (max-width: 991.98px) {
    .rc-qr-wrapper {
        max-width: 170px;
        padding: 0.75rem;
    }

    .rc-qr-code {
        width: 140px;
        height: 140px;
    }
}
