/* URL Shortener Specific Styles */

/* URL Output Styling */
.url-output {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: auto;
}

.url-output .placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: var(--spacing-xl);
}

.url-output .placeholder svg {
    width: 60px;
    height: 60px;
    margin-bottom: var(--spacing-lg);
    color: var(--border-color);
}

.url-output .placeholder p {
    font-size: 1.125rem;
}

/* Result Display */
.result-item {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.result-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.result-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.result-type {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.result-type.shortened {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.result-type.expanded {
    background: rgba(20, 184, 166, 0.1);
    color: var(--secondary-color);
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.result-content {
    margin-bottom: var(--spacing-md);
}

.result-url {
    display: block;
    padding: var(--spacing-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    word-break: break-all;
    margin-bottom: var(--spacing-sm);
    position: relative;
}

.result-url:hover {
    border-color: var(--primary-color);
}

.copy-button {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.copy-button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.stat-card {
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* URL History */
.url-history {
    background: var(--card-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-2xl);
}

.history-container {
    margin-top: var(--spacing-lg);
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-placeholder {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background: var(--surface-color);
}

.history-content {
    flex: 1;
    min-width: 0;
}

.history-original {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-short {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.history-action {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.history-action:hover {
    background: var(--primary-color);
    color: white;
}

/* QR Code Display */
.qr-code-container {
    margin-top: var(--spacing-lg);
    text-align: center;
    padding: var(--spacing-lg);
    background: white;
    border-radius: var(--radius-md);
    display: inline-block;
}

.qr-code-container canvas {
    max-width: 100%;
    height: auto;
}

.qr-download {
    margin-top: var(--spacing-md);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.qr-download:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Bulk Processing */
.bulk-input {
    margin-bottom: var(--spacing-lg);
}

.bulk-textarea {
    width: 100%;
    min-height: 150px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-primary);
    resize: vertical;
}

.bulk-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    flex-wrap: wrap;
}

.bulk-result {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.bulk-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.bulk-result-table {
    width: 100%;
    border-collapse: collapse;
}

.bulk-result-table th,
.bulk-result-table td {
    padding: var(--spacing-sm);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.bulk-result-table th {
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.1);
}

.bulk-result-table tr:last-child td {
    border-bottom: none;
}

.bulk-result-table tr:hover td {
    background: rgba(99, 102, 241, 0.05);
}

.url-status {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.url-status.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.url-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

/* Loading States */
.processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    z-index: 10;
}

.processing-content {
    text-align: center;
    padding: var(--spacing-xl);
}

.processing-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-lg);
}

.processing-text {
    color: var(--text-primary);
    font-size: 1.125rem;
    margin-bottom: var(--spacing-md);
}

.progress-bar {
    width: 200px;
    height: 6px;
    background: var(--surface-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: var(--spacing-md);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
    
    .result-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
    
    .history-actions {
        align-self: flex-end;
    }
    
    .bulk-actions {
        flex-direction: column;
    }
    
    .bulk-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .result-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: var(--spacing-xs);
    }
    
    .stat-label {
        font-size: 0.625rem;
    }
    
    .stat-value {
        font-size: 0.875rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    animation: fadeInUp 0.3s ease-out;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .result-item {
        animation: none;
    }
    
    .processing-spinner {
        animation: none;
        border-top-color: var(--primary-color);
    }
}
