/* Clipboard Transfer Tool Specific Styles */

/* Progress Tracker */
.progress-tracker {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    position: relative;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 2;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    left: calc(50% + 20px);
    right: calc(-50% + 20px);
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

.progress-step.active:not(:last-child)::after {
    background: var(--primary-color);
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background: var(--primary-color);
    color: white;
}

.progress-step.completed .step-number {
    background: var(--success-color);
    color: white;
}

.step-label {
    font-size: 0.8rem;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
}

.progress-step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.progress-step.completed .step-label {
    color: var(--success-color);
}

/* Make the "Connected" step green when active */
.progress-step[data-step="connected"].active .step-number {
    background: #16a34a;
    color: white;
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.2);
}

.progress-step[data-step="connected"].active .step-label {
    color: #16a34a;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 2px;
    width: 0%;
    transition: width 0.5s ease;
}

/* Responsive adjustments for progress tracker */
@media (max-width: 768px) {
    .progress-steps {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .progress-step {
        flex: 1;
        min-width: calc(50% - 0.25rem);
    }
    
    .progress-step:not(:last-child)::after {
        display: none;
    }
    
    .step-label {
        font-size: 0.75rem;
    }
}

/* Connected Banner */
.connected-banner {
    background: #16a34a;
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-md);
    border: 2px solid #16a34a;
}

.connected-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    flex-shrink: 0;
}

.connected-text h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.connected-text p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.status-display {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.status-display.connecting {
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.status-display.connected {
    border-color: var(--success-color);
    background: #f0fdf4;
    color: #15803d;
}

[data-theme="dark"] .status-display.connected {
    background: #0f1e13;
    color: var(--success-color);
}

.status-display.error {
    border-color: var(--error-color);
    background: #fef2f2;
    color: var(--error-color);
}

[data-theme="dark"] .status-display.error {
    background: #1f1113;
}

.status-text {
    font-weight: 500;
    font-size: 1rem;
}

/* QR Code Container */
.qr-container {
    text-align: center;
    padding: 2rem;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin: 1rem 0;
    overflow: visible;
}

#qr-canvas, #answer-qr-canvas {
    background: transparent;
    border-radius: 8px;
    margin: 1rem auto;
    box-shadow: var(--shadow-md);
    display: block;
    max-width: 100%;
    height: auto;
}

/* Security Info */
.security-info {
    background: var(--bg-primary);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

#security-code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    letter-spacing: 2px;
}

/* File Drop Zone */
.file-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--bg-secondary);
}

.file-drop-zone:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.file-drop-zone.drag-over {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    transform: scale(1.005);
}

/* Message Feed */
.message-feed {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background: var(--bg-secondary);
    margin-top: 0.5rem;
}

.message-item {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--primary-color);
    position: relative;
}

.message-item.sent {
    border-left-color: var(--success-color);
}

.message-item.received {
    border-left-color: var(--primary-color);
}

.message-item.file {
    border-left-color: #f59e0b;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.message-type {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.message-content {
    word-wrap: break-word;
    white-space: pre-wrap;
    font-family: inherit;
}

.message-content.clipboard-text {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 6px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* File Message Specific */
.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.file-icon {
    width: 2rem;
    height: 2rem;
    background: var(--primary-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.file-mime {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Courier New', monospace;
    margin-top: 0.25rem;
    opacity: 0.8;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

/* Transfer Progress */
.transfer-item {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

.transfer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.transfer-name {
    font-weight: 500;
}

.transfer-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.transfer-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.transfer-speed {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Radio Button Styling */
input[type="radio"] {
    margin-right: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .qr-container {
        padding: 1rem;
    }
    
    #qr-canvas {
        max-width: 100%;
        height: auto;
    }
    
    .file-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .message-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* Animation for connection status */
.status-display.connecting .status-text::after {
    content: '';
    animation: pulse 1.5s infinite;
}

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

/* Copy feedback animation */
.btn-copy.copied {
    background: var(--success-color) !important;
    transform: scale(0.95);
}

.btn-copy.copied::after {
    content: ' ✓';
}

/* Small button styles */
.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Paste button - blue/info color */
.btn-paste {
    background: #3b82f6;
    color: white;
    margin: 0.25rem;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.btn-paste:hover {
    background: #2563eb;
}

/* Disconnect button - red/danger color */
.btn-disconnect {
    background: #dc2626;
    color: white;
    margin: 0.25rem;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.btn-disconnect:hover {
    background: #b91c1c;
}

/* URL Section */
.url-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.url-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.url-input {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    width: 100%;
    margin-bottom: 0.75rem;
}

.url-section .btn-copy {
    width: 100%;
    max-width: 200px;
    margin-bottom: 1rem;
}

/* URL Processing Banner */
.url-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1rem 0;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--primary-color);
    animation: slideIn 0.5s ease-out;
}

.url-banner h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.url-banner p {
    margin: 0;
    opacity: 0.9;
}

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

/* OTP Connection Styles */
.method-selection {
    flex-wrap: wrap;
    gap: 0.75rem;
}

.method-description {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.method-description span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

.otp-display {
    margin: 1.5rem 0;
}

.otp-instruction {
    margin-bottom: 1.5rem;
}

.otp-instruction p {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.otp-instruction ol {
    margin: 0.5rem 0 0 1.5rem;
    color: var(--text-secondary);
}

.otp-instruction ol li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.otp-code-display {
    text-align: center;
    margin: 2rem 0;
}

.otp-code {
    display: inline-block;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-color);
    background: var(--bg-primary);
    padding: 1rem 2rem;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    letter-spacing: 2px;
    text-transform: lowercase;
    box-shadow: var(--shadow-sm);
    min-width: 200px;
}

.otp-input-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.otp-input {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-width: 250px;
    text-align: center;
    text-transform: lowercase;
    transition: border-color 0.3s ease;
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.otp-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.otp-status {
    text-align: center;
    margin-top: 1.5rem;
}

.otp-status p {
    color: var(--text-secondary);
    font-style: italic;
}

/* Hide connection type group in OTP mode */
.otp-mode #connection-type-group {
    display: none;
}

/* Responsive OTP styles */
@media (max-width: 768px) {
    .otp-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .otp-input {
        min-width: auto;
        width: 100%;
    }
    
    .otp-code {
        font-size: 1.2rem;
        padding: 0.75rem 1rem;
        min-width: auto;
        letter-spacing: 1px;
    }
    
    .method-selection {
        flex-direction: column;
    }
}

/* Subtle animation for OTP code display */
.otp-code {
    animation: otpAppear 0.2s ease-out;
}

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


/* Image preview styles */
.image-preview {
    margin: 1rem 0;
    text-align: center;
}

.image-preview img {
    display: block;
    margin: 0 auto 0.75rem auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.image-preview img:hover {
    box-shadow: var(--shadow-md);
}

.image-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* Custom radio button styles */
.method-selection {
    gap: 1.5rem !important;
    margin: 1rem 0;
}

.method-selection input[type="radio"] {
    display: none;
}

.method-selection label {
    position: relative;
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem 1rem 3rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 180px;
    text-align: left;
}

.method-selection label::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-primary);
    transition: all 0.3s ease;
}

.method-selection label::after {
    content: '';
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-primary);
    transition: all 0.3s ease;
}

.method-selection input[type="radio"]:checked + label {
    background: var(--primary-light, rgba(59, 130, 246, 0.1));
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.method-selection input[type="radio"]:checked + label::before {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.method-selection input[type="radio"]:checked + label::after {
    transform: translateY(-50%) scale(1);
    background: var(--bg-primary);
}

.method-selection label:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Dark theme adjustments for radio buttons */
[data-theme="dark"] .method-selection input[type="radio"]:checked + label::after {
    background: var(--bg-primary);
}

[data-theme="dark"] .method-selection label:hover {
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

/* Mobile responsiveness for radio buttons */
@media (max-width: 768px) {
    .method-selection {
        flex-direction: column;
        gap: 1rem !important;
    }
    
    .method-selection label {
        min-width: auto;
        width: 100%;
    }
}

/* Browser warning styles */
.browser-warning {
    background: var(--warning-light, #fff3cd);
    border: 1px solid var(--warning-color, #ffc107);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.browser-warning p {
    margin: 0;
    color: var(--warning-dark, #856404);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Dark theme adjustments */
[data-theme="dark"] .browser-warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
}

[data-theme="dark"] .browser-warning p {
    color: var(--warning-color);
}

/* Mobile responsiveness for image preview */
@media (max-width: 768px) {
    .image-preview img {
        max-width: 100% !important;
        height: auto !important;
    }
}